smr/src/sql/create_table_posts.sql

20 lines
523 B
SQL

/*
If/when an author delets their account, all posts
and comments by that author are also deleted (on
delete cascade) this is intentional. This also
means that all comments by other users on a post
an author makes will also be deleted.
Post text uses zlib compression
*/
CREATE TABLE IF NOT EXISTS posts (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
post_text BLOB,
post_title TEXT,
authorid REFERENCES authors(id) ON DELETE CASCADE,
isanon INTEGER,
hashedip BLOB,
post_time INTEGER,
views INTEGER DEFAULT 0
);