Files
grecia/db/migrate/20151028221647_add_pg_trgm_extension.rb
Javi Martín 55addaa58a Apply rubocop rules to migration files
There are some rules which only affect migration files, and we cannot
enable them if we're excluding those files from being inspected.

We're also changing migrations related to the Rails/TimeZone rule
slightly because these fields were already changed afterwards, so we
aren't changing the schema.
2019-10-24 20:35:13 +02:00

12 lines
307 B
Ruby

class AddPgTrgmExtension < ActiveRecord::Migration[4.2]
def change
return if extension_enabled?("pg_trgm")
begin
enable_extension "pg_trgm"
rescue StandardError => e
raise "Could not create extension pg_trgm. Please contact with your system administrator: #{e}"
end
end
end