This repository has been archived on 2022-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
it-volunteers-for-peace/db/migrations/drop_tables.py
2022-10-14 18:05:04 +03:00

20 lines
414 B
Python

import asyncio
import asyncpg
import os
from asyncpg.connection import Connection
async def drop_tables(connection: Connection):
await connection.execute("DROP TABLE users, projects CASCADE")
async def main():
DB_URL = os.getenv("DB_URL")
connection = await asyncpg.connect(DB_URL)
await drop_tables(connection)
await connection.close()
if __name__ == '__main__':
asyncio.run(main())