codigocomentado/migrations/2022-12-22-062417_create_posts/up.sql

11 lines
271 B
MySQL
Raw Normal View History

2019-11-14 02:10:07 +00:00
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
title VARCHAR NOT NULL,
content TEXT NOT NULL,
published BOOLEAN NOT NULL DEFAULT 'f',
2022-12-22 21:46:42 +00:00
views integer NOT NULL DEFAULT 0,
2019-11-14 02:10:07 +00:00
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
)
2022-12-22 21:46:42 +00:00