1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-05-28 14:33:56 +00:00

Track favorites on a per-user basis

Currently, favorites are tracked at the cipher level. For org-owned ciphers,
this means that if one user sets it as a favorite, it automatically becomes a
favorite for all other users that the cipher has been shared with.
This commit is contained in:
Jeremy Lin 2020-08-19 02:16:27 -07:00
parent 0e9eba8c8b
commit f83a8a36d1
12 changed files with 178 additions and 8 deletions

View file

@ -0,0 +1,4 @@
DROP TABLE favorites;
ALTER TABLE ciphers
ADD COLUMN favorite BOOLEAN NOT NULL;

View file

@ -0,0 +1,9 @@
CREATE TABLE favorites (
user_uuid CHAR(36) NOT NULL REFERENCES users(uuid),
cipher_uuid CHAR(36) NOT NULL REFERENCES ciphers(uuid),
PRIMARY KEY (user_uuid, cipher_uuid)
);
ALTER TABLE ciphers
DROP COLUMN favorite;