refinerycms-blog/db/migrate/20110803223529_add_primary_key_to_categorizations.rb
Jamie Winsor 21b19db5a3 refactor engine testing scenario
Engine is now tested standalone by leveraging a dummy rails app
Enable Guard for speedy testing
Move factories to the more standard location `spec/factories/*`
Update README with a Testing section
Rename migrations to contain datetimestamps for their version to fix migration order issues when migrating the dummy application
2011-08-03 18:01:32 -07:00

14 lines
374 B
Ruby

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