mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
9f60ece25f
Conflicts: app/models/repository.rb app/models/repository_row.rb app/views/projects/index.html.erb app/views/shared/_secondary_navigation.html.erb
21 lines
588 B
Ruby
21 lines
588 B
Ruby
require File.expand_path('app/helpers/database_helper')
|
|
include DatabaseHelper
|
|
|
|
class AddSearchIndexesToRepositories < ActiveRecord::Migration[4.2]
|
|
def up
|
|
if db_adapter_is? 'PostgreSQL'
|
|
if index_exists?(:repository_rows, :name)
|
|
remove_index :repository_rows, :name
|
|
end
|
|
add_gin_index_without_tags :repository_rows, :name
|
|
add_gin_index_without_tags :repository_text_values, :data
|
|
end
|
|
end
|
|
|
|
def down
|
|
if db_adapter_is? 'PostgreSQL'
|
|
remove_index :repository_rows, :name
|
|
remove_index :repository_text_values, :data
|
|
end
|
|
end
|
|
end
|