chore: stage changes before history rewrite

This commit is contained in:
2026-07-07 11:28:18 +08:00
parent a619b919be
commit 137304090a
13 changed files with 670 additions and 83 deletions

View File

@@ -0,0 +1,24 @@
"""Migrate: create system_config table."""
import sqlite3
from pathlib import Path
DB_PATH = Path(__file__).parent.parent / "postcard.db"
conn = sqlite3.connect(str(DB_PATH))
cur = conn.cursor()
cur.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='system_config'")
if not cur.fetchone():
cur.execute(
"CREATE TABLE system_config ("
"key TEXT PRIMARY KEY, "
"value TEXT NOT NULL DEFAULT '', "
"updated_at TIMESTAMP"
")"
)
conn.commit()
print("OK: system_config table created")
else:
print("SKIP: system_config table exists")
conn.close()