feat(monitoring/site-mappings): globalize site_domain_mappings

Drop tenant scoping on site_domain_mappings now that the citation query
resolves mappings without tenant filtering. Add a unique index on
registrable_domain plus an updated_at column, and switch the dev-seed
upsert to use ON CONFLICT (registrable_domain). Adds a SiteDomainMapping
type to ops/domain for the upcoming console management UI.
This commit is contained in:
2026-04-29 16:00:13 +08:00
parent 01b289ba0b
commit 674709c86b
5 changed files with 66 additions and 9 deletions
@@ -0,0 +1,10 @@
DROP INDEX IF EXISTS idx_site_domain_mappings_created;
DROP INDEX IF EXISTS idx_site_domain_mappings_active_domain;
DROP INDEX IF EXISTS uk_site_domain_mappings_domain;
ALTER TABLE site_domain_mappings
ADD COLUMN IF NOT EXISTS tenant_id BIGINT,
DROP COLUMN IF EXISTS updated_at;
CREATE INDEX IF NOT EXISTS idx_site_domain_mappings_lookup
ON site_domain_mappings(tenant_id, registrable_domain, is_active);