Module: PhatPgsearch::PostgreSQL::SchemaStatements

Defined in:
lib/phat_pgsearch/postgresql.rb

Instance Method Summary collapse

Instance Method Details

#add_gin_index(table_name, column_name, options = {}) ⇒ Object

deprecated use: add_index :sample_headers, :tsv, using: :gin



21
22
23
24
25
# File 'lib/phat_pgsearch/postgresql.rb', line 21

def add_gin_index(table_name, column_name, options = {})
  index_name = index_name(table_name, :column => column_name)
  index_name = options[:name].to_s if options.key?(:name)
  execute "CREATE INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} USING gin(#{quote_column_name(column_name)})"
end

#add_gist_index(table_name, column_name, options = {}) ⇒ Object

deprecated use: add_index :sample_headers, :tsv, using: :gist



29
30
31
32
33
# File 'lib/phat_pgsearch/postgresql.rb', line 29

def add_gist_index(table_name, column_name, options = {})
  index_name = index_name(table_name, :column => column_name)
  index_name = options[:name].to_s if options.key?(:name)
  execute "CREATE INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} USING gist(#{quote_column_name(column_name)})"
end