From 7f4eef4c3d75ae4034d0cd176f0ab2b3c4d92fc2 Mon Sep 17 00:00:00 2001 From: zdk Date: Tue, 7 Oct 2014 14:52:51 +0700 Subject: [PATCH] FIX: Only create pg extension if it does not already exist --- templates/postgres.template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 565668a..990f6f8 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -166,8 +166,8 @@ run: - exec: su postgres -c 'psql discourse -c "create user discourse;"' || true - exec: su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true - exec: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' - - exec: su postgres -c 'psql template1 -c "create extension hstore;"' - - exec: su postgres -c 'psql template1 -c "create extension pg_trgm;"' + - exec: su postgres -c 'psql template1 -c "create extension if not exists hstore;"' + - exec: su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"' - exec: su postgres -c 'psql discourse -c "create extension if not exists hstore;"' - exec: su postgres -c 'psql discourse -c "create extension if not exists pg_trgm;"' -- 2.25.1