File: 2_post.sql

package info (click to toggle)
rust-sqlx 0.8.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,744 kB
  • sloc: sql: 335; python: 268; sh: 71; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 308 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
create table post
(
    post_id    integer primary key,
    user_id    integer not null references user (user_id),
    content    text    not null,
    -- Defaults have to be wrapped in parenthesis
    created_at datetime default (datetime('now'))
);

create index post_created_at on post (created_at desc);