Rework migrations for MySQL

This commit is contained in:
Emil Madsen
2019-05-20 21:12:41 +02:00
parent 85c8a01f4a
commit ab95a69dc8
22 changed files with 154 additions and 321 deletions

View File

@@ -1,8 +1,8 @@
ALTER TABLE attachments RENAME TO oldAttachments;
CREATE TABLE attachments (
id TEXT NOT NULL PRIMARY KEY,
cipher_uuid TEXT NOT NULL REFERENCES ciphers (uuid),
id VARCHAR(40) NOT NULL PRIMARY KEY,
cipher_uuid VARCHAR(40) NOT NULL REFERENCES ciphers (uuid),
file_name TEXT NOT NULL,
file_size INTEGER NOT NULL
@@ -11,4 +11,4 @@ CREATE TABLE attachments (
INSERT INTO attachments (id, cipher_uuid, file_name, file_size)
SELECT id, cipher_uuid, file_name, file_size FROM oldAttachments;
DROP TABLE oldAttachments;
DROP TABLE oldAttachments;