Files
lincodex/backend/db/migrations/00034_create_assessment_signal_notice_acknowledgements.sql

16 lines
786 B
SQL

-- +goose Up
-- A record that a candidate was shown the notice about the collected
-- assessment signals. It is not a consent: no operation reads it to allow or
-- refuse signal storage. One row per account and notice version keeps the time
-- of the first acknowledgement; a changed notice text uses a new version.
CREATE TABLE assessment_signal_notice_acknowledgements (
user_id uuid NOT NULL REFERENCES users (id) ON DELETE CASCADE,
notice_version integer NOT NULL,
acknowledged_at timestamptz NOT NULL,
CONSTRAINT assessment_signal_notice_acknowledgements_pkey PRIMARY KEY (user_id, notice_version),
CONSTRAINT assessment_signal_notice_acknowledgements_version CHECK (notice_version >= 1)
);
-- +goose Down
DROP TABLE assessment_signal_notice_acknowledgements;