summaryrefslogtreecommitdiff
path: root/migrations/2_create_subscription_tables.up.sql
diff options
from:
to:
context:
space:
mode:
Diffstat (limited to 'migrations/2_create_subscription_tables.up.sql')
-rw-r--r--migrations/2_create_subscription_tables.up.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/migrations/2_create_subscription_tables.up.sql b/migrations/2_create_subscription_tables.up.sql
new file mode 100644
index 0000000..e6e905a
--- /dev/null
+++ b/migrations/2_create_subscription_tables.up.sql
@@ -0,0 +1,18 @@
+CREATE TABLE IF NOT EXISTS user_email_table (
+ user_id VARCHAR(32) NOT NULL PRIMARY KEY,
+ email VARCHAR(64) NOT NULL,
+ lang VARCHAR(2) NOT NULL
+) WITHOUT ROWID;
+
+CREATE UNIQUE INDEX user_email_table_email_uindex
+ON user_email_table(email);
+
+CREATE TABLE IF NOT EXISTS subscription_user_to_tags_table (
+ user_id VARCHAR(32) NOT NULL PRIMARY KEY,
+ tags TEXT NOT NULL
+) WITHOUT ROWID;
+
+CREATE TABLE IF NOT EXISTS subscription_tag_to_users_table (
+ tag VARCHAR(32) NOT NULL PRIMARY KEY,
+ user_ids TEXT NOT NULL
+) WITHOUT ROWID;