# scripts/init_db.py
import os
import sys
from dotenv import load_dotenv

# Add the project root to the Python path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

def main():
    # Load environment variables from .env file
    load_dotenv()
    
    # Now that env vars are loaded, we can import the database module
    from app.database import init_db
    
    print("Initializing database schema...")
    init_db()
    print("Database schema initialized successfully.")

if __name__ == "__main__":
    main()
