porridger/back/delete_db.py

12 lines
325 B
Python

from sqlalchemy import Table, MetaData, text
from .db import engine, Base
# tbl = Table('Poems', MetaData(), autoload_with=engine)
# tbl.drop(engine, checkfirst=False)
# a = input()
# Base.metadata.drop_all(bind=engine)
with engine.connect() as conn:
conn.execute(text("DELETE FROM alembic_version"))
conn.commit()