Class: CreateTkhSearchResults

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/tkh_search/create_or_update_migrations/templates/create_tkh_search_results.rb

Class Method Summary collapse

Class Method Details

.downObject



14
15
16
17
# File 'lib/generators/tkh_search/create_or_update_migrations/templates/create_tkh_search_results.rb', line 14

def self.down
  remove_index :tkh_search_results, :token
  drop_table :tkh_search_results
end

.upObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/generators/tkh_search/create_or_update_migrations/templates/create_tkh_search_results.rb', line 3

def self.up
  create_table :tkh_search_results do |t|
    t.string  :token
    t.string  :model_name
    t.integer :model_record_id
    t.integer :rating,            default: 0
    t.timestamps
  end
  add_index :tkh_search_results, :token
end