Class: CreateActionLogs

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

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/generators/action_logger/templates/create_action_logs.rb', line 16

def self.down
  drop_table :admin_notes
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/action_logger/templates/create_action_logs.rb', line 2

def self.up
  create_table :action_logs do |t|
    t.integer :sender_id
    t.string :sender_type
    t.string :action
    t.string :source
    t.string :ip
    t.text :data
    t.integer :admin_id
    t.timestamps
  end
  add_index :action_logs, [:sender_type, :sender_id]
end