Spaces:
Running
Running
root commited on
Commit ·
4da93df
1
Parent(s): d423ac0
fix: resolve IndentationError in database migrations
Browse files- database.py +10 -9
database.py
CHANGED
|
@@ -395,17 +395,18 @@ def setup_database():
|
|
| 395 |
cursor.execute("SELECT group_name FROM sessions LIMIT 1")
|
| 396 |
except sqlite3.OperationalError:
|
| 397 |
cursor.execute("ALTER TABLE sessions ADD COLUMN group_name TEXT")
|
| 398 |
-
try:
|
| 399 |
-
cursor.execute("SELECT pdf_viewer FROM users LIMIT 1")
|
| 400 |
-
except sqlite3.OperationalError:
|
| 401 |
-
cursor.execute("ALTER TABLE users ADD COLUMN pdf_viewer TEXT DEFAULT 'native'")
|
| 402 |
|
| 403 |
-
try:
|
| 404 |
-
|
| 405 |
-
except sqlite3.OperationalError:
|
| 406 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 407 |
|
| 408 |
-
conn.commit()
|
| 409 |
|
| 410 |
# Migration to normalize subject names (e.g., "CHEMISTRY" to "Chemistry", "PHYSICS" to "Physics", etc.)
|
| 411 |
try:
|
|
|
|
| 395 |
cursor.execute("SELECT group_name FROM sessions LIMIT 1")
|
| 396 |
except sqlite3.OperationalError:
|
| 397 |
cursor.execute("ALTER TABLE sessions ADD COLUMN group_name TEXT")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 398 |
|
| 399 |
+
try:
|
| 400 |
+
cursor.execute("SELECT pdf_viewer FROM users LIMIT 1")
|
| 401 |
+
except sqlite3.OperationalError:
|
| 402 |
+
cursor.execute("ALTER TABLE users ADD COLUMN pdf_viewer TEXT DEFAULT 'native'")
|
| 403 |
+
|
| 404 |
+
try:
|
| 405 |
+
cursor.execute("SELECT use_ai_suggestions FROM users LIMIT 1")
|
| 406 |
+
except sqlite3.OperationalError:
|
| 407 |
+
cursor.execute("ALTER TABLE users ADD COLUMN use_ai_suggestions INTEGER DEFAULT 1")
|
| 408 |
|
| 409 |
+
conn.commit()
|
| 410 |
|
| 411 |
# Migration to normalize subject names (e.g., "CHEMISTRY" to "Chemistry", "PHYSICS" to "Physics", etc.)
|
| 412 |
try:
|