Class: UpgradeAuditsTable

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

Class Method Summary collapse

Class Method Details

.downObject



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

.upObject



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