Sha256: 1f78b301c5f53d0c05cdd8d417c69736585b95ac8ca227b93206b61f5313a8ac
Contents?: true
Size: 1.64 KB
Versions: 7
Compression:
Stored size: 1.64 KB
Contents
#!/usr/bin/env bash set -e function script_dir { val="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo "$val" } base=$(script_dir) echo echo "Installing Database" echo "Version: $(cat $base/VERSION.txt)" echo "= = =" if [ -z ${DATABASE_NAME+x} ]; then database=message_store echo "DATABASE_NAME is not set. Using: $database." export DATABASE_NAME=$database else database=$DATABASE_NAME fi if [ -z ${PGOPTIONS+x} ]; then export PGOPTIONS='-c client_min_messages=warning' fi function create-user { base=$(script_dir) echo "» message_store role" psql -q -f $base/roles/message-store.sql } function create-database { echo "» $database database" createdb $database } function create-schema { echo "» message_store schema" psql $database -q -f $base/schema/message-store.sql } function create-extensions { base=$(script_dir) echo "» pgcrypto extension" psql $database -q -f $base/extensions/pgcrypto.sql } function create-table { base=$(script_dir) echo "» messages table" psql $database -q -f $base/tables/messages.sql } echo echo "Creating User" echo "- - -" create-user echo echo "Creating Database" echo "- - -" create-database echo echo "Creating Schema" echo "- - -" create-schema echo echo "Creating Extensions" echo "- - -" create-extensions echo echo "Creating Table" echo "- - -" create-table echo # Install functions source $base/install-functions.sh # Install indexes source $base/install-indexes.sh # Install views source $base/install-views.sh # Install privileges source $base/install-privileges.sh echo "= = =" echo "Done Installing Database" echo "Version: $(cat $base/VERSION.txt)" echo
Version data entries
7 entries across 7 versions & 1 rubygems