forked from mtusi2026/mtusi2026lab3
7 lines
255 B
SQL
7 lines
255 B
SQL
CREATE TABLE IF NOT EXISTS messages (
|
|
id UUID PRIMARY KEY,
|
|
chat_id UUID NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
|
sender_id UUID NOT NULL REFERENCES users(id),
|
|
text TEXT NOT NULL,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
); |