From 34b63501bb7421337eaf44e5a3b43d7d530ea04d Mon Sep 17 00:00:00 2001
From: Neda Moeini <neda.moeini@geant.org>
Date: Wed, 19 Jun 2024 11:49:39 +0200
Subject: [PATCH] Added a migration to update the description of
 modify_isis_metric workflow.

---
 ...c0_add_orchestrator_2_2_1_V2_migrations.py |  7 +++--
 ...vd7mfcfbs1q_update_modify_isis_workflow.py | 26 +++++++++++++++++++
 2 files changed, 29 insertions(+), 4 deletions(-)
 create mode 100644 gso/migrations/versions/2024-06-19_fvd7mfcfbs1q_update_modify_isis_workflow.py

diff --git a/gso/migrations/versions/2024-04-30_1ec810b289c0_add_orchestrator_2_2_1_V2_migrations.py b/gso/migrations/versions/2024-04-30_1ec810b289c0_add_orchestrator_2_2_1_V2_migrations.py
index 0f4609b6..16689df6 100644
--- a/gso/migrations/versions/2024-04-30_1ec810b289c0_add_orchestrator_2_2_1_V2_migrations.py
+++ b/gso/migrations/versions/2024-04-30_1ec810b289c0_add_orchestrator_2_2_1_V2_migrations.py
@@ -5,14 +5,13 @@ Revises:
 Create Date: 2024-04-02 10:21:08.539591
 
 """
-from alembic import op
-from orchestrator.migrations.helpers import create_workflow, delete_workflow
-
 # revision identifiers, used by Alembic.
 revision = '1ec810b289c0'
 down_revision = '32cad119b7c4'
 branch_labels = None
-depends_on = '048219045729'  # in this revision, SURF has added a new columns to the workflow table like delted_at, so we need to add a dependency on the revision that added the columns to the workflow table.
+depends_on = '048219045729'
+# in this revision, SURF has added a new columns to the workflow table like deleted_at, so we need to add a dependency
+# on the revision that added the columns to the workflow table.
 
 
 def upgrade() -> None:
diff --git a/gso/migrations/versions/2024-06-19_fvd7mfcfbs1q_update_modify_isis_workflow.py b/gso/migrations/versions/2024-06-19_fvd7mfcfbs1q_update_modify_isis_workflow.py
new file mode 100644
index 00000000..f3a1ae00
--- /dev/null
+++ b/gso/migrations/versions/2024-06-19_fvd7mfcfbs1q_update_modify_isis_workflow.py
@@ -0,0 +1,26 @@
+"""Add upstream migrations as a dependency.
+
+Revision ID: fvd7mfcfbs1q
+Revises:
+Create Date: 2024-06-19 11:17:08.539591
+
+"""
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = 'fvd7mfcfbs1q'
+down_revision = '1ec810b289c0'
+branch_labels = None
+depends_on = None
+
+
+def upgrade() -> None:
+    conn = op.get_bind()
+    conn.execute(
+        sa.text("""UPDATE workflows SET description = 'Modify ISIS metric' WHERE name = 'modify_isis_metric'""")
+    )
+
+
+def downgrade() -> None:
+    pass
-- 
GitLab