sqlx/tests/mysql/migrations/3_comment.sql
2022-08-02 14:38:12 -07:00

11 lines
326 B
SQL

create table comment
(
comment_id integer primary key,
post_id integer not null references post (post_id),
user_id integer not null references user (user_id),
content text not null,
created_at datetime default current_timestamp
);
create index comment_created_at on comment (created_at desc);