Files
aevolution/migrations/0025_cellular_v2_bundle.sql
dingo d652291126
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (network) (push) Canceled after 5m28s
Foundation / checks (checks) (push) Canceled after 7m39s
Foundation / checks (client) (push) Canceled after 7m39s
Persist fed mutation offers in cellular v2
2026-10-11 04:51:55 -04:00

27 lines
1.2 KiB
PL/PgSQL

-- 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');