Skip to content

Commit

Permalink
Relax census geoid constraint (#382)
Browse files Browse the repository at this point in the history
* Relax census geoid constraint

* Add unique index on census values

* Additional census schema additions
  • Loading branch information
irees authored Oct 22, 2024
1 parent 47bde1e commit cdec759
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions schema/postgres/migrations/20241022000157_census_geoid.up.pgsql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
BEGIN;

ALTER TABLE tl_census_values DROP COLUMN geography_id;
ALTER TABLE tl_census_values ADD COLUMN geoid TEXT NOT NULL;
CREATE INDEX ON tl_census_values(geoid);
CREATE UNIQUE INDEX ON tl_census_values(geoid, table_id);

ALTER TABLE tl_census_values ADD COLUMN source_id bigint not null REFERENCES tl_census_sources(id);
CREATE INDEX ON tl_census_values(source_id);

ALTER TABLE tl_census_tables ADD COLUMN table_details text;

ALTER TABLE tl_census_fields ADD COLUMN column_order double precision;

COMMIT;

0 comments on commit cdec759

Please sign in to comment.