Spaces:
Running
Running
| import asyncio | |
| from app.sql import connect_to_database, async_session | |
| from sqlalchemy import text | |
| async def drop_functions(): | |
| await connect_to_database() | |
| async with async_session() as session: | |
| print("Dropping functions...") | |
| await session.execute(text("DROP FUNCTION IF EXISTS trans.fn_get_po_items_for_purchase_return(uuid, character varying);")) | |
| await session.execute(text("DROP FUNCTION IF EXISTS trans.fn_get_po_items_for_purchase_return(uuid, uuid);")) | |
| await session.commit() | |
| print("Functions dropped.") | |
| if __name__ == "__main__": | |
| asyncio.run(drop_functions()) | |