Spaces:
Running
Running
from sqlalchemy import text | |
from app.core.database import Base, engine | |
from app.models.models import BetaApplication | |
# Drop all tables with CASCADE | |
with engine.connect() as conn: | |
conn.execute(text("DROP SCHEMA public CASCADE;")) | |
conn.execute(text("CREATE SCHEMA public;")) | |
conn.commit() | |
# Create all tables | |
Base.metadata.create_all(engine) | |
print("Tables recreated successfully.") |