Sha256: e32bf302cb0e039db9b69049f3689b7555cfc1cd3c7d2480a0ee29e98d80c661

Contents?: true

Size: 374 Bytes

Versions: 6

Compression:

Stored size: 374 Bytes

Contents

class AddPrimaryKeyToCategorizations < ActiveRecord::Migration
  def up
    unless Refinery::Categorization.column_names.include?("id")
      add_column Refinery::Categorization.table_name, :id, :primary_key
    end
  end

  def down
    if Refinery::Categorization.column_names.include?("id")
      remove_column Refinery::Categorization.table_name, :id
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
refinerycms-blog-2.0.5 db/migrate/20110803223529_add_primary_key_to_categorizations.rb
refinerycms-blog-2.0.4 db/migrate/20110803223529_add_primary_key_to_categorizations.rb
refinerycms-blog-2.0.3 db/migrate/20110803223529_add_primary_key_to_categorizations.rb
refinerycms-blog-2.0.2 db/migrate/20110803223529_add_primary_key_to_categorizations.rb
refinerycms-blog-2.0.1 db/migrate/20110803223529_add_primary_key_to_categorizations.rb
refinerycms-blog-2.0.0 db/migrate/20110803223529_add_primary_key_to_categorizations.rb