-- +goose Up -- Custom domains are verified by a CNAME to a target unique to the page, or -- by the TXT record, and checked again while they are in use: a domain that -- no longer points at the page is switched off after a grace period, so a -- record left behind cannot be taken over. Domains verified before this -- have no method and are not checked again. ALTER TABLE status_pages ADD COLUMN domain_set_at timestamptz, ADD COLUMN domain_checked_at timestamptz, ADD COLUMN domain_failing_since timestamptz, ADD COLUMN domain_verify_method text CHECK (domain_verify_method IN ('cname', 'txt')); UPDATE status_pages SET domain_set_at = updated_at WHERE custom_domain IS NOT NULL; -- +goose Down ALTER TABLE status_pages DROP COLUMN domain_verify_method, DROP COLUMN domain_failing_since, DROP COLUMN domain_checked_at, DROP COLUMN domain_set_at;