From 23ba0fb8fc5070ba30a43035970775247da370f3 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Tue, 26 Mar 2024 15:26:06 -0400 Subject: teleport: don't teleport within same channel, better text --- markov/data/migrations/init.sql | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 markov/data/migrations/init.sql (limited to 'markov/data/migrations/init.sql') diff --git a/markov/data/migrations/init.sql b/markov/data/migrations/init.sql new file mode 100644 index 0000000..71ec073 --- /dev/null +++ b/markov/data/migrations/init.sql @@ -0,0 +1,45 @@ +CREATE TABLE IF NOT EXISTS guild_total_completion_count ( + guild_id BLOB, + first_token TEXT, + total_completion_count INTEGER, + UNIQUE (guild_id, first_token) +) STRICT; + +CREATE TABLE IF NOT EXISTS guild_pairs ( + guild_id BLOB, + first_token TEXT, + second_token TEXT, + frequency INTEGER, + UNIQUE (guild_id, first_token, second_token) +) STRICT; + +CREATE INDEX IF NOT EXISTS idx_guild_pairs__guild_id__first_token__frequency__second_token ON guild_pairs (guild_id, first_token, frequency, second_token); + +CREATE TABLE IF NOT EXISTS member_total_completion_count ( + guild_id BLOB, + member_id BLOB, + first_token TEXT, + total_completion_count INTEGER, + UNIQUE (guild_id, member_id, first_token) +) STRICT; + +CREATE TABLE IF NOT EXISTS member_pairs ( + guild_id BLOB, + member_id BLOB, + first_token TEXT, + second_token TEXT, + frequency INTEGER, + UNIQUE (guild_id, member_id, first_token, second_token) +) STRICT; + +CREATE INDEX IF NOT EXISTS idx_member_pairs__guild_id__member_id__first_token__frequency__second_token ON member_pairs ( + guild_id, + member_id, + first_token, + frequency, + second_token +); + +PRAGMA analysis_limit = 1000; + +PRAGMA optimize; -- cgit v1.2.3-57-g22cb