--============================================================================--
-- 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,
    timestamp timestamptz not null default (now()),
    chat_id uuid not null references chats(id),
    content varchar(2000) not null,
    from_admin boolean not null
);

insert into chats (url_path) values ('tstcht');
