updated some files

This commit is contained in:
ben
2026-08-18 10:50:11 +02:00
parent b85b8dbb25
commit 5f77a4d995
2 changed files with 126 additions and 17 deletions
+43
View File
@@ -0,0 +1,43 @@
#!/bin/python3
import sqlite3
from pathlib import Path
DB_NAME = Path(__file__).parent / "calendar.db"
try:
conn = sqlite3.connect(DB_NAME)
conn.execute("PRAGMA foreign_keys = ON;")
cur = conn.cursor()
# Migrations
conn.commit()
conn.close()
print("Database updated.")
except sqlite3.Error as e:
print(f"Database error: {e}")
try:
conn.rollback()
conn.close()
except (NameError, sqlite3.Error):
pass
raise SystemExit(1)
except Exception as e:
print(f"Error: {e}")
try:
conn.rollback()
conn.close()
except (NameError, sqlite3.Error):
pass
raise SystemExit(1)