ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m48s
ci / test (pull_request) Successful in 12m42s
ci / build (pull_request) Canceled after 30s
ci / image (pull_request) Canceled after 0s
Regions get an optional location. Platform admins set it for platform regions and org admins for their own, by clicking the map on the regions page or entering the coordinates; PATCH /org/regions/:id and /admin/regions/:id set or remove it. The monitor form shows the located regions on a map from the self-hosted ZB-Server Maps: a click on a marker ticks or unticks the region, and the checkbox list stays the source of truth. MapLibre loads only on pages with a map, and the map stays hidden if the map server cannot be reached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
17 lines
556 B
SQL
17 lines
556 B
SQL
-- +goose Up
|
|
-- Where a region's checkers stand, so the monitor form can show them on a
|
|
-- map. Both coordinates are set or neither is.
|
|
ALTER TABLE regions
|
|
ADD COLUMN latitude double precision,
|
|
ADD COLUMN longitude double precision,
|
|
ADD CONSTRAINT regions_location_check CHECK (
|
|
(latitude IS NULL AND longitude IS NULL)
|
|
OR (latitude BETWEEN -90 AND 90 AND longitude BETWEEN -180 AND 180)
|
|
);
|
|
|
|
-- +goose Down
|
|
ALTER TABLE regions
|
|
DROP CONSTRAINT regions_location_check,
|
|
DROP COLUMN latitude,
|
|
DROP COLUMN longitude;
|