smr/src/sql/create_table_authors.sql

24 lines
562 B
MySQL
Raw Normal View History

2023-05-17 23:18:24 +02:00
/* md
@name sql/table/authors
If an author deletes their account, all posts
2023-05-17 23:18:24 +02:00
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.
*/
/* sh
@name sql/table/authors
echo "digraph authors {" \
"$(cat doc/schema/authors.dot)" \
"}" | dot -Tsvg
*/
CREATE TABLE IF NOT EXISTS authors (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name TEXT UNIQUE ON CONFLICT FAIL,
salt BLOB,
passhash BLOB,
joindate INTEGER,
biography TEXT
);