2020-08-19 05:16:27 -04:00
|
|
|
ALTER TABLE ciphers
|
2020-08-22 20:14:05 -04:00
|
|
|
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;
|