From 0f099b9df400cdf199fbf84a426641d5e092d676 Mon Sep 17 00:00:00 2001 From: Dryusdan Date: Wed, 29 Jan 2025 11:37:09 +0100 Subject: [PATCH 1/2] Fix method enum in tasks table --- .../dcf73fa19fce_specify_check_method.py | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py b/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py index fdfa97c..39cacbe 100644 --- a/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py +++ b/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py @@ -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,22 +20,25 @@ depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: + enum = sa.Enum( + "GET", + "HEAD", + "POST", + "OPTIONS", + "CONNECT", + "TRACE", + "PUT", + "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", - sa.Enum( - "GET", - "HEAD", - "POST", - "OPTIONS", - "CONNECT", - "TRACE", - "PUT", - "PATCH", - "DELETE", - name="method", - ), + enum, nullable=False, server_default="GET", ) From 60f3079140f89524e67e967cfe5dc88a17c4be1c Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 12 Feb 2025 15:04:48 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A9=B9=20=E2=80=94=20Add=20missing=20?= =?UTF-8?q?enum=20removal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 +++- .../migrations/versions/dcf73fa19fce_specify_check_method.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f379ecc..99773c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,13 @@ ## [Unreleased] +- 🐛 — Fix method enum in tasks table (thx to Dryusdan) + ## 0.7.3 Date: 2025-01-26 -🐛 — Fix bug in retry_before_notification logic when success +- 🐛 — Fix bug in retry_before_notification logic when success ## 0.7.2 diff --git a/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py b/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py index 39cacbe..39e0d49 100644 --- a/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py +++ b/argos/server/migrations/versions/dcf73fa19fce_specify_check_method.py @@ -48,3 +48,4 @@ def upgrade() -> None: def downgrade() -> None: with op.batch_alter_table("tasks", schema=None) as batch_op: batch_op.drop_column("method") + sa.Enum(name="method").drop(op.get_bind(), checkfirst=True)