Spaces:
Build error
Build error
Update app.py
Browse files
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
|
| 44 |
if 'collections' not in [table[0] for table in tables]:
|
| 45 |
-
st.warning("Collections table not found.
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
| 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'")
|