Permalink
Browse files

Only need to add image_id when it doesn't already exist, some people …

…have it already.
  • Loading branch information...
1 parent 272085a commit ce32ef3cabb49d4bf02ae042ee35f8084d842c20 @parndt parndt committed Apr 6, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 db/migrate/4_add_image_id_to_news_items.rb
@@ -1,7 +1,9 @@
class AddImageIdToNewsItems < ActiveRecord::Migration
def self.up
- add_column ::NewsItem.table_name, :image_id, :integer
+ unless ::NewsItem.column_names.map(&:to_sym).include?(:image_id)
+ add_column ::NewsItem.table_name, :image_id, :integer
+ end
end
def self.down

0 comments on commit ce32ef3

Please sign in to comment.