Quazim0t0 commited on
Commit
a3dd4d2
·
verified ·
1 Parent(s): add59ac

Update database.py

Browse files
Files changed (1) hide show
  1. 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 if empty
19
  def initialize_database():
20
  """
21
- Checks if database is empty and prompts user to upload an SQL file if needed.
22
  """
23
  tables = get_existing_tables()
24
  if not tables:
25
- print("No tables found in the database. Please upload an SQL file.")
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