I am still alive in case you were wondering
This commit is contained in:
parent
1e0c7f5041
commit
4de6254f08
18 changed files with 628 additions and 345 deletions
2
migrations/20240414181705_create-file.down.sql
Normal file
2
migrations/20240414181705_create-file.down.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
DROP TABLE IF EXISTS file_key;
|
||||
DROP TABLE IF EXISTS file;
|
10
migrations/20240414181705_create-file.up.sql
Normal file
10
migrations/20240414181705_create-file.up.sql
Normal file
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE IF NOT EXISTS file (
|
||||
hash BYTEA PRIMARY KEY,
|
||||
mime TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS file_key (
|
||||
id UUID PRIMARY KEY,
|
||||
file_hash BYTEA REFERENCES file (hash) NOT NULL,
|
||||
expires_at TIMESTAMP
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue