Sha256: 2a1d8f226b31edfbf6a1f6db30ce1233b64006b845a58bb127ad62ac49a70f07

Contents?: true

Size: 779 Bytes

Versions: 17

Compression:

Stored size: 779 Bytes

Contents

# This migration and AddTransactionIdColumnToVersions provide the necessary
# schema for tracking associations.
class CreateVersionAssociations < ActiveRecord::Migration<%= migration_version %>
  def self.up
    create_table :version_associations do |t|
      t.integer  :version_id
      t.string   :foreign_key_name, null: false
      t.integer  :foreign_key_id
    end
    add_index :version_associations, [:version_id]
    add_index :version_associations,
      %i(foreign_key_name foreign_key_id),
      name: "index_version_associations_on_foreign_key"
  end

  def self.down
    remove_index :version_associations, [:version_id]
    remove_index :version_associations,
      name: "index_version_associations_on_foreign_key"
    drop_table :version_associations
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
paper_trail-association_tracking-1.0.0 lib/generators/paper_trail_association_tracking/templates/create_version_associations.rb.erb
paper_trail-association_tracking-0.0.1 lib/generators/paper_trail_association_tracking/templates/create_version_associations.rb.erb
paper_trail-9.1.1 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-9.1.0 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-9.0.2 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-9.0.1 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-9.0.0 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-8.1.2 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-8.1.1 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-8.1.0 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-8.0.1 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-8.0.0 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-7.1.3 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-7.1.2 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-7.1.1 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-7.1.0 lib/generators/paper_trail/templates/create_version_associations.rb.erb
paper_trail-7.0.3 lib/generators/paper_trail/templates/create_version_associations.rb.erb