Begin work on saving compliance report

This commit is contained in:
Eli Ribble 2026-04-09 23:38:20 +00:00
parent 3ad95e1365
commit 553b65556a
No known key found for this signature in database
22 changed files with 2419 additions and 42 deletions

View file

@ -0,0 +1,31 @@
-- +goose Up
CREATE TYPE PermissionAccessType AS ENUM (
'denied',
'granted',
'unselected',
'with-owner'
);
CREATE TABLE publicreport.compliance (
access_instructions TEXT NOT NULL,
availability_notes TEXT NOT NULL,
comments TEXT NOT NULL,
gate_code TEXT NOT NULL,
has_dog BOOLEAN,
permission_type PermissionAccessType NOT NULL,
report_id INTEGER REFERENCES publicreport.report(id),
report_phone_can_text BOOLEAN,
wants_scheduled BOOLEAN,
PRIMARY KEY(report_id)
);
CREATE TABLE publicreport.client (
created TIMESTAMP WITHOUT TIME ZONE NOT NULL,
user_agent TEXT NOT NULL,
uuid UUID NOT NULL,
PRIMARY KEY(uuid)
);
ALTER TABLE publicreport.report ADD COLUMN client_uuid UUID REFERENCES publicreport.client(uuid);
-- +goose Down
ALTER TABLE publicreport.report DROP COLUMN client_uuid;
DROP TABLE publicreport.client;
DROP TABLE publicreport.compliance;
DROP TYPE PermissionAccessType;