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