From 50ce8cb96b2b218751c2fc2a6b19372f51846acc Mon Sep 17 00:00:00 2001
From: Dawid Rycerz <dawid@rycerz.xyz>
Date: Mon, 14 Jul 2025 19:34:59 +0300
Subject: feat: rewrite in rust

---
 ...101000300_create_user_notification_settings.sql | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 migrations/20240101000300_create_user_notification_settings.sql

(limited to 'migrations/20240101000300_create_user_notification_settings.sql')

diff --git a/migrations/20240101000300_create_user_notification_settings.sql b/migrations/20240101000300_create_user_notification_settings.sql
new file mode 100644
index 0000000..13d45cd
--- /dev/null
+++ b/migrations/20240101000300_create_user_notification_settings.sql
@@ -0,0 +1,32 @@
+-- Migration: Create user_ntfy_settings table
+CREATE TABLE IF NOT EXISTS user_ntfy_settings (
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    user_id INTEGER NOT NULL,
+    enabled BOOLEAN NOT NULL DEFAULT 0,
+    topic TEXT NOT NULL,
+    server_url TEXT NOT NULL,
+    priority INTEGER NOT NULL DEFAULT 5,
+    title_template TEXT,
+    message_template TEXT,
+    FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE
+);
+CREATE UNIQUE INDEX IF NOT EXISTS idx_user_ntfy_settings_user_id ON user_ntfy_settings(user_id);
+
+-- Migration: Create user_smtp_settings table
+CREATE TABLE IF NOT EXISTS user_smtp_settings (
+    id INTEGER PRIMARY KEY AUTOINCREMENT,
+    user_id INTEGER NOT NULL,
+    enabled BOOLEAN NOT NULL DEFAULT 0,
+    email TEXT NOT NULL,
+    smtp_server TEXT NOT NULL,
+    smtp_port INTEGER NOT NULL,
+    username TEXT,
+    password TEXT,
+    use_tls BOOLEAN NOT NULL DEFAULT 1,
+    from_email TEXT,
+    from_name TEXT DEFAULT 'Silmätaivas Alerts',
+    subject_template TEXT,
+    body_template TEXT,
+    FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE
+);
+CREATE UNIQUE INDEX IF NOT EXISTS idx_user_smtp_settings_user_id ON user_smtp_settings(user_id); 
\ No newline at end of file
-- 
cgit v1.2.3

