Add location x and y to address table
For easier reference
This commit is contained in:
parent
441e4d45b1
commit
edfd8e285f
3 changed files with 39 additions and 2 deletions
6
db/migrations/00122_address_location_xy.sql
Normal file
6
db/migrations/00122_address_location_xy.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- +goose Up
|
||||
ALTER TABLE address ADD COLUMN location_x DOUBLE PRECISION GENERATED ALWAYS AS (ST_X(location)) STORED;
|
||||
ALTER TABLE address ADD COLUMN location_y DOUBLE PRECISION GENERATED ALWAYS AS (ST_Y(location)) STORED;
|
||||
-- +goose Down
|
||||
ALTER TABLE address DROP COLUMN location_y;
|
||||
ALTER TABLE address DROP COLUMN location_x;
|
||||
Loading…
Add table
Add a link
Reference in a new issue