Spaces:
Sleeping
Sleeping
Delete run_seed.py with huggingface_hub
Browse files- run_seed.py +0 -32
run_seed.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
from sqlalchemy.orm import Session
|
| 3 |
-
from sqlalchemy import create_engine
|
| 4 |
-
from dotenv import load_dotenv
|
| 5 |
-
import asyncio
|
| 6 |
-
|
| 7 |
-
# Add project root to sys.path
|
| 8 |
-
import sys
|
| 9 |
-
sys.path.insert(0, os.getcwd())
|
| 10 |
-
|
| 11 |
-
from app.db.base import SessionLocal
|
| 12 |
-
from app.api.seed import seed_database
|
| 13 |
-
|
| 14 |
-
load_dotenv()
|
| 15 |
-
|
| 16 |
-
def run_seed():
|
| 17 |
-
db = SessionLocal()
|
| 18 |
-
try:
|
| 19 |
-
print(">>> Starting database seed on Supabase...")
|
| 20 |
-
# seed_database(clear=True, db=db)
|
| 21 |
-
# Note: If seed_database is async, use asyncio.run.
|
| 22 |
-
# Looking at previous view_file of seed.py, it seems it's a regular function or used with to_thread.
|
| 23 |
-
# Let's check the imports in main.py again.
|
| 24 |
-
seed_database(clear=True, db=db)
|
| 25 |
-
print(">>> Seed complete!")
|
| 26 |
-
except Exception as e:
|
| 27 |
-
print(f"FAILED: Seeding failed: {e}")
|
| 28 |
-
finally:
|
| 29 |
-
db.close()
|
| 30 |
-
|
| 31 |
-
if __name__ == "__main__":
|
| 32 |
-
run_seed()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|