filer/db/schema.sql

26 lines
693 B
MySQL
Raw Permalink Normal View History

2023-08-25 02:25:38 +02:00
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)
);