Sha256: 12cc196aa7d40c11f52e8afbc7e039bef69ba26a35b014296673f1767142ae69

Contents?: true

Size: 804 Bytes

Versions: 2

Compression:

Stored size: 804 Bytes

Contents

# This migration and AddTransactionIdColumnToVersions provide the necessary
# schema for tracking associations.
class CreateVersionAssociations < ActiveRecord::Migration[7.0]
  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
      t.string   :foreign_type
    end
    add_index :version_associations, [:version_id]
    add_index :version_associations,
      %i(foreign_key_name foreign_key_id foreign_type),
      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

2 entries across 2 versions & 1 rubygems

Version Path
trusty-cms-7.0.8 db/migrate/20250103191133_create_version_associations.rb
trusty-cms-7.0.7 db/migrate/20250103191133_create_version_associations.rb