Sha256: fd16036a7ed4aaa36f2c0e9c029835bffe587dc5edec1f6c993799ed5b2164ba

Contents?: true

Size: 1.21 KB

Versions: 9

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env bash

set -e

echo
echo "Installing Database"
echo "= = ="
echo

default_name=message_store
if [ -z ${DATABASE_NAME+x} ]; then
  echo "(DATABASE_NAME is not set. Default will be used.)"
  database=$default_name
else
  database=$DATABASE_NAME
fi
echo "Database name is: $database"

echo

function script_dir {
  val="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  echo "$val"
}

function create-user {
  base=$(script_dir)
  psql -f $base/user/role.sql
  echo
}

function create-database {
  createdb $database
  echo
}

function create-extensions {
  base=$(script_dir)
  psql $database -f $base/extension/pgcrypto.sql
  echo
}

function create-table {
  base=$(script_dir)
  psql $database -f $base/table/messages.sql
  echo
}

base=$(script_dir)

echo
echo "Creating User: message_store"
echo "- - -"
create-user

echo
echo "Creating Database: $database"
echo "- - -"
create-database

echo
echo "Creating Extensions"
echo "- - -"
create-extensions

echo
echo "Creating Table"
echo "- - -"
create-table

# 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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
evt-message_store-postgres-database-1.1.0.2 database/install.sh
evt-message_store-postgres-database-1.1.0.1 database/install.sh
evt-message_store-postgres-database-1.1.0.0 database/install.sh
evt-message_store-postgres-database-1.0.0.0 database/install.sh
evt-message_store-postgres-database-0.11.0.0 database/install.sh
evt-message_store-postgres-database-0.10.1.3 database/install.sh
evt-message_store-postgres-database-0.10.1.2 database/install.sh
evt-message_store-postgres-database-0.10.1.1 database/install.sh
evt-message_store-postgres-database-0.10.1.0 database/install.sh