2020-08-19 11:16:27 +02:00
|
|
|
ALTER TABLE ciphers
|
2020-08-23 02:14:05 +02:00
|
|
|
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;
|