nidus-sync/db/migrations/00024_public_report.sql
Eli Ribble b35c9496b6
Add the ability to register for updates on quick reports
At this point it also appears that I'm correctly capturing the GPS
location as both PostGIS data and as an H3 cell.
2026-01-08 15:34:48 +00:00

26 lines
625 B
SQL

-- +goose Up
CREATE SCHEMA IF NOT EXISTS publicreport;
CREATE TABLE publicreport.quick (
id SERIAL PRIMARY KEY,
created TIMESTAMP WITHOUT TIME ZONE NOT NULL,
comments TEXT NOT NULL,
location GEOGRAPHY,
h3cell h3index,
public_id TEXT NOT NULL UNIQUE,
reporter_email TEXT NOT NULL,
reporter_phone TEXT NOT NULL
);
CREATE TABLE publicreport.quick_photo (
id SERIAL PRIMARY KEY,
size BIGINT NOT NULL,
filename TEXT NOT NULL,
quick_id INT NOT NULL REFERENCES publicreport.quick(id),
uuid UUID NOT NULL
);
-- +goose Down
DROP TABLE publicreport.quick_photo;
DROP TABLE publicreport.quick;
DROP SCHEMA publicreport;