mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
17 lines
389 B
Ruby
17 lines
389 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Index for full-text search in projects
|
||
|
class AddSearchVectorToProject < ActiveRecord::Migration[5.2]
|
||
|
def self.up
|
||
|
add_column :projects, :search_vector, :tsvector
|
||
|
|
||
|
execute <<-SQL
|
||
|
CREATE INDEX projects_search_vector_idx ON projects USING gin(search_vector);
|
||
|
SQL
|
||
|
end
|
||
|
|
||
|
def self.down
|
||
|
remove_column :projects, :search_vector
|
||
|
end
|
||
|
end
|