🔀 Merge remote-tracking branch 'dryusdan/dev/fix-method-enum' into develop

This commit is contained in:
Luc Didry 2025-02-12 15:02:19 +01:00
commit ca709dca62
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C

View file

@ -5,6 +5,7 @@ Revises: c780864dc407
Create Date: 2024-11-26 14:40:27.510587
"""
from typing import Sequence, Union
from alembic import op
@ -19,11 +20,7 @@ depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
with op.batch_alter_table("tasks", schema=None) as batch_op:
batch_op.add_column(
sa.Column(
"method",
sa.Enum(
enum = sa.Enum(
"GET",
"HEAD",
"POST",
@ -34,7 +31,14 @@ def upgrade() -> None:
"PATCH",
"DELETE",
name="method",
),
create_type=False,
)
enum.create(op.get_bind(), checkfirst=True)
with op.batch_alter_table("tasks", schema=None) as batch_op:
batch_op.add_column(
sa.Column(
"method",
enum,
nullable=False,
server_default="GET",
)