From 0d261d2f7d080b610f50102576073e334a89e8cb Mon Sep 17 00:00:00 2001
From: SayaAndy <saya.andy@posteo.com>
Date: Thu, 23 Oct 2025 01:15:26 +0700
Subject: feat: email linking

---
 migrations/2_create_subscription_tables.up.sql | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 migrations/2_create_subscription_tables.up.sql

(limited to 'migrations/2_create_subscription_tables.up.sql')

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;
-- 
cgit v1.3.1+13

