Luca448 commited on
Commit
b7aee34
·
1 Parent(s): 5aeb3be

Savestate: Fix database crash due to missing calendar_events table in migration block (BUILD 1.6.2)

Browse files
Files changed (2) hide show
  1. index.html +1 -1
  2. src/db/database.js +15 -1
index.html CHANGED
@@ -51,7 +51,7 @@
51
  </head>
52
  <body class="dark-theme in-chat-view">
53
 
54
- <div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.6.1</div>
55
 
56
  <!-- SVG Filters for Liquid Glass Refraction -->
57
  <svg width="0" height="0" style="position: absolute; pointer-events: none;">
 
51
  </head>
52
  <body class="dark-theme in-chat-view">
53
 
54
+ <div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.6.2</div>
55
 
56
  <!-- SVG Filters for Liquid Glass Refraction -->
57
  <svg width="0" height="0" style="position: absolute; pointer-events: none;">
src/db/database.js CHANGED
@@ -62,7 +62,7 @@ class Database {
62
  )
63
  `);
64
 
65
- // Migration: Add language columns if they don't exist
66
  try {
67
  this.db.run("ALTER TABLE flashcard_decks ADD COLUMN source_lang TEXT");
68
  this.db.run("ALTER TABLE flashcard_decks ADD COLUMN target_lang TEXT");
@@ -85,6 +85,20 @@ class Database {
85
  FOREIGN KEY(deck_id) REFERENCES flashcard_decks(id) ON DELETE CASCADE
86
  )
87
  `);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  this.saveToStorage();
90
  } else {
 
62
  )
63
  `);
64
 
65
+ // Migration: Add language columns if they don't exist
66
  try {
67
  this.db.run("ALTER TABLE flashcard_decks ADD COLUMN source_lang TEXT");
68
  this.db.run("ALTER TABLE flashcard_decks ADD COLUMN target_lang TEXT");
 
85
  FOREIGN KEY(deck_id) REFERENCES flashcard_decks(id) ON DELETE CASCADE
86
  )
87
  `);
88
+
89
+ // Migration: Ensure calendar_events table exists
90
+ this.db.run(`
91
+ CREATE TABLE IF NOT EXISTS calendar_events (
92
+ id TEXT PRIMARY KEY,
93
+ title TEXT,
94
+ type TEXT,
95
+ date TEXT,
96
+ time TEXT,
97
+ subject TEXT,
98
+ description TEXT,
99
+ created_at TEXT
100
+ )
101
+ `);
102
 
103
  this.saveToStorage();
104
  } else {