50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""
|
||
|
|
Manual demo data seeding script
|
||
|
|
Run this to populate the base demo template tenant with inventory data
|
||
|
|
"""
|
||
|
|
|
||
|
|
import asyncio
|
||
|
|
import sys
|
||
|
|
import os
|
||
|
|
|
||
|
|
# Add the project root to Python path
|
||
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||
|
|
|
||
|
|
async def seed_demo_data():
|
||
|
|
"""Seed demo data by running all seed scripts in order"""
|
||
|
|
from scripts.demo.seed_demo_users import main as seed_users
|
||
|
|
from scripts.demo.seed_demo_tenants import main as seed_tenants
|
||
|
|
from scripts.demo.seed_demo_inventory import main as seed_inventory
|
||
|
|
from scripts.demo.seed_demo_ai_models import main as seed_ai_models
|
||
|
|
|
||
|
|
print("🌱 Starting demo data seeding...")
|
||
|
|
|
||
|
|
try:
|
||
|
|
print("\n📝 Step 1: Seeding demo users...")
|
||
|
|
await seed_users()
|
||
|
|
print("✅ Demo users seeded successfully")
|
||
|
|
|
||
|
|
print("\n🏢 Step 2: Seeding demo tenants...")
|
||
|
|
await seed_tenants()
|
||
|
|
print("✅ Demo tenants seeded successfully")
|
||
|
|
|
||
|
|
print("\n📦 Step 3: Seeding demo inventory...")
|
||
|
|
await seed_inventory()
|
||
|
|
print("✅ Demo inventory seeded successfully")
|
||
|
|
|
||
|
|
print("\n🤖 Step 4: Seeding demo AI models...")
|
||
|
|
await seed_ai_models()
|
||
|
|
print("✅ Demo AI models seeded successfully")
|
||
|
|
|
||
|
|
print("\n🎉 All demo data seeded successfully!")
|
||
|
|
|
||
|
|
except Exception as e:
|
||
|
|
print(f"\n❌ Error during seeding: {e}")
|
||
|
|
import traceback
|
||
|
|
traceback.print_exc()
|
||
|
|
sys.exit(1)
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
asyncio.run(seed_demo_data())
|