diff --git a/migrations/20240530181229_create_posts/up.sql b/migrations/20240530181229_create_posts/up.sql index 8e6c6b8..120b350 100644 --- a/migrations/20240530181229_create_posts/up.sql +++ b/migrations/20240530181229_create_posts/up.sql @@ -4,5 +4,6 @@ CREATE TABLE posts ( subtitle VARCHAR(255) NOT NULL, body TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL, + updated_at TIMESTAMPTZ NOT NULL, likes INT DEFAULT 0 ); diff --git a/migrations/20240530181637_create_users/up.sql b/migrations/20240530181637_create_users/up.sql index b3e33a3..21546a2 100644 --- a/migrations/20240530181637_create_users/up.sql +++ b/migrations/20240530181637_create_users/up.sql @@ -3,5 +3,6 @@ CREATE TABLE users ( name VARCHAR(63) NOT NULL, email VARCHAR(127) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, - created_at TIMESTAMPTZ NOT NULL + created_at TIMESTAMPTZ NOT NULL, + updated_at TIMESTAMPTZ NOT NULL ); diff --git a/migrations/20240530181926_create_comments/up.sql b/migrations/20240530181926_create_comments/up.sql index 71ae84c..b9aa9b6 100644 --- a/migrations/20240530181926_create_comments/up.sql +++ b/migrations/20240530181926_create_comments/up.sql @@ -6,6 +6,7 @@ CREATE TABLE comments ( body TEXT NOT NULL, likes INT DEFAULT 0, created_at TIMESTAMPTZ NOT NULL, + updated_at TIMESTAMPTZ NOT NULL, FOREIGN KEY (post_id) REFERENCES posts (id), FOREIGN KEY (user_id) REFERENCES users (id), FOREIGN KEY (parent_comment_id) REFERENCES comments (id)