43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
# SPDX-FileCopyrightText: 2025-present Micha Albert <info@micha.zone>
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""
|
|
Carbon Copy Database Initialization Script
|
|
|
|
This script initializes the database and loads seed data for the Carbon Copy
|
|
email-based multiplayer text adventure.
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add the src directory to Python path
|
|
project_root = Path(__file__).parent
|
|
sys.path.insert(0, str(project_root / "src"))
|
|
|
|
from carbon_copy.database import create_db_and_tables
|
|
from carbon_copy.seed_data import initialize_game_world
|
|
|
|
|
|
def main():
|
|
"""Initialize the database and load seed data."""
|
|
print("Carbon Copy - Database Initialization")
|
|
print("=" * 40)
|
|
|
|
print("Creating database tables...")
|
|
create_db_and_tables()
|
|
print("✓ Database tables created successfully")
|
|
|
|
print("\nLoading seed data...")
|
|
initialize_game_world()
|
|
print("✓ Seed data loaded successfully")
|
|
|
|
print("\nDatabase initialization complete!")
|
|
print("You can now start the FastAPI server with:")
|
|
print("uvicorn carbon_copy.main:app --reload")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|