File size: 395 Bytes
3f61e65
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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.")