plokmii commited on
Commit
b65ddf5
·
verified ·
1 Parent(s): f3d2d2e

Upload db.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. db.py +5 -2
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
- conn.execute("ALTER TABLE users ADD COLUMN edit_time TEXT")
 
 
 
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()]