class CreatePcheckLogEntries < ActiveRecord::Migration
  def self.up
    create_table :pcheck_log_entries do |t|

      t.foreign_key :request_log_entry_id,   :null => false, :name => :fk_pcheck_req_log

      t.boolean :success,                    :null => false
      t.string  :model_class, :limit => 100, :null => false
      t.integer :model_id,                   :null => true # unsaved objects
      t.string  :privilege,   :limit =>  40, :null => false
      t.integer :user_id,                    :null => false
      t.string  :user_name,   :limit => 100, :null => false

      t.timestamps 

    end
  end

  def self.down
    drop_table :pcheck_log_entries
  end
end

