From 775287ce33744917a4b026b514fe3a3ec660abb9 Mon Sep 17 00:00:00 2001 From: Eric Allam Date: Fri, 15 May 2026 17:24:09 +0100 Subject: [PATCH] =?UTF-8?q?fix(clickhouse):=20renumber=20task=5Fkind=20mig?= =?UTF-8?q?ration=20029=20=E2=86=92=20031?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migration 030_create_sessions_v1.sql landed on main on 2026-04-28 (PR #3417) and was applied to test/prod ClickHouse on subsequent deploys. Migration 029_add_task_kind_to_task_runs_v2.sql was authored later on 2026-05-10 as part of the Sessions primitive PR, after 030 was already at version 30 in the goose history. The next deploy fails because goose strict-mode refuses to apply a missing version 'before' current_version 30: goose run: error: found 1 missing migrations before current version 30: version 29: 029_add_task_kind_to_task_runs_v2.sql Renumber to 031 so goose applies it as the next version after 030. SQL is unchanged. --- .../schema/029_add_task_kind_to_task_runs_v2.sql | 7 ------- .../schema/031_add_task_kind_to_task_runs_v2.sql | 12 ++++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) delete mode 100644 internal-packages/clickhouse/schema/029_add_task_kind_to_task_runs_v2.sql create mode 100644 internal-packages/clickhouse/schema/031_add_task_kind_to_task_runs_v2.sql diff --git a/internal-packages/clickhouse/schema/029_add_task_kind_to_task_runs_v2.sql b/internal-packages/clickhouse/schema/029_add_task_kind_to_task_runs_v2.sql deleted file mode 100644 index a88a7a46cef..00000000000 --- a/internal-packages/clickhouse/schema/029_add_task_kind_to_task_runs_v2.sql +++ /dev/null @@ -1,7 +0,0 @@ --- +goose Up -ALTER TABLE trigger_dev.task_runs_v2 - ADD COLUMN task_kind LowCardinality(String) DEFAULT ''; - --- +goose Down -ALTER TABLE trigger_dev.task_runs_v2 - DROP COLUMN task_kind; diff --git a/internal-packages/clickhouse/schema/031_add_task_kind_to_task_runs_v2.sql b/internal-packages/clickhouse/schema/031_add_task_kind_to_task_runs_v2.sql new file mode 100644 index 00000000000..b9492c04857 --- /dev/null +++ b/internal-packages/clickhouse/schema/031_add_task_kind_to_task_runs_v2.sql @@ -0,0 +1,12 @@ +-- +goose Up +-- IF NOT EXISTS is required because this migration was previously numbered +-- 029 and may have been applied in environments where goose accepted it +-- before 030_create_sessions_v1 advanced the version counter. Renaming to +-- 031 makes goose treat this as new everywhere, so the DDL must tolerate +-- the column already being present. +ALTER TABLE trigger_dev.task_runs_v2 + ADD COLUMN IF NOT EXISTS task_kind LowCardinality(String) DEFAULT ''; + +-- +goose Down +ALTER TABLE trigger_dev.task_runs_v2 + DROP COLUMN IF EXISTS task_kind;