Add migration to calculate and store the h3 cell
I'm only doing this for now on the tables we need to return to Nidus, eventually we'll add them to more tables as we need, probably.
This commit is contained in:
parent
113e73a8b9
commit
6517d50802
2 changed files with 66 additions and 59 deletions
9
db/migrations/00022_h3cell_fieldseeker_tables.sql
Normal file
9
db/migrations/00022_h3cell_fieldseeker_tables.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
-- +goose Up
|
||||
ALTER TABLE fieldseeker.pointlocation ADD COLUMN h3cell h3index GENERATED ALWAYS AS (h3_latlng_to_cell(geospatial, 15)) STORED;
|
||||
ALTER TABLE fieldseeker.servicerequest ADD COLUMN h3cell h3index GENERATED ALWAYS AS (h3_latlng_to_cell(geospatial, 15)) STORED;
|
||||
ALTER TABLE fieldseeker.treatment ADD COLUMN h3cell h3index GENERATED ALWAYS AS (h3_latlng_to_cell(geospatial, 15)) STORED;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE fieldseeker.pointlocation DROP COLUMN h3cell;
|
||||
ALTER TABLE fieldseeker.servicerequest DROP COLUMN h3cell;
|
||||
ALTER TABLE fieldseeker.treatment DROP COLUMN h3cell;
|
||||
Loading…
Add table
Add a link
Reference in a new issue