Mercurial > lada > lada-server
comparison db_schema/setup-db.sh @ 1188:1bc8ab13e1f7
redesign stammdaten.verwaltungseinheit
author | Michael Stanko <mstanko@bfs.de> |
---|---|
date | Fri, 25 Nov 2016 09:37:39 +0100 |
parents | 186d602e031a |
children | 3923b41f8783 d667092cc788 |
comparison
equal
deleted
inserted
replaced
1187:3c24d33bf0db | 1188:1bc8ab13e1f7 |
---|---|
70 ON ALL SEQUENCES IN SCHEMA stammdaten, land TO $ROLE_NAME; | 70 ON ALL SEQUENCES IN SCHEMA stammdaten, land TO $ROLE_NAME; |
71 GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES | 71 GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES |
72 ON ALL TABLES IN SCHEMA stammdaten, land TO $ROLE_NAME;" | 72 ON ALL TABLES IN SCHEMA stammdaten, land TO $ROLE_NAME;" |
73 | 73 |
74 if [ "$NO_DATA" != "true" ]; then | 74 if [ "$NO_DATA" != "true" ]; then |
75 echo import stammdaten.verwaltungseinheit | |
76 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_data_verwaltungseinheit.sql | |
77 | |
75 echo import stammdaten | 78 echo import stammdaten |
76 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_data.sql | 79 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_data.sql |
77 | 80 |
78 echo import lada test data | 81 echo import lada test data |
79 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/lada_data.sql | 82 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/lada_data.sql |
80 | 83 |
81 echo create user $ROLE_NAME | 84 echo create user $ROLE_NAME |
82 psql $DB_CONNECT_STRING -d $DB_NAME --command "CREATE SCHEMA geo AUTHORIZATION $ROLE_NAME" | 85 psql $DB_CONNECT_STRING -d $DB_NAME --command "CREATE SCHEMA geo AUTHORIZATION $ROLE_NAME" |
83 | 86 |
87 echo downlaod and import german administrative borders | |
84 TS="0101" | 88 TS="0101" |
85 cd /tmp | |
86 if [ ! -f vg250_${TS}.utm32s.shape.ebenen.zip ]; then | 89 if [ ! -f vg250_${TS}.utm32s.shape.ebenen.zip ]; then |
87 curl -O \ | 90 curl -O \ |
88 http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip | 91 http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip |
89 fi | 92 fi |
90 unzip vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*" | 93 unzip -u vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*" |
91 cd vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/ | 94 # cd vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/ |
92 shp2pgsql VG250_GEM geo.gem_utm | psql -q $DB_CONNECT_STRING -d $DB_NAME | 95 shp2pgsql vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/VG250_GEM geo.gem_utm | psql -q $DB_CONNECT_STRING -d $DB_NAME |
93 cd /tmp | 96 # rm -rf vg250_${TS}.utm32s.shape.ebenen |
94 rm -rf vg250_${TS}.utm32s.shape.ebenen | 97 |
98 echo fille stammdaten.verwaltungsgrenze | |
99 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_fill_verwaltungsgrenze.sql | |
100 | |
101 if [ -f $DIR/lada_auth.sql ]; then | |
102 echo load private auth configuration | |
103 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/lada_auth.sql | |
104 fi | |
95 fi | 105 fi |