Files

20 lines
858 B
SQL

-- Remove the hardcoded 3-site limit: ip_queue.site{1,2,3}_complete are
-- replaced by a child table with no cap on site_idx, keyed by
-- attempt_number the same way `checks` already is (see docs/USAGE.md).
ALTER TABLE ip_queue DROP COLUMN site1_complete;
ALTER TABLE ip_queue DROP COLUMN site2_complete;
ALTER TABLE ip_queue DROP COLUMN site3_complete;
-- Per-IP-per-site inbound-check completion. No fixed cap on site_idx, and
-- no reset needed on retry — a new attempt_number simply has no rows yet,
-- unlike the old fixed columns which had to be explicitly zeroed.
CREATE TABLE ip_site_checks (
ip_id INTEGER NOT NULL REFERENCES ip_queue(id),
attempt_number INTEGER NOT NULL,
site_idx INTEGER NOT NULL,
complete BOOLEAN NOT NULL DEFAULT 0,
completed_at TIMESTAMP,
PRIMARY KEY (ip_id, attempt_number, site_idx)
);