Upload db.py with huggingface_hub
Browse files
db.py
CHANGED
|
@@ -115,8 +115,11 @@ def init_db():
|
|
| 115 |
conn.execute("ALTER TABLE users ADD COLUMN display_name TEXT DEFAULT ''")
|
| 116 |
if 'password_plain' not in user_cols:
|
| 117 |
conn.execute("ALTER TABLE users ADD COLUMN password_plain TEXT DEFAULT ''")
|
| 118 |
-
if 'edit_time' not in user_cols:
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
# migrate reports table
|
| 122 |
report_cols = [r[1] for r in conn.execute('PRAGMA table_info(reports)').fetchall()]
|
|
|
|
| 115 |
conn.execute("ALTER TABLE users ADD COLUMN display_name TEXT DEFAULT ''")
|
| 116 |
if 'password_plain' not in user_cols:
|
| 117 |
conn.execute("ALTER TABLE users ADD COLUMN password_plain TEXT DEFAULT ''")
|
| 118 |
+
if 'edit_time' not in [c.lower() for c in user_cols]:
|
| 119 |
+
try:
|
| 120 |
+
conn.execute("ALTER TABLE users ADD COLUMN edit_time TEXT")
|
| 121 |
+
except Exception:
|
| 122 |
+
pass
|
| 123 |
|
| 124 |
# migrate reports table
|
| 125 |
report_cols = [r[1] for r in conn.execute('PRAGMA table_info(reports)').fetchall()]
|