Class: CreateDrafts

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/kentouzu/templates/create_drafts.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/kentouzu/templates/create_drafts.rb', line 2

def change
  create_table :drafts do |t|
    t.string :item_type,   :null => false
    t.integer :item_id
    t.string :event,       :null => false
    t.string :source_type
    t.string :source_id
    t.text :object
    t.datetime :created_at
    t.datetime :updated_at
  end

  change_table :drafts do |t|
    t.index :item_type
    t.index :item_id
    t.index :event
    t.index :source_type
    t.index :source_id
    t.index :created_at
    t.index :updated_at
  end
end