class CreateRequestLogEntries < ActiveRecord::Migration
  def self.up
    create_table :request_log_entries do |t|

      t.timestamps 

      # These are not FKs to avoid insert overhead, and to allow
      # 'em to be deleted later

      t.integer :acting_user_id
      t.integer :user_of_record_id

      t.string  :acting_user_name
      t.string  :user_of_record_name

      t.string  :controller,  :limit => 100, :null => false
      t.string  :action,      :limit => 100, :null => false

      t.string  :http_method, :limit =>  50, :null => false
      t.string  :status,      :limit => 100, :null => false

      t.string  :model_class, :limit => 100
      t.integer :model_id

      t.string  :remote_ip,  :limit =>  50

    end
  end

  def self.down
    drop_table :request_log_entries
  end
end

