cryogenic22 commited on
Commit
2839e79
·
verified ·
1 Parent(s): 50ec00d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -40,10 +40,13 @@ def verify_database_tables(conn):
40
  tables = cursor.fetchall()
41
  st.write("Existing tables:", [table[0] for table in tables])
42
 
43
- # If collections table doesn't exist, recreate tables
44
  if 'collections' not in [table[0] for table in tables]:
45
- st.warning("Collections table not found. Recreating tables...")
46
- create_tables(conn)
 
 
 
47
 
48
  # Verify again
49
  cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
 
40
  tables = cursor.fetchall()
41
  st.write("Existing tables:", [table[0] for table in tables])
42
 
43
+ # If collections table doesn't exist, force recreate it
44
  if 'collections' not in [table[0] for table in tables]:
45
+ st.warning("Collections table not found. Force recreating collections tables...")
46
+ if force_recreate_collections_tables(conn):
47
+ st.success("Collections tables recreated successfully!")
48
+ else:
49
+ st.error("Failed to recreate collections tables!")
50
 
51
  # Verify again
52
  cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")