Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add column otm_isolation to table planet_osm_polygon #336

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions mapnik/tools/update_isolations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ if [ "$column" != " otm_isolation" ] ; then
psql -d $DBname -c "ALTER TABLE planet_osm_point ADD COLUMN otm_isolation text;"
fi

#
# Check if otm_isolation is a column of planet_osm_polygon, if not, create it
#

column=`psql -d $DBname -t -c "SELECT attname FROM pg_attribute \
WHERE attrelid = ( SELECT oid FROM pg_class WHERE relname = 'planet_osm_polygon' ) \
AND attname = 'otm_isolation';"`

if [ "$column" != " otm_isolation" ] ; then
psql -d $DBname -c "ALTER TABLE planet_osm_polygon ADD COLUMN otm_isolation text;"
fi

#
# Check once again. If the column doesn't exist -> EXIT
#
Expand All @@ -51,6 +63,15 @@ if [ "$column" != " otm_isolation" ] ; then
exit 1
fi

column=`psql -d $DBname -t -c "SELECT attname FROM pg_attribute \
WHERE attrelid = ( SELECT oid FROM pg_class WHERE relname = 'planet_osm_polygon' ) \
AND attname = 'otm_isolation';"`

if [ "$column" != " otm_isolation" ] ; then
echo "Sorry, no column otm_isolation in planet_osm_polygon"
exit 1
fi


########## Update ###########
#
Expand Down