Class: InstallAuditRecord
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- InstallAuditRecord
- Defined in:
- lib/generators/audit_record/templates/install.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/generators/audit_record/templates/install.rb', line 2 def change create_table :audit_records do |t| t.integer :user_id, :allow_nil => false t.string :action t.text :modifications t.string :remote_address t.string :auditable_type t.integer :auditable_id t. end add_index :audit_records, :user_id add_index :audit_records, [:auditable_id, :auditable_type] end |