-- version: 22
-- SP41: claim-id dedup at SFTP pre-flight.
--
-- The 30-day dedup window is enforced by cyclone.store.submission_dedup.
-- This table records (claim_id, submitted_at) for every push that passed
-- the pre-flight check. Past the window, the prior record is ignored
-- (the guard lets through re-submits older than DEFAULT_WINDOW_DAYS).

CREATE TABLE submission_dedup (
    claim_id TEXT PRIMARY KEY,
    submitted_at DATETIME NOT NULL
);

CREATE INDEX submission_dedup_submitted_at_idx
    ON submission_dedup (submitted_at);
