Spaces:
Sleeping
Sleeping
| """ | |
| Database Seeding Script | |
| Populates database with initial test data | |
| """ | |
| from sqlalchemy.orm import Session | |
| from app.core.database import SessionLocal, engine | |
| from app.models.base import Base | |
| # TODO: Import models and create seed data | |
| def seed_database(): | |
| """Seed database with initial data""" | |
| db = SessionLocal() | |
| try: | |
| print("Seeding database...") | |
| # TODO: Create seed data | |
| # - Platform admin user | |
| # - Sample client | |
| # - Sample contractor | |
| # - Sample project | |
| # - Sample users | |
| db.commit() | |
| print("Database seeded successfully!") | |
| except Exception as e: | |
| print(f"Error seeding database: {e}") | |
| db.rollback() | |
| finally: | |
| db.close() | |
| if __name__ == "__main__": | |
| seed_database() | |