Sha256: e05634027578a9c47165d6c2bd37d98023fb1188289be809c7f1bb551e8781f2

Contents?: true

Size: 810 Bytes

Versions: 11

Compression:

Stored size: 810 Bytes

Contents

class CreateEffectiveLogging < ActiveRecord::Migration
  def self.up
    create_table <%= @logs_table_name %> do |t|
      t.integer       :parent_id

      t.integer       :user_id

      t.string        :associated_type
      t.integer       :associated_id
      t.string        :associated_to_s

      t.integer       :logs_count

      t.string        :message
      t.text          :details

      t.string        :status

      t.timestamps
    end

    add_index <%= @logs_table_name %>, :user_id
    add_index <%= @logs_table_name %>, :parent_id
    add_index <%= @logs_table_name %>, [:associated_type, :associated_id]
    add_index <%= @logs_table_name %>, :associated_id
    add_index <%= @logs_table_name %>, :associated_to_s
  end

  def self.down
    drop_table <%= @logs_table_name %>
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
effective_logging-1.10.10 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.9 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.8 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.7 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.6 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.5 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.4 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.3 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.2 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.1 db/migrate/01_create_effective_logging.rb.erb
effective_logging-1.10.0 db/migrate/01_create_effective_logging.rb.erb