This commit is contained in:
sam 2023-08-25 02:25:38 +02:00
commit 49b24e5773
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
22 changed files with 1499 additions and 0 deletions

View file

@ -0,0 +1,33 @@
-- +migrate Up
create table users (
id integer primary key,
username text not null unique,
password text not null,
is_admin boolean not null default false
);
create table tokens (
id integer primary key,
user_id integer not null references users (id) on delete cascade,
token text not null unique
);
create table files (
id text primary key, -- uuid
user_id integer not null references users (id) on delete cascade,
filename text not null,
content_type text not null,
hash text not null,
size integer not null,
created_at integer not null,
expires integer,
unique(filename, hash)
);
-- +migrate Down
drop table files;
drop table tokens;
drop table users;