We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0193b49 commit a460794Copy full SHA for a460794
tiled/authn_database/core.py
@@ -71,15 +71,14 @@ async def create_default_roles(db):
71
72
73
async def initialize_database(engine: AsyncEngine) -> None:
74
- async with engine.connect() as conn:
+ async with engine.begin() as conn:
75
# Create all tables.
76
await conn.run_sync(Base.metadata.create_all)
77
- await conn.commit()
78
-
79
- # Initialize Roles table.
80
- async with AsyncSession(engine) as db:
81
- await create_default_roles(db)
82
+
+ # Initialize Roles table.
+ async with AsyncSession(engine) as db:
+ await create_default_roles(db)
+ db.commit()
83
84
async def purge_expired(db: AsyncSession, cls) -> int:
85
"""
0 commit comments