OpenMetadata/bootstrap/sql/migrations/native/1.13.0/postgres/schemaChanges.sql
Pere Miquel Brull f890e004ce
Move preview-to-enabled migrations from 1.11.13 to 1.13.0 (#26281)
The migrations renaming the 'preview' property to 'enabled' in apps
were incorrectly placed under 1.11.13. Move them to 1.13.0 where they
belong, since this change targets the next major release.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 12:36:32 +01:00

23 lines
723 B
SQL

-- Rename 'preview' to 'enabled' in apps, inverting the boolean value
-- preview=false (can be used) becomes enabled=true, preview=true becomes enabled=false
UPDATE apps_marketplace
SET json = (json - 'preview') || jsonb_build_object(
'enabled',
CASE
WHEN json -> 'preview' = 'null'::jsonb THEN true
WHEN (json -> 'preview')::boolean = true THEN false
ELSE true
END
)
WHERE jsonb_exists(json, 'preview');
UPDATE installed_apps
SET json = (json - 'preview') || jsonb_build_object(
'enabled',
CASE
WHEN json -> 'preview' = 'null'::jsonb THEN true
WHEN (json -> 'preview')::boolean = true THEN false
ELSE true
END
)
WHERE jsonb_exists(json, 'preview');