From b08ab236dc9e0cf766026c83edb2994a14f5af0b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 27 Jun 2016 09:10:33 +0200 Subject: [PATCH] [bug] Unable to run migrations if postgre unaccent was already active --- db/migrate/20160613093842_create_unaccent_function.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20160613093842_create_unaccent_function.rb b/db/migrate/20160613093842_create_unaccent_function.rb index 2c6ed05dd..750f71734 100644 --- a/db/migrate/20160613093842_create_unaccent_function.rb +++ b/db/migrate/20160613093842_create_unaccent_function.rb @@ -2,8 +2,8 @@ class CreateUnaccentFunction < ActiveRecord::Migration # PostgreSQL only def up - execute 'CREATE EXTENSION unaccent;' - execute 'CREATE EXTENSION pg_trgm;' + execute 'CREATE EXTENSION IF NOT EXISTS unaccent;' + execute 'CREATE EXTENSION IF NOT EXISTS pg_trgm;' execute "CREATE OR REPLACE FUNCTION f_unaccent(text) RETURNS text AS $func$