2024-04-29 22:00:47 +01:00
|
|
|
create table users
|
|
|
|
(
|
|
|
|
id integer unsigned not null auto_increment primary key,
|
|
|
|
pubkey binary(32) not null,
|
|
|
|
created timestamp default current_timestamp
|
|
|
|
);
|
|
|
|
create unique index ix_user_pubkey on users (pubkey);
|
|
|
|
create table uploads
|
|
|
|
(
|
|
|
|
id binary(32) not null primary key,
|
|
|
|
user_id integer unsigned not null,
|
|
|
|
name varchar(256) not null,
|
|
|
|
size integer unsigned not null,
|
2024-04-30 16:07:15 +01:00
|
|
|
mime_type varchar(128) not null,
|
2024-04-29 22:00:47 +01:00
|
|
|
created timestamp default current_timestamp,
|
|
|
|
|
|
|
|
constraint fk_uploads_user
|
|
|
|
foreign key (user_id) references users (id)
|
|
|
|
on delete cascade
|
|
|
|
on update restrict
|
|
|
|
);
|