2023-08-10 00:28:48 +02:00
|
|
|
/* md
|
|
|
|
@name sql/table/posts
|
2020-12-20 09:16:23 +01:00
|
|
|
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
|
2021-01-10 22:34:13 +01:00
|
|
|
|
|
|
|
Unlisted hashes are SHAv3 521
|
2020-12-20 09:16:23 +01:00
|
|
|
*/
|
2023-08-10 00:28:48 +02:00
|
|
|
|
|
|
|
/* sh
|
|
|
|
@name sql/table/posts
|
|
|
|
echo "digraph comments{" \
|
|
|
|
"$(cat doc/schema/authors.dot)" \
|
|
|
|
"$(cat doc/schema/posts.dot)" \
|
|
|
|
"}" | dot -Tsvg
|
|
|
|
*/
|
2020-05-17 18:05:00 +02:00
|
|
|
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,
|
2020-10-11 01:28:39 +02:00
|
|
|
post_time INTEGER,
|
2021-01-10 22:34:13 +01:00
|
|
|
views INTEGER DEFAULT 0,
|
|
|
|
unlisted INTEGER,
|
|
|
|
hash BLOB
|
2020-05-17 18:05:00 +02:00
|
|
|
);
|