Jeremy Lin
4 years ago
6 changed files with 57 additions and 9 deletions
@ -1,4 +1,13 @@ |
|||||
DROP TABLE favorites; |
|
||||
|
|
||||
ALTER TABLE ciphers |
ALTER TABLE ciphers |
||||
ADD COLUMN favorite BOOLEAN NOT NULL; |
ADD COLUMN favorite BOOLEAN NOT NULL DEFAULT FALSE; |
||||
|
|
||||
|
-- Transfer favorite status for user-owned ciphers. |
||||
|
UPDATE ciphers |
||||
|
SET favorite = TRUE |
||||
|
WHERE EXISTS ( |
||||
|
SELECT * FROM favorites |
||||
|
WHERE favorites.user_uuid = ciphers.user_uuid |
||||
|
AND favorites.cipher_uuid = ciphers.uuid |
||||
|
); |
||||
|
|
||||
|
DROP TABLE favorites; |
||||
|
@ -1,4 +1,13 @@ |
|||||
DROP TABLE favorites; |
|
||||
|
|
||||
ALTER TABLE ciphers |
ALTER TABLE ciphers |
||||
ADD COLUMN favorite BOOLEAN NOT NULL; |
ADD COLUMN favorite BOOLEAN NOT NULL DEFAULT FALSE; |
||||
|
|
||||
|
-- Transfer favorite status for user-owned ciphers. |
||||
|
UPDATE ciphers |
||||
|
SET favorite = TRUE |
||||
|
WHERE EXISTS ( |
||||
|
SELECT * FROM favorites |
||||
|
WHERE favorites.user_uuid = ciphers.user_uuid |
||||
|
AND favorites.cipher_uuid = ciphers.uuid |
||||
|
); |
||||
|
|
||||
|
DROP TABLE favorites; |
||||
|
@ -1,4 +1,13 @@ |
|||||
DROP TABLE favorites; |
|
||||
|
|
||||
ALTER TABLE ciphers |
ALTER TABLE ciphers |
||||
ADD COLUMN favorite BOOLEAN NOT NULL; |
ADD COLUMN favorite BOOLEAN NOT NULL DEFAULT 0; -- FALSE |
||||
|
|
||||
|
-- Transfer favorite status for user-owned ciphers. |
||||
|
UPDATE ciphers |
||||
|
SET favorite = 1 |
||||
|
WHERE EXISTS ( |
||||
|
SELECT * FROM favorites |
||||
|
WHERE favorites.user_uuid = ciphers.user_uuid |
||||
|
AND favorites.cipher_uuid = ciphers.uuid |
||||
|
); |
||||
|
|
||||
|
DROP TABLE favorites; |
||||
|
Loading…
Reference in new issue