fix(migration): wrap ALTER TYPE ADD VALUE in DO block with IF NOT EXISTS check
This commit is contained in:
parent
a04ef2de3a
commit
bd662f6917
1 changed files with 7 additions and 1 deletions
|
|
@ -1,2 +1,8 @@
|
||||||
-- 2026-06: add 'pending_migration' to asset_status enum for manual SMB-to-S3 promotion
|
-- 2026-06: add 'pending_migration' to asset_status enum for manual SMB-to-S3 promotion
|
||||||
ALTER TYPE asset_status ADD VALUE 'pending_migration';
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'pending_migration' AND enumtypid = 'asset_status'::regtype) THEN
|
||||||
|
ALTER TYPE asset_status ADD VALUE 'pending_migration';
|
||||||
|
END IF;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue