Class: UpgradeAuditsTable
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- UpgradeAuditsTable
- Defined in:
- lib/generators/auditor/upgrade/templates/upgrade.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
9 10 11 12 |
# File 'lib/generators/auditor/upgrade/templates/upgrade.rb', line 9 def self.down remove_column :audits, :owner_type remove_column :audits, :owner_id end |
.up ⇒ Object
2 3 4 5 6 7 |
# File 'lib/generators/auditor/upgrade/templates/upgrade.rb', line 2 def self.up add_column :audits, :owner_id, :integer add_column :audits, :owner_type, :string add_index :audits, [:owner_id, :owner_type], :name => 'owner_index' end |