nidus-sync/db/migrations/00025_publicreport_nuisance.sql
Eli Ribble 01ed2d6086
Finish green pool report submission
Also start the pattern of breaking out pool pages together in their own
file. I think its easier to read this way.
2026-01-09 19:43:19 +00:00

71 lines
1.9 KiB
SQL

-- +goose Up
CREATE TYPE publicreport.NuisanceDurationType AS ENUM (
'none',
'just-noticed',
'few-days',
'1-2-weeks',
'2-4-weeks',
'1-3-months',
'seasonal'
);
CREATE TYPE publicreport.NuisanceLocationType AS ENUM (
'none',
'front-yard',
'backyard',
'patio',
'garden',
'pool-area',
'throughout',
'indoors',
'other'
);
CREATE TYPE publicreport.NuisanceInspectionType AS ENUM (
'neighborhood',
'property'
);
CREATE TYPE publicreport.NuisancePreferredDateRangeType AS ENUM (
'none',
'any-time',
'in-two-weeks',
'next-week'
);
CREATE TYPE publicreport.NuisancePreferredTimeType AS ENUM (
'none',
'afternoon',
'any-time',
'morning'
);
CREATE TABLE publicreport.nuisance (
id SERIAL PRIMARY KEY,
additional_info TEXT NOT NULL,
created TIMESTAMP WITHOUT TIME ZONE NOT NULL,
duration publicreport.NuisanceDurationType NOT NULL,
email TEXT NOT NULL,
inspection_type publicreport.NuisanceInspectionType NOT NULL,
location publicreport.NuisanceLocationType NOT NULL,
preferred_date_range publicreport.NuisancePreferredDateRangeType NOT NULL,
preferred_time publicreport.NuisancePreferredTimeType NOT NULL,
request_call BOOLEAN NOT NULL,
severity SMALLINT NOT NULL,
source_container BOOLEAN NOT NULL,
source_description TEXT NOT NULL,
source_roof BOOLEAN NOT NULL,
source_stagnant BOOLEAN NOT NULL,
time_of_day_day BOOLEAN NOT NULL,
time_of_day_early BOOLEAN NOT NULL,
time_of_day_evening BOOLEAN NOT NULL,
time_of_day_night BOOLEAN NOT NULL,
public_id TEXT NOT NULL UNIQUE,
reporter_address TEXT NOT NULL,
reporter_email TEXT NOT NULL,
reporter_name TEXT NOT NULL,
reporter_phone TEXT NOT NULL
);
-- +goose Down
DROP TABLE publicreport.nuisance;
DROP TYPE publicreport.NuisanceDurationType;
DROP TYPE publicreport.NuisanceLocationType;
DROP TYPE publicreport.NuisanceInspectionType;
DROP TYPE publicreport.NuisancePreferredDateRangeType;
DROP TYPE publicreport.NuisancePreferredTimeType;