From 05e44508e183bb15a65128836ca72e9c1eb29cef Mon Sep 17 00:00:00 2001
From: Johnny Zheng <jzheng2@emich.edu>
Date: Sun, 16 Mar 2025 16:02:10 -0400
Subject: [PATCH] Added timestamps to tables

---
 initdb/schema.sql | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/initdb/schema.sql b/initdb/schema.sql
index c75e3de..b91c7e7 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
 );
-- 
GitLab