Spaces:
Running
Running
Commit
·
4c9391e
1
Parent(s):
9ad6dea
🔧 Fix sample data function name in init_db.py
Browse filesUpdated import to use correct function name 'insert_sample_data' instead of 'insert_enhanced_sample_data' to match the updated sample_data.py implementation.
backend/database/init_db.py
CHANGED
|
@@ -335,13 +335,13 @@ def init_database(reset=False, force=False):
|
|
| 335 |
logger.info("Empty database detected, inserting sample data for better user experience...")
|
| 336 |
try:
|
| 337 |
# Import here to avoid circular imports
|
| 338 |
-
from .sample_data import
|
| 339 |
from . import SessionLocal
|
| 340 |
|
| 341 |
# Use SQLAlchemy session for sample data insertion
|
| 342 |
session = SessionLocal()
|
| 343 |
try:
|
| 344 |
-
results =
|
| 345 |
session.commit()
|
| 346 |
except Exception as e:
|
| 347 |
session.rollback()
|
|
|
|
| 335 |
logger.info("Empty database detected, inserting sample data for better user experience...")
|
| 336 |
try:
|
| 337 |
# Import here to avoid circular imports
|
| 338 |
+
from .sample_data import insert_sample_data
|
| 339 |
from . import SessionLocal
|
| 340 |
|
| 341 |
# Use SQLAlchemy session for sample data insertion
|
| 342 |
session = SessionLocal()
|
| 343 |
try:
|
| 344 |
+
results = insert_sample_data(session)
|
| 345 |
session.commit()
|
| 346 |
except Exception as e:
|
| 347 |
session.rollback()
|