Class: CtMigrate

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

Class Method Summary collapse

Class Method Details

.downObject



21
22
23
24
25
# File 'lib/generators/cheaptoad_migration/templates/migration.rb', line 21

def self.down
  remove_index("notices", "backtrace_digest")
  remove_index("notices", "updated_at")
  drop_table "notices"
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/cheaptoad_migration/templates/migration.rb', line 2

def self.up
  create_table "notices", :force => true do |t|
    t.string :api_key, :limit => 100
    t.string :error_message, :limit => 200
    t.string :error_class, :limit => 100
    t.string :backtrace_digest, :limit => 256
    t.integer :count
    t.text :session
    t.text :request
    t.text :environment
    t.text :backtrace

    t.timestamps
  end

  add_index("notices", "backtrace_digest")
  add_index("notices", "updated_at")
end