From 7682298fa7b97a2e06b65cd2230d3255f2d94981 Mon Sep 17 00:00:00 2001 From: Ayrat Hudaygulov Date: Sat, 20 Jul 2024 11:42:47 +0100 Subject: [PATCH] added tables to mark messages as false negative (#27) --- src/migrations/V6__false-banned.sql | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/migrations/V6__false-banned.sql diff --git a/src/migrations/V6__false-banned.sql b/src/migrations/V6__false-banned.sql new file mode 100644 index 0000000..bb3d4fe --- /dev/null +++ b/src/migrations/V6__false-banned.sql @@ -0,0 +1,21 @@ +CREATE TABLE false_positive_users +( + user_id BIGINT PRIMARY KEY + REFERENCES "user" (id) ON DELETE CASCADE +); + +CREATE TABLE false_positive_messages +( + chat_id BIGINT NOT NULL, + message_id INT NOT NULL, + PRIMARY KEY (chat_id, message_id), + FOREIGN KEY (chat_id, message_id) REFERENCES "message" (chat_id, message_id) ON DELETE CASCADE +); + +CREATE TABLE false_negative_messages +( + chat_id BIGINT NOT NULL, + message_id INT NOT NULL, + PRIMARY KEY (chat_id, message_id), + FOREIGN KEY (chat_id, message_id) REFERENCES "message" (chat_id, message_id) ON DELETE CASCADE +);