File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
schema/postgres/migrations Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ BEGIN ;
2+
3+ ALTER TABLE tl_census_datasets rename column dataset_name to name;
4+ ALTER TABLE tl_census_datasets add column description text ;
5+ ALTER TABLE tl_census_datasets alter column year_min drop not null ;
6+ ALTER TABLE tl_census_datasets alter column year_max drop not null ;
7+ ALTER TABLE tl_census_datasets alter column url drop not null ;
8+
9+ ALTER TABLE tl_census_sources rename column source_name to name;
10+ ALTER TABLE tl_census_sources add column description text ;
11+
12+ CREATE TABLE tl_census_layers (
13+ id bigserial PRIMARY KEY ,
14+ dataset_id bigint REFERENCES tl_census_datasets(id) not null ,
15+ name text NOT NULL ,
16+ description text ,
17+ created_at timestamp without time zone DEFAULT now() NOT NULL ,
18+ updated_at timestamp without time zone DEFAULT now() NOT NULL
19+ );
20+ CREATE INDEX ON tl_census_layers (name);
21+ CREATE INDEX ON tl_census_layers (dataset_id);
22+
23+ ALTER TABLE tl_census_geographies ADD COLUMN layer_id bigint REFERENCES tl_census_layers(id);
24+ ALTER TABLE tl_census_geographies DROP COLUMN layer_name;
25+ CREATE INDEX ON tl_census_geographies (layer_id);
26+
27+ COMMIT ;
You can’t perform that action at this time.
0 commit comments