From b7208381cb5d39f95cb3258cb22b6181d8f7a7ed Mon Sep 17 00:00:00 2001 From: mst Date: Sat, 19 Oct 2024 23:58:35 +0300 Subject: [PATCH] update schema to support content warnings --- schema.sql | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/schema.sql b/schema.sql index ae78985..12229c3 100644 --- a/schema.sql +++ b/schema.sql @@ -2,7 +2,8 @@ CREATE TABLE IF NOT EXISTS answers ( id INT PRIMARY KEY AUTO_INCREMENT, question_id INT NOT NULL, creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - content TEXT NOT NULL + content TEXT NOT NULL, + cw VARCHAR(255) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS questions ( @@ -12,9 +13,11 @@ CREATE TABLE IF NOT EXISTS questions ( content TEXT NOT NULL, answered BOOLEAN NOT NULL DEFAULT FALSE, answer_id INT, - pinned BOOLEAN NOT NULL DEFAULT FALSE - -- below is reserved for version 1.6.0 or later - -- private BOOLEAN NOT NULL DEFAULT FALSE + pinned BOOLEAN NOT NULL DEFAULT FALSE, + cw VARCHAR(255) NOT NULL DEFAULT '' + -- below is reserved for version 1.7.0 or later + -- private BOOLEAN NOT NULL DEFAULT FALSE, + -- user_ip VARBINARY(16) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ALTER TABLE questions