cirandas.net

ref: master

db/migrate/20140507195924_create_search_term_occurrences.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class CreateSearchTermOccurrences < ActiveRecord::Migration
  def up
    create_table :search_term_occurrences do |t|
      t.references   :search_term
      t.datetime     :created_at
      t.integer      :total, :default => 0
      t.integer      :indexed, :default => 0
    end
    add_index :search_term_occurrences, :created_at
  end

  def down
    remove_index :search_term_occurrences, :created_at
    drop_table :search_term_occurrences
  end
end