chatthing/crates/backend/migrations/20240921175315_init.sql

20 lines
671 B
MySQL
Raw Normal View History

2024-09-23 00:12:56 +00:00
--============================================================================--
-- I HATE DATABASES!!! --
--============================================================================--
create table chats (
id uuid default (gen_random_uuid()) primary key,
url_path char(6) unique not null,
name text
);
create table messages (
id uuid default (gen_random_uuid()) primary key,
2024-10-04 18:18:36 +00:00
timestamp timestamptz not null default (now()),
2024-09-23 00:12:56 +00:00
chat_id uuid not null references chats(id),
content varchar(2000) not null,
from_admin boolean not null
2024-10-04 18:18:36 +00:00
);
insert into chats (url_path) values ('tstcht');