Spaces:
Running
Running
File size: 620 Bytes
d5f79b7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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())
|