comparison db_schema/setup-db.sh @ 1319:512616ea3228 release-2.5

fix somme test data
author Michael Stanko <mstanko@bfs.de>
date Thu, 23 Mar 2017 09:02:26 +0100
parents 6692b3bdc49d
children bfbbd390c9a8
comparison
equal deleted inserted replaced
1317:3ac30d816c9a 1319:512616ea3228
38 DB_CONNECT_STRING="$DB_CONNECT_STRING -p $DB_PORT" 38 DB_CONNECT_STRING="$DB_CONNECT_STRING -p $DB_PORT"
39 fi 39 fi
40 DB_CONNECT_STRING="$DB_CONNECT_STRING -U postgres" 40 DB_CONNECT_STRING="$DB_CONNECT_STRING -U postgres"
41 echo "DB_CONNECT_STRING = $DB_CONNECT_STRING" 41 echo "DB_CONNECT_STRING = $DB_CONNECT_STRING"
42 42
43 if [ `psql $DB_CONNECT_STRING -t --command "SELECT count(*) FROM pg_catalog.pg_user WHERE usename = '$ROLE_NAME'"` -eq 0 ] ; then 43 if [ `psql $DB_CONNECT_STRING -t --quiet --command "SELECT count(*) FROM pg_catalog.pg_user WHERE usename = '$ROLE_NAME'"` -eq 0 ] ; then
44 echo create user $ROLE_NAME 44 echo create user $ROLE_NAME
45 psql $DB_CONNECT_STRING --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';" 45 psql $DB_CONNECT_STRING --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';"
46 fi 46 fi
47 47
48 if [ "$DROP_DB" = "true" ] && psql $DB_CONNECT_STRING -l | grep -q "^ $DB_NAME " ; then 48 if [ "$DROP_DB" = "true" ] && psql $DB_CONNECT_STRING -l | grep -q "^ $DB_NAME " ; then
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 if [ -f $DIR/lada_private_data.zip ]; then
76 echo inclue private data
77 unzip -o lada_private_data.zip
78 fi
79
75 echo import stammdaten.verwaltungseinheit 80 echo import stammdaten.verwaltungseinheit
76 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_data_verwaltungseinheit.sql 81 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_data_verwaltungseinheit.sql
77 82
78 echo import stammdaten 83 echo import stammdaten
79 for file in \ 84 for file in \
125 if [ ! -f vg250_${TS}.utm32s.shape.ebenen.zip ]; then 130 if [ ! -f vg250_${TS}.utm32s.shape.ebenen.zip ]; then
126 curl -O \ 131 curl -O \
127 http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip 132 http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip
128 fi 133 fi
129 unzip -u vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*" 134 unzip -u vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*"
130 # cd vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/ 135
131 shp2pgsql -s 25832:4326 vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/VG250_GEM geo.gem_utm | psql -q $DB_CONNECT_STRING -d $DB_NAME 136 shp2pgsql -s 25832:4326 vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/VG250_GEM geo.gem_utm | psql -q $DB_CONNECT_STRING -d $DB_NAME
132 # rm -rf vg250_${TS}.utm32s.shape.ebenen
133 137
134 echo fille stammdaten.verwaltungsgrenze 138 echo fille stammdaten.verwaltungsgrenze
135 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_fill_verwaltungsgrenze.sql 139 psql -q $DB_CONNECT_STRING -d $DB_NAME -f $DIR/stammdaten_fill_verwaltungsgrenze.sql
136 140
137 if [ -f $DIR/lada_auth.sql ]; then 141 if [ -f $DIR/lada_auth.sql ]; then
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)