Mercurial > dive4elements > river
annotate backend/doc/schema/postgresql-migrate-dami.sql @ 9280:d1ce60b760bd
Fixed: tkh that got loaded via datacage (SINFO/Transportkörperhöhen) did not show up.
author | gernotbelger |
---|---|
date | Fri, 20 Jul 2018 14:57:16 +0200 |
parents | 5aa05a7a34b7 |
children |
rev | line source |
---|---|
4954
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
1 DROP table hws; |
5026
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
2 DROP sequence HWS_ID_SEQ; |
5068
df090e461c30
Add some missed changes to the migrate-dami.sql script
Andre Heinecke <aheinecke@intevation.de>
parents:
5037
diff
changeset
|
3 DROP table lines; |
df090e461c30
Add some missed changes to the migrate-dami.sql script
Andre Heinecke <aheinecke@intevation.de>
parents:
5037
diff
changeset
|
4 DROP sequence LINES_ID_SEQ; |
df090e461c30
Add some missed changes to the migrate-dami.sql script
Andre Heinecke <aheinecke@intevation.de>
parents:
5037
diff
changeset
|
5 DROP table catchment; |
df090e461c30
Add some missed changes to the migrate-dami.sql script
Andre Heinecke <aheinecke@intevation.de>
parents:
5037
diff
changeset
|
6 DROP sequence CATCHMENT_ID_SEQ; |
df090e461c30
Add some missed changes to the migrate-dami.sql script
Andre Heinecke <aheinecke@intevation.de>
parents:
5037
diff
changeset
|
7 |
4954
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 -- Static lookup tables for Hochwasserschutzanlagen |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 CREATE TABLE hws_kinds ( |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 id int PRIMARY KEY NOT NULL, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 kind VARCHAR(64) NOT NULL |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 ); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
13 INSERT INTO hws_kinds (id, kind) VALUES (1, 'Durchlass'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 INSERT INTO hws_kinds (id, kind) VALUES (2, 'Damm'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 INSERT INTO hws_kinds (id, kind) VALUES (3, 'Graben'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
17 CREATE TABLE fed_states ( |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 id int PRIMARY KEY NOT NULL, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 name VARCHAR(23) NOT NULL |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
20 ); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
21 INSERT INTO fed_states (id, name) VALUES (1, 'Bayern'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
22 INSERT INTO fed_states (id, name) VALUES (2, 'Hessen'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
23 INSERT INTO fed_states (id, name) VALUES (3, 'Niedersachsen'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
24 INSERT INTO fed_states (id, name) VALUES (4, 'Nordrhein-Westfalen'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
25 INSERT INTO fed_states (id, name) VALUES (5, 'Rheinland-Pfalz'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
26 INSERT INTO fed_states (id, name) VALUES (6, 'Saarland'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
27 INSERT INTO fed_states (id, name) VALUES (7, 'Schleswig-Holstein'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
28 INSERT INTO fed_states (id, name) VALUES (8, 'Brandenburg'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
29 INSERT INTO fed_states (id, name) VALUES (9, 'Mecklenburg-Vorpommern'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
30 INSERT INTO fed_states (id, name) VALUES (10, 'Thüringen'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
31 INSERT INTO fed_states (id, name) VALUES (11, 'Baden-Württemberg'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
32 INSERT INTO fed_states (id, name) VALUES (12, 'Sachsen-Anhalt'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
33 INSERT INTO fed_states (id, name) VALUES (13, 'Sachsen'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
34 INSERT INTO fed_states (id, name) VALUES (14, 'Berlin'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
35 INSERT INTO fed_states (id, name) VALUES (15, 'Bremen'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
36 INSERT INTO fed_states (id, name) VALUES (16, 'Hamburg'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
37 |
5026
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
38 CREATE TABLE sectie_kinds ( |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
39 id int PRIMARY KEY NOT NULL, |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
40 name VARCHAR(64) NOT NULL |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
41 ); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
42 INSERT INTO sectie_kinds (id, name) VALUES (0, 'Unbekannt'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
43 INSERT INTO sectie_kinds (id, name) VALUES (1, 'Flussschlauch'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
44 INSERT INTO sectie_kinds (id, name) VALUES (2, 'Uferbank'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
45 INSERT INTO sectie_kinds (id, name) VALUES (3, 'Überflutungsbereich'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
46 |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
47 CREATE TABLE sobek_kinds ( |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
48 id int PRIMARY KEY NOT NULL, |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
49 name VARCHAR(64) NOT NULL |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
50 ); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
51 INSERT INTO sobek_kinds (id, name) VALUES (0, 'Unbekannt'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
52 INSERT INTO sobek_kinds (id, name) VALUES (1, 'Stromführend'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
53 INSERT INTO sobek_kinds (id, name) VALUES (2, 'Stromspeichernd'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
54 |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
55 CREATE TABLE boundary_kinds ( |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
56 id int PRIMARY KEY NOT NULL, |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
57 name VARCHAR(64) NOT NULL |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
58 ); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
59 INSERT INTO boundary_kinds (id, name) VALUES (0, 'Unbekannt'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
60 INSERT INTO boundary_kinds (id, name) VALUES (1, 'BfG'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
61 INSERT INTO boundary_kinds (id, name) VALUES (2, 'Land'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
62 INSERT INTO boundary_kinds (id, name) VALUES (3, 'Sonstige'); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
63 |
4954
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
64 --Hydrologie/HW-Schutzanlagen/*Linien.shp |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
65 CREATE SEQUENCE HWS_LINES_ID_SEQ; |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
66 CREATE TABLE hws_lines ( |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
67 id int PRIMARY KEY NOT NULL, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
68 ogr_fid int, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
69 kind_id int REFERENCES hws_kinds(id) DEFAULT 2, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
70 fed_state_id int REFERENCES fed_states(id), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
71 river_id int REFERENCES rivers(id), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
72 name VARCHAR(256), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
73 path VARCHAR(256), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
74 offical INT DEFAULT 0, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
75 agency VARCHAR(256), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
76 range VARCHAR(256), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
77 shore_side INT DEFAULT 0, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
78 source VARCHAR(256), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
79 status_date TIMESTAMP, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
80 description VARCHAR(256) |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
81 ); |
5037
2837b11cdb13
SCHEMA Change: Make hws_lines a 3d geom
Andre Heinecke <aheinecke@intevation.de>
parents:
5026
diff
changeset
|
82 SELECT AddGeometryColumn('hws_lines', 'geom', 31467, 'LINESTRING', 3); |
4954
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
83 -- TODO: dike_km_from dike_km_to, are they geometries? |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
84 |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
85 ALTER TABLE hws_lines ALTER COLUMN id SET DEFAULT NEXTVAL('HWS_LINES_ID_SEQ'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
86 |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
87 --Hydrologie/HW-Schutzanlagen/*Punkte.shp |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
88 CREATE SEQUENCE HWS_POINTS_ID_SEQ; |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
89 CREATE TABLE hws_points ( |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
90 id int PRIMARY KEY NOT NULL, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
91 ogr_fid int, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
92 kind_id int REFERENCES hws_kinds(id) DEFAULT 2, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
93 fed_state_id int REFERENCES fed_states(id), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
94 river_id int REFERENCES rivers(id), |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
95 name VARCHAR, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
96 path VARCHAR, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
97 offical INT DEFAULT 0, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
98 agency VARCHAR, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
99 range VARCHAR, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
100 shore_side INT DEFAULT 0, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
101 source VARCHAR, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
102 status_date VARCHAR, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
103 description VARCHAR, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
104 freeboard FLOAT8, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
105 dike_km FLOAT8, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
106 z FLOAT8, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
107 z_target FLOAT8, |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
108 rated_level FLOAT8 |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
109 ); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
110 SELECT AddGeometryColumn('hws_points', 'geom', 31467, 'POINT', 2); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
111 |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
112 ALTER TABLE hws_points ALTER COLUMN id SET DEFAULT NEXTVAL('HWS_POINTS_ID_SEQ'); |
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
113 |
5026
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
114 ALTER TABLE hydr_boundaries_poly ADD COLUMN sectie INT REFERENCES sectie_kinds(id); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
115 ALTER TABLE hydr_boundaries_poly ADD COLUMN sobek INT REFERENCES sobek_kinds(id); |
5068
df090e461c30
Add some missed changes to the migrate-dami.sql script
Andre Heinecke <aheinecke@intevation.de>
parents:
5037
diff
changeset
|
116 ALTER TABLE hydr_boundaries_poly ADD FOREIGN KEY (kind) REFERENCES boundary_kinds(id); |
5026
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
117 ALTER TABLE hydr_boundaries ADD COLUMN sectie INT REFERENCES sectie_kinds(id); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
118 ALTER TABLE hydr_boundaries ADD COLUMN sobek INT REFERENCES sobek_kinds(id); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
119 ALTER TABLE hydr_boundaries ADD FOREIGN KEY (kind) REFERENCES boundary_kinds(id); |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
120 ALTER TABLE dem ADD COLUMN srid INT NOT NULL; |
5121
e4cc9aebfcf1
sensible constraints for dem-table
Tom Gottfried <tom@intevation.de>
parents:
5068
diff
changeset
|
121 ALTER TABLE dem ALTER COLUMN year_from DROP NOT NULL; |
e4cc9aebfcf1
sensible constraints for dem-table
Tom Gottfried <tom@intevation.de>
parents:
5068
diff
changeset
|
122 ALTER TABLE dem ALTER COLUMN year_to DROP NOT NULL; |
e4cc9aebfcf1
sensible constraints for dem-table
Tom Gottfried <tom@intevation.de>
parents:
5068
diff
changeset
|
123 ALTER TABLE dem ALTER COLUMN projection DROP NOT NULL; |
e4cc9aebfcf1
sensible constraints for dem-table
Tom Gottfried <tom@intevation.de>
parents:
5068
diff
changeset
|
124 ALTER TABLE dem ALTER COLUMN path SET NOT NULL; |
4954
1a218a0bcfcf
Importer: Add db migration script for postgres to track schema changes
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
125 |
5026
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
126 COMMIT; |
bdef4c74d675
Update migrators for changes made in the dami branch and add
Andre Heinecke <aheinecke@intevation.de>
parents:
4954
diff
changeset
|
127 |