Skip to content

Commit e6bfb09

Browse files
authored
fix: tenant resource limit resource col migration (#2885)
* fix migration and new migration * note
1 parent df9c176 commit e6bfb09

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

cmd/hatchet-migrate/migrate/migrations/20260119123835_v1_0_69.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ ALTER TABLE "TenantResourceLimit"
1919
ALTER COLUMN resource TYPE "LimitResource_new"
2020
USING resource::text::"LimitResource_new";
2121

22+
ALTER TABLE "TenantResourceLimitAlert"
23+
ALTER COLUMN resource TYPE "LimitResource_new"
24+
USING resource::text::"LimitResource_new";
25+
2226
DROP TYPE "LimitResource" CASCADE;
2327

2428
ALTER TYPE "LimitResource_new" RENAME TO "LimitResource";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- +goose Up
2+
-- +goose StatementBegin
3+
-- Patches migration for previously incorrect migration (0.69)
4+
-- NOTE: the default here is just to backfill previous incorrect cols
5+
TRUNCATE TABLE "TenantResourceLimitAlert";
6+
ALTER TABLE "TenantResourceLimitAlert"
7+
ADD COLUMN IF NOT EXISTS "resource" "LimitResource" NOT NULL;
8+
-- +goose StatementEnd
9+
10+
-- +goose Down
11+
-- +goose StatementBegin
12+
-- Intentionally left empty since this migration is only for adding the column for incorrect previous migration
13+
-- +goose StatementEnd

0 commit comments

Comments
 (0)