This commit is contained in:
2026-02-20 01:15:21 +03:00
parent bcc510824b
commit b14931b8e8
15 changed files with 69 additions and 44 deletions
+4 -5
View File
@@ -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