diff --git a/initdb/schema.sql b/initdb/schema.sql index c75e3de5094d916c74f057492c3ba162c704cfc4..b91c7e760f42c5903e32d052853eff6dcd0a2887 100644 --- a/initdb/schema.sql +++ b/initdb/schema.sql @@ -25,6 +25,7 @@ CREATE TABLE comments ( user_id int NOT NULL, video_id int NOT NULL, content text NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY (video_id) REFERENCES videos(id) ON DELETE CASCADE ); @@ -34,6 +35,7 @@ CREATE TABLE reply ( creator_id int NOT NULL, content text NOT NULL, comment_id int NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (comment_id) REFERENCES comments(id) ON DELETE CASCADE, FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE CASCADE );