aboutsummaryrefslogtreecommitdiffstats
path: root/lib/generators/acts_as_xapian/templates/migration.rb
blob: 84a9dd766f752b918636b0ee5e2074d511a4d9ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class CreateActsAsXapian < ActiveRecord::Migration
  def self.up
    create_table :acts_as_xapian_jobs do |t|
      t.column :model, :string, :null => false
      t.column :model_id, :integer, :null => false
      t.column :action, :string, :null => false
    end
    add_index :acts_as_xapian_jobs, [:model, :model_id], :unique => true
  end
  def self.down
    drop_table :acts_as_xapian_jobs
  end
end