Files
mtusi2026lab2/migrations/004_messages.sql
T
Queenfish 6bfbcf74fc
Skeleton contracts / contracts (pull_request) Failing after 37s
Мессенджер с Postgres, Redis, Valkey
2026-10-08 13:21:48 +03:00

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()
);