Mint certificate GIDs with entity type 106

Certificate backfill migrations used entity type 104, which belongs to
commitment groups. Use 106 so migrated certificate IDs decode correctly.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-07-21 13:33:11 +02:00
parent 8402e0c31e
commit a3d6c120d7
2 changed files with 3 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ CREATE INDEX idx_certificates_http_challenge_token ON certificates(http_challeng
WHERE http_challenge_token IS NOT NULL;
-- Backfill one certificate per existing custom domain. A fresh GID is minted
-- for each row with generate_gid (entity type 104 = CertificateEntityType).
-- for each row with generate_gid (entity type 106 = CertificateEntityType).
-- The certificate hostname equals the custom domain name, which lets us link
-- the two afterwards.
INSERT INTO certificates (
@@ -65,7 +65,7 @@ INSERT INTO certificates (
updated_at
)
SELECT
generate_gid(decode_base64_unpadded(cd.tenant_id), 104),
generate_gid(decode_base64_unpadded(cd.tenant_id), 106),
cd.tenant_id,
cd.domain,
cd.ssl_certificate,

View File

@@ -54,7 +54,7 @@ minted_certificates AS (
updated_at
)
SELECT
generate_gid(decode_base64_unpadded(pp.tenant_id), 104),
generate_gid(decode_base64_unpadded(pp.tenant_id), 106),
pp.tenant_id,
pp.hostname,
'PENDING'::custom_domain_ssl_status,