You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
7 years ago
|
ALTER TABLE ciphers RENAME TO oldCiphers;
|
||
|
|
||
|
CREATE TABLE ciphers (
|
||
6 years ago
|
uuid TEXT NOT NULL PRIMARY KEY,
|
||
7 years ago
|
created_at DATETIME NOT NULL,
|
||
|
updated_at DATETIME NOT NULL,
|
||
6 years ago
|
user_uuid TEXT REFERENCES users (uuid), -- Make this optional
|
||
|
organization_uuid TEXT REFERENCES organizations (uuid), -- Add reference to orgs table
|
||
7 years ago
|
-- Remove folder_uuid
|
||
6 years ago
|
type INTEGER NOT NULL,
|
||
7 years ago
|
name TEXT NOT NULL,
|
||
|
notes TEXT,
|
||
|
fields TEXT,
|
||
|
data TEXT NOT NULL,
|
||
|
favorite BOOLEAN NOT NULL
|
||
|
);
|
||
|
|
||
|
CREATE TABLE folders_ciphers (
|
||
6 years ago
|
cipher_uuid TEXT NOT NULL REFERENCES ciphers (uuid),
|
||
|
folder_uuid TEXT NOT NULL REFERENCES folders (uuid),
|
||
7 years ago
|
|
||
|
PRIMARY KEY (cipher_uuid, folder_uuid)
|
||
|
);
|
||
|
|
||
6 years ago
|
INSERT INTO ciphers (uuid, created_at, updated_at, user_uuid, organization_uuid, type, name, notes, fields, data, favorite)
|
||
|
SELECT uuid, created_at, updated_at, user_uuid, organization_uuid, type, name, notes, fields, data, favorite FROM oldCiphers;
|
||
7 years ago
|
|
||
|
INSERT INTO folders_ciphers (cipher_uuid, folder_uuid)
|
||
|
SELECT uuid, folder_uuid FROM oldCiphers WHERE folder_uuid IS NOT NULL;
|
||
|
|
||
|
|
||
7 years ago
|
DROP TABLE oldCiphers;
|
||
|
|
||
|
ALTER TABLE users_collections ADD COLUMN read_only BOOLEAN NOT NULL DEFAULT 0; -- False
|