aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate/8_add_primary_key_to_categorizations.rb
blob: efee289af09344960563317dcc26f9bdd1d2b3f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
class AddPrimaryKeyToCategorizations < ActiveRecord::Migration
  def self.up
    unless ::Categorization.column_names.include?("id")
      add_column :blog_categories_blog_posts, :id, :primary_key
    end
  end

  def self.down
    remove_column :blog_categories_blog_posts, :id
  end
end