vybe/db/1-init.sql

61 lines
1.1 KiB
MySQL
Raw Normal View History

2024-03-18 23:07:48 -07:00
create table user (
id integer primary key asc,
name text,
displayname text,
2024-06-14 22:24:32 -07:00
public boolean default true,
2024-03-18 23:07:48 -07:00
created timestamp default current_timestamp
2023-05-05 19:33:05 -07:00
);
2024-04-28 22:55:54 -07:00
create table key (
2024-03-18 23:07:48 -07:00
user integer,
2024-04-28 22:55:54 -07:00
pubkey text,
2024-03-18 23:07:48 -07:00
created timestamp default current_timestamp,
2024-04-28 22:55:54 -07:00
active boolean,
2024-03-18 23:07:48 -07:00
foreign key(user) references user(id)
2023-05-07 18:43:57 -07:00
);
2024-03-18 23:07:48 -07:00
create table thread (
id integer primary key asc,
name text,
2024-06-12 03:00:50 -07:00
creator text,
created timestamp default current_timestamp
2023-05-05 19:33:05 -07:00
);
2024-03-18 23:07:48 -07:00
create table permission (
thread integer,
2024-06-12 03:00:50 -07:00
user text,
2024-03-18 23:07:48 -07:00
type text,
mutable boolean,
permission text,
value text,
foreign key(thread) references thread(id)
2023-05-28 14:56:08 -07:00
);
2023-05-09 00:04:48 -07:00
2024-03-18 23:07:48 -07:00
create table member (
thread integer,
2024-06-12 03:00:50 -07:00
user text,
2024-03-18 23:07:48 -07:00
created timestamp default current_timestamp,
foreign key(thread) references thread(id)
2023-05-28 14:56:08 -07:00
);
2023-05-09 00:04:48 -07:00
2024-03-18 23:07:48 -07:00
create table post (
id integer primary key asc,
2024-06-12 03:00:50 -07:00
user text,
2024-03-18 23:07:48 -07:00
thread integer,
content text,
encrypted bool,
created timestamp default current_timestamp,
foreign key(thread) references thread(id)
2023-05-05 19:33:05 -07:00
);
2024-03-18 23:07:48 -07:00
create table span (
id integer primary key asc,
thread integer,
2024-04-15 14:27:21 -07:00
deleted bool default false,
2024-03-18 23:07:48 -07:00
content text,
2024-04-15 14:27:21 -07:00
x decimal,
y decimal,
2024-03-18 23:07:48 -07:00
scale decimal,
foreign key(thread) references thread(id)
);