surfriderfoundationeurope / plasticorigins-ops-db

Database management (access, code, etc)
MIT License
1 stars 1 forks source link

Missing schema referential.segment #28

Open charlesollion opened 1 year ago

charlesollion commented 1 year ago

the table referential.segment is entirely missing from the migrations. It should be added, as well as indexes (which had to be recreated by hand):

ALTER TABLE referential.segment ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME referential.segment_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
ALTER TABLE ONLY referential.segment ADD CONSTRAINT "PK_segment" PRIMARY KEY (id);
CREATE INDEX "IX_segment_id_ref_country_fk" ON referential.segment USING btree (id_ref_country_fk);
CREATE INDEX "IX_segment_id_ref_river_fk" ON referential.segment USING btree (id_ref_river_fk);
CREATE INDEX segment_id ON referential.segment USING btree (id);
CREATE INDEX segment_importance ON referential.segment USING btree (importance);
CREATE INDEX segment_the_geom ON referential.segment USING gist (the_geom);