scinote-web/db/migrate/20210618104853_add_code_index_to_experiments.rb
2021-06-22 12:51:25 +02:00

15 lines
404 B
Ruby

# frozen_string_literal: true
class AddCodeIndexToExperiments < ActiveRecord::Migration[6.1]
def up
ActiveRecord::Base.connection.execute(
"CREATE INDEX index_experiments_on_experiment_code ON experiments using gin (('EX'::text || id) gin_trgm_ops);"
)
end
def down
ActiveRecord::Base.connection.execute(
'DROP INDEX index_experiments_on_experiment_code;'
)
end
end