mirror of
https://github.com/koloideal/Quizzi.git
synced 2026-06-10 10:25:28 +03:00
update
This commit is contained in:
+4
-5
@@ -59,11 +59,10 @@ def do_run_migrations(connection: Connection):
|
||||
|
||||
|
||||
async def run_async_migrations() -> None:
|
||||
"""In this scenario we need to create an Engine
|
||||
and associate a connection with the context.
|
||||
|
||||
"""
|
||||
connectable = create_async_engine(db_config.url)
|
||||
connectable = create_async_engine(
|
||||
db_config.url,
|
||||
connect_args={"server_settings": {"timezone": "UTC"}},
|
||||
)
|
||||
|
||||
async with connectable.connect() as connection:
|
||||
await connection.run_sync(do_run_migrations)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
"""set_timezone_to_utc
|
||||
|
||||
Revision ID: 2ba7282de7d9
|
||||
Revises: c4d5e6f7a8b9
|
||||
Create Date: 2026-02-20 01:14:15.088425
|
||||
|
||||
"""
|
||||
from collections.abc import Sequence
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision: str = '2ba7282de7d9'
|
||||
down_revision: str | None = 'c4d5e6f7a8b9'
|
||||
branch_labels: str | Sequence[str] | None = None
|
||||
depends_on: str | Sequence[str] | None = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.execute("SET timezone = 'UTC'")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
pass
|
||||
Reference in New Issue
Block a user