Sha256: b6e0b02b5f1a10e01ade8ec9dbc897622ef69d590c037c3508d778457af562d9

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

class <%= class_name %> < ActiveRecord::Migration
  def self.up
    create_table :audits, :force => true do |t|
      t.column :auditable_id, :integer
      t.column :auditable_type, :string
      t.column :<%= human_model %>_id, :integer
      t.column :<%= human_model %>_type, :string
      t.column :username, :string
      t.column :action, :string
      t.column :changes, :text
      t.column :version, :integer, :default => 0
      t.column :created_at, :datetime
    end

    add_index :audits, [:auditable_id, :auditable_type], :name => 'auditable_index'
    add_index :audits, [:<%= human_model %>_id, :<%= human_model %>_type], :name => '<%= human_model %>_index'
    add_index :audits, :created_at
  end

  def self.down
    drop_table :audits
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_audited_customized-1.2.1 generators/audited_migration/templates/migration.rb