before claude fix #1
This commit is contained in:
21
FitnessSync/backend/init_db.py
Normal file
21
FitnessSync/backend/init_db.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Script to initialize the database tables
|
||||
"""
|
||||
import os
|
||||
from src.services.postgresql_manager import PostgreSQLManager
|
||||
|
||||
def init_database():
|
||||
print("Initializing database...")
|
||||
|
||||
# Use the same DATABASE_URL as in the docker-compose
|
||||
database_url = os.getenv("DATABASE_URL", "postgresql://postgres:password@localhost:5432/fitbit_garmin_sync")
|
||||
print(f"Using database URL: {database_url}")
|
||||
|
||||
db_manager = PostgreSQLManager(database_url=database_url)
|
||||
db_manager.init_db()
|
||||
|
||||
print("Database initialized successfully!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
init_database()
|
||||
Reference in New Issue
Block a user