1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/db/migrate/20200629123011_update_pg_trgm.rb

22 lines
560 B
Ruby

# frozen_string_literal: true
# Recreate the pg_trgm extension to upgrade from v1.1 to v1.3
# This will enable the function word_similarity(text, text) for the project's full-text searches
class UpdatePgTrgm < ActiveRecord::Migration[5.2]
# PostgreSQL only
def up
say_with_time('Upgrade extension :pg_trgm') do
execute <<~SQL
ALTER EXTENSION pg_trgm UPDATE;
SQL
end
end
def down
# we cannot downgrade a postgresSQL extension, so we do nothing
execute <<~SQL
ALTER EXTENSION pg_trgm UPDATE;
SQL
end
end