Skip to content
Extraits de code Groupes Projets
Valider 787a5ae7 rédigé par MrZYX's avatar MrZYX
Parcourir les fichiers

don't update timestamps in the migration

parent 54f1effd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -7,6 +7,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration ...@@ -7,6 +7,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration
def self.up def self.up
add_column :posts, :status_message_guid, :string 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 = Post.where(Post.arel_table[:status_message_id].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
photos.each do |photo| photos.each do |photo|
if Post.where(:id => photo.status_message_id).exists? if Post.where(:id => photo.status_message_id).exists?
...@@ -25,6 +26,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration ...@@ -25,6 +26,7 @@ class PhotoStatusMessageAssociationOnGuid < ActiveRecord::Migration
def self.down def self.down
add_column :posts, :status_message_id, :integer 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 = Post.where(Post.arel_table[:status_message_guid].not_eq(nil).and(Post.arel_table[:type].eq('Photo')))
photos.each do |photo| photos.each do |photo|
if Post.where(:guid => photo.status_message_guid).exists? if Post.where(:guid => photo.status_message_guid).exists?
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter