feat(email): add admin notification settings

This commit is contained in:
2026-05-05 13:38:34 +08:00
parent a780c1bf52
commit 73d476bcea
21 changed files with 929 additions and 17 deletions
@@ -0,0 +1,26 @@
from __future__ import annotations
from sqlalchemy import text
from sqlalchemy.engine import Connection
def apply(conn: Connection) -> None:
conn.execute(
text(
"""
CREATE TABLE IF NOT EXISTS email_notification_settings (
id INTEGER PRIMARY KEY,
smtp_server VARCHAR(255) NOT NULL DEFAULT '',
smtp_port INTEGER NOT NULL DEFAULT 465,
smtp_sender_email VARCHAR(255) NOT NULL DEFAULT '',
smtp_sender_password VARCHAR(500) NOT NULL DEFAULT '',
smtp_use_ssl BOOLEAN NOT NULL DEFAULT 1,
notify_token_expiring BOOLEAN NOT NULL DEFAULT 1,
notify_check_in_success BOOLEAN NOT NULL DEFAULT 1,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME
)
"""
)
)
conn.commit()