Sha256: f13461757c41a67c90292ac4448b2ba009ef6cbee9d37cfb181f7aacbd9d9f6f

Contents?: true

Size: 925 Bytes

Versions: 23

Compression:

Stored size: 925 Bytes

Contents

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

      t.string        :user_type
      t.integer       :user_id

      t.string        :changes_to_type
      t.integer       :changes_to_id

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

      t.integer       :logs_count

      t.text          :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

23 entries across 23 versions & 1 rubygems

Version Path
effective_logging-3.4.1 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.4.0 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.3.0 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.2.3 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.2.2 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.2.1 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.2.0 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.15 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.14 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.13 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.12 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.11 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.10 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.9 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.8 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.7 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.6 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.5 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.4 db/migrate/01_create_effective_logging.rb.erb
effective_logging-3.1.3 db/migrate/01_create_effective_logging.rb.erb