-- M11.4b, ADR-0119: admit the profile-4 v2 cellular version bundle. -- Keep the v24 parser immutable and delegate all other manifests unchanged. ALTER FUNCTION evolution.parse_checkpoint_manifest(bytea) RENAME TO parse_checkpoint_manifest_v24; CREATE FUNCTION evolution.parse_checkpoint_manifest(m bytea) RETURNS evolution.checkpoint_manifest LANGUAGE plpgsql IMMUTABLE SET search_path = pg_catalog, pg_temp AS $$ DECLARE r evolution.checkpoint_manifest; normalized bytea; v1_bundle constant bytea := '\x010000000100000001000000010000000100000002000000010000000100000000000000'; v2_bundle constant bytea := '\x020000000200000001000000010000000100000002000000010000000100000001000000'; BEGIN IF m IS NOT NULL AND octet_length(m) = 360 AND evolution.manifest_uint(m, 12, 4) = 4 AND substring(m FROM 161 FOR 36) = v2_bundle THEN normalized := overlay(m PLACING v1_bundle FROM 161 FOR 36); r := evolution.parse_checkpoint_manifest_v24(normalized); r.versions := v2_bundle; RETURN r; END IF; RETURN evolution.parse_checkpoint_manifest_v24(m); END $$; REVOKE ALL ON FUNCTION evolution.parse_checkpoint_manifest(bytea) FROM PUBLIC; INSERT INTO evolution.schema_migrations(version, sha256) VALUES (25, :'migration_sha_25');