<commit_before>#!/bin/bash

set -e

export PGHOST=db
export PGDATABASE=ckan
export PGUSER=postgres
export PGPASSWORD=${DB_ENV_POSTGRES_PASSWORD}

psql -f /usr/share/postgresql/9.3/contrib/postgis-2.1/postgis.sql
psql -f /usr/share/postgresql/9.3/contrib/postgis-2.1/spatial_ref_sys.sql
psql -d ckan -c 'ALTER VIEW geometry_columns OWNER TO ckan;'
psql -d ckan -c 'ALTER TABLE spatial_ref_sys OWNER TO ckan;'<commit_msg>install_postgis.sh: skip creating postgis tables if they already exist<commit_after>#!/bin/bash

set -e

export PGHOST=db
export PGDATABASE=ckan
export PGUSER=postgres
export PGPASSWORD=${DB_ENV_POSTGRES_PASSWORD}

psql -c 'SELECT * FROM geometry_columns LIMIT 1;' 2> /dev/null && exit 0

psql -f /usr/share/postgresql/9.3/contrib/postgis-2.1/postgis.sql
psql -f /usr/share/postgresql/9.3/contrib/postgis-2.1/spatial_ref_sys.sql
psql -c 'ALTER VIEW geometry_columns OWNER TO ckan;'
psql -c 'ALTER TABLE spatial_ref_sys OWNER TO ckan;'
{'fraction_non_alphanumeric': 0.11332633788037776, 'fraction_numerical': 0.01993704092339979, 'mean_word_length': 4.925465838509317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6941548', 'n_tokens_mistral': 405, 'n_tokens_neox': 396, 'n_words': 88}