rui3000 commited on
Commit
50d3cd7
·
verified ·
1 Parent(s): 9b05877

Update db.py

Browse files
Files changed (1) hide show
  1. db.py +4 -4
db.py CHANGED
@@ -2,9 +2,9 @@ import sqlite3
2
  import os
3
  import time
4
 
5
- # Use the current directory instead of /data
6
- DB_NAME = "model_tests.db"
7
- DB_PATH = os.path.join(".", DB_NAME)
8
 
9
  def init_db():
10
  """Initialize the SQLite database with required tables if they don't exist"""
@@ -34,7 +34,7 @@ def init_db():
34
  ''')
35
 
36
  conn.commit()
37
- print("Test database initialized successfully")
38
  return True
39
  except Exception as e:
40
  print(f"Error initializing database: {e}")
 
2
  import os
3
  import time
4
 
5
+ # Use a non-hidden filename in the current directory
6
+ DB_NAME = "model_tests.db" # No leading dot
7
+ DB_PATH = os.path.join(os.getcwd(), DB_NAME) # Use absolute path with getcwd()
8
 
9
  def init_db():
10
  """Initialize the SQLite database with required tables if they don't exist"""
 
34
  ''')
35
 
36
  conn.commit()
37
+ print(f"Test database initialized successfully at {DB_PATH}")
38
  return True
39
  except Exception as e:
40
  print(f"Error initializing database: {e}")