nidus-sync/db/migrations/00117_publicreport_report_location_latlng.sql

7 lines
402 B
MySQL
Raw Normal View History

-- +goose Up
ALTER TABLE publicreport.report ADD COLUMN location_latitude DOUBLE PRECISION GENERATED ALWAYS AS (ST_Y(location)) STORED;
ALTER TABLE publicreport.report ADD COLUMN location_longitude DOUBLE PRECISION GENERATED ALWAYS AS (ST_X(location)) STORED;
-- +goose Down
ALTER TABLE publicreport.report DROP COLUMN location_longitude;
ALTER TABLE publicreport.report DROP COLUMN location_latitude;