From 84064b7c5a863a476aad1adaa54f9b1edf6c4903 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Fri, 8 Mar 2019 10:33:52 +0000 Subject: [PATCH] Create extensions in vm provision --- provision/vm_provision.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/provision/vm_provision.sh b/provision/vm_provision.sh index 3584eb09..ef5b4346 100644 --- a/provision/vm_provision.sh +++ b/provision/vm_provision.sh @@ -86,8 +86,12 @@ su postgres -c "psql -c \"SELECT 1 FROM pg_user WHERE usename = 'vagrant';\" " \ su postgres -c "psql -c \"SELECT 1 FROM pg_database WHERE datname = 'vagrant';\" " \ | grep -q 1 || su postgres -c "createdb -E UTF8 -T template0 --locale=en_US.utf8 -O vagrant vagrant" + +# Create extensions +su vagrant -c "psql -c \"create extension postgis; create extension pgcrypto;\" " + # Run all 'up' migrations to create tables, data types, indexes -su postgres -c "ls /vagrant/migrations/*.up.sql 2>/dev/null | while read -r migration; do psql < \$migration; done;" +su vagrant -c "ls /vagrant/migrations/*.up.sql 2>/dev/null | while read -r migration; do psql < \$migration; done;" #