cirandas.net

ref: master

db/migrate/021_add_articles_categories.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
class AddArticlesCategories < ActiveRecord::Migration
  def self.up
    create_table :articles_categories, :id => false do |t|
      t.column :article_id, :integer
      t.column :category_id, :integer
    end
    add_index(:articles_categories, :article_id)
    add_index(:articles_categories, :category_id)
  end

  def self.down
    drop_table :articles_categories
  end
end