Sha256: 8357fc38d4e76b35567b7b770ab6093de3c0245239262cf34c156a51eb0fc766

Contents?: true

Size: 627 Bytes

Versions: 3

Compression:

Stored size: 627 Bytes

Contents

class CreateKnowledgeBaseCategoryArticleAssociations < ActiveRecord::Migration
  def change
    create_table :knowledge_base_category_article_associations do |t|
      t.references :category
      t.references :article
      t.integer :position

      t.timestamps
    end

    add_index :knowledge_base_category_article_associations, [:category_id], name: 'index_knowledge_base_c_a_association_on_category_id'
    add_index :knowledge_base_category_article_associations, [:article_id], name: 'index_knowledge_base_c_a_association_on_article_id'

    remove_column :knowledge_base_articles, :category_id, :references
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
knowledge_base-0.2.0 db/migrate/20140307080616_create_knowledge_base_category_article_associations.rb
knowledge_base-0.1.0 db/migrate/20140307080616_create_knowledge_base_category_article_associations.rb
knowledge_base-0.0.3 db/migrate/20140307080616_create_knowledge_base_category_article_associations.rb