Sha256: 32fc3c210542be74384adf8728286e589457ed14e83dece7e8e1d300bc24a324

Contents?: true

Size: 375 Bytes

Versions: 3

Compression:

Stored size: 375 Bytes

Contents

class PolymorphizeSections < ActiveRecord::Migration
  def change
    remove_column :knowledge_base_sections, :article_id, :integer

    change_table :knowledge_base_sections do |t|
      t.references :container, polymorphic: true
    end

    add_index :knowledge_base_sections, [:container_id, :container_type], name: "index_knowledge_base_sections_on_container"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
knowledge_base-0.2.0 db/migrate/20140306162143_polymorphize_sections.rb
knowledge_base-0.1.0 db/migrate/20140306162143_polymorphize_sections.rb
knowledge_base-0.0.3 db/migrate/20140306162143_polymorphize_sections.rb