Class: CreateErrors
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateErrors
- Defined in:
- lib/generators/errorkit/templates/db/migrate/create_errors.rb
Overview
Generated by Errorkit.
Create an errors table for managing errors.
Class Method Summary collapse
Class Method Details
.down ⇒ Object
35 36 37 |
# File 'lib/generators/errorkit/templates/db/migrate/create_errors.rb', line 35 def self.down drop_table :errors end |
.up ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/generators/errorkit/templates/db/migrate/create_errors.rb', line 5 def self.up create_table :errors do |t| t.string :environment t.string :server t.string :version t.string :exception t.text :message t.text :backtrace t.string :controller t.string :action t.string :remote_ip t.text :session t.text :params t.string :worker t.string :queue t.text :payload t.text :url t.integer :user_id t.integer :subject_id t.string :subject_type t.datetime :resolved_at t. end add_index :errors, :exception add_index :errors, :created_at add_index :errors, :resolved_at end |