mirror of
https://github.com/RoastSlav/quickdrop.git
synced 2025-12-30 11:09:59 -06:00
added migration for share token table
This commit is contained in:
@@ -8,3 +8,42 @@ CREATE TABLE IF NOT EXISTS share_token_entity
|
||||
CONSTRAINT fk_file FOREIGN KEY (file_id) REFERENCES file_entity (id)
|
||||
);
|
||||
|
||||
-- Removing share_token and token_expiration_date columns
|
||||
|
||||
ALTER TABLE file_entity
|
||||
RENAME TO file_entity_old;
|
||||
|
||||
CREATE TABLE file_entity
|
||||
(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
description VARCHAR(255),
|
||||
keep_indefinitely BOOLEAN,
|
||||
name VARCHAR(255),
|
||||
size BIGINT,
|
||||
upload_date DATE,
|
||||
uuid VARCHAR(255),
|
||||
password_hash VARCHAR(255),
|
||||
hidden BOOLEAN DEFAULT FALSE
|
||||
);
|
||||
|
||||
INSERT INTO file_entity (id,
|
||||
description,
|
||||
keep_indefinitely,
|
||||
name,
|
||||
size,
|
||||
upload_date,
|
||||
uuid,
|
||||
password_hash,
|
||||
hidden)
|
||||
SELECT id,
|
||||
description,
|
||||
keep_indefinitely,
|
||||
name,
|
||||
size,
|
||||
upload_date,
|
||||
uuid,
|
||||
password_hash,
|
||||
hidden
|
||||
FROM file_entity_old;
|
||||
|
||||
DROP TABLE file_entity_old;
|
||||
Reference in New Issue
Block a user