We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
week3-aaae/database/model.js
Lines 43 to 46 in 33325a1
Good idea to put a created_at column in your posts table. You will usually regret not doing this later on 😅
created_at
posts
You could avoid the need to specify the timestamp manually on each insert by using a SQL "default" when you set the table up:
CREATE TABLE posts ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users(id) ON DELETE CASCADE, text_content TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
Then you just don't specify that column on insert—Postgres will automatically use the default value.
(If you really want to type less apparently now() will give the same result as current_timestamp
now()
current_timestamp
The text was updated successfully, but these errors were encountered:
No branches or pull requests
week3-aaae/database/model.js
Lines 43 to 46 in 33325a1
Good idea to put a
created_at
column in yourposts
table. You will usually regret not doing this later on 😅You could avoid the need to specify the timestamp manually on each insert by using a SQL "default" when you set the table up:
Then you just don't specify that column on insert—Postgres will automatically use the default value.
(If you really want to type less apparently
now()
will give the same result ascurrent_timestamp
The text was updated successfully, but these errors were encountered: