Skip to content

Commit

Permalink
update: Add a updated_at column to entity
Browse files Browse the repository at this point in the history
  • Loading branch information
bush1D3v committed Jul 9, 2024
1 parent b4ff6ee commit edbd1f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions migrations/20240530181229_create_posts/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
3 changes: 2 additions & 1 deletion migrations/20240530181637_create_users/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
1 change: 1 addition & 0 deletions migrations/20240530181926_create_comments/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit edbd1f6

Please sign in to comment.