Spaces:
Sleeping
Sleeping
Update database.py
Browse files- database.py +3 -3
database.py
CHANGED
@@ -15,14 +15,14 @@ def get_existing_tables():
|
|
15 |
inspector = inspect(engine)
|
16 |
return inspector.get_table_names()
|
17 |
|
18 |
-
# Function to initialize database
|
19 |
def initialize_database():
|
20 |
"""
|
21 |
-
|
22 |
"""
|
23 |
tables = get_existing_tables()
|
24 |
if not tables:
|
25 |
-
print("No tables found
|
26 |
else:
|
27 |
print(f"Database initialized with tables: {tables}")
|
28 |
|
|
|
15 |
inspector = inspect(engine)
|
16 |
return inspector.get_table_names()
|
17 |
|
18 |
+
# Function to initialize database (without forcing a table)
|
19 |
def initialize_database():
|
20 |
"""
|
21 |
+
Ensures the database starts up without failing if no SQL file is uploaded yet.
|
22 |
"""
|
23 |
tables = get_existing_tables()
|
24 |
if not tables:
|
25 |
+
print("No tables found. Waiting for SQL file upload...")
|
26 |
else:
|
27 |
print(f"Database initialized with tables: {tables}")
|
28 |
|