21 lines
620 B
Python
21 lines
620 B
Python
#!/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() |