vybe/db/1-init.sql

32 lines
696 B
MySQL
Raw Normal View History

2023-05-05 19:33:05 -07:00
CREATE TABLE users (
id integer primary key asc,
name text,
pubkey text,
created timestamp default current_timestamp
);
2023-05-07 18:43:57 -07:00
CREATE TABLE authentications (
user integer,
salt text,
foreign key(user) references users(id)
);
2023-05-05 19:33:05 -07:00
CREATE TABLE threads (
id integer primary key asc,
2023-05-08 20:51:17 -07:00
name text,
creator integer,
created timestamp default current_timestamp,
foreign key(creator) references users(id)
2023-05-05 19:33:05 -07:00
);
CREATE TABLE posts (
id integer primary key asc,
user integer,
thread integer,
content text,
created timestamp default current_timestamp,
foreign key(user) references users(id),
foreign key(thread) references threads(id)
);
2023-05-08 20:51:17 -07:00
INSERT INTO threads (name) values ("meow");