-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdrop_tables.sh
49 lines (47 loc) · 2.24 KB
/
drop_tables.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# vars
DBHOST='192.168.1.144'
DBNAME='people_for_bikes'
OSMPREFIX='neighborhood'
# drop old tables
echo 'Dropping old tables'
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_ways;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_ways_intersections;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_relations_ways;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_nodes;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_relations;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_way_classes;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_way_tags;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_way_types;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_ways;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_ways_vertices_pgr;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_relations_ways;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_osm_nodes;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_osm_relations;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_osm_way_classes;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_osm_way_tags;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS scratch.${OSMPREFIX}_cycwys_osm_way_types;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_full_line;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_full_point;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_full_polygon;"
psql -h $DBHOST -U gis -d ${DBNAME} \
-c "DROP TABLE IF EXISTS received.${OSMPREFIX}_osm_full_roads;"