def preapre_tables(pg):
tables = [db.question, db.choice]
async with pg.acquire() as conn:
for table in reversed(tables):
drop_expr = DropTable(table)
try:
await conn.execute(drop_expr)
except psycopg2.ProgrammingError:
pass
async with pg.acquire() as conn:
for table in tables:
create_expr = CreateTable(table)
await conn.execute(create_expr)
评论列表
文章目录