don't update timestamps in the migration

This commit is contained in:
MrZYX 2011-05-27 19:57:51 +02:00
parent 54f1effdf8
commit 787a5ae749

View file

@ -7,6 +7,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration
def self.up
add_column :posts, :status_message_guid, :string
ActiveRecord::Base.record_timestamps = false
photos = Post.where(Post.arel_table[:status_message_id].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
photos.each do |photo|
if Post.where(:id => photo.status_message_id).exists?
@ -25,6 +26,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration
def self.down
add_column :posts, :status_message_id, :integer
ActiveRecord::Base.record_timestamps = false
photos = Post.where(Post.arel_table[:status_message_guid].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
photos.each do |photo|
if Post.where(:guid => photo.status_message_guid).exists?