mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 09:52:38 +02:00
🔀 Merge remote-tracking branch 'dryusdan/dev/fix-method-enum' into develop
This commit is contained in:
commit
ca709dca62
1 changed files with 16 additions and 12 deletions
|
@ -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",
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue