Sha256: 713f159516dc0dd7f80867360f398951281e52dc4f398096d096783acaafdf4d
Contents?: true
Size: 821 Bytes
Versions: 20
Compression:
Stored size: 821 Bytes
Contents
class CreateApprovals < ActiveRecord::Migration def self.up create_table :approvals do |t| t.string :item_type, :null => false t.integer :item_id, :null => false t.string :event, :null => false t.integer :state, :null => false, :default => 0 <% if options[:owner] %> t.integer :owner_id <% end %> t.text :object t.text :reason t.timestamps end add_index :approvals, [:state, :event] add_index :approvals, [:item_type, :item_id] <% if options[:owner] %> add_index :approvals, [:owner_id] <% end %> end def self.down remove_index :approvals, [:state, :event] remove_index :approvals, [:item_type, :item_id] <% if options[:owner] %> remove_index :approvals, [:owner_id] <% end %> drop_table :approvals end end
Version data entries
20 entries across 10 versions & 1 rubygems