8 lines
254 B
SQL
8 lines
254 B
SQL
CREATE TABLE comments (
|
|
comment_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
post_id UUID NOT NULL REFERENCES posts (post_id) ON DELETE CASCADE,
|
|
author TEXT,
|
|
content TEXT NOT NULL,
|
|
published_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|