From ec7b9c39bbef3db934f38827024f5d68408ea0f3 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 3 Jan 2014 16:51:46 -0800 Subject: [PATCH] remove migration for alias/impl fix, add logging --- ...748_add_last_comment_bumped_at_to_posts.rb | 5 ----- ..._update_aliased_implication_antecedents.rb | 21 ------------------- 2 files changed, 26 deletions(-) delete mode 100644 db/migrate/20131228230219_update_aliased_implication_antecedents.rb diff --git a/db/migrate/20131225002748_add_last_comment_bumped_at_to_posts.rb b/db/migrate/20131225002748_add_last_comment_bumped_at_to_posts.rb index f426c8499..2f76a4678 100644 --- a/db/migrate/20131225002748_add_last_comment_bumped_at_to_posts.rb +++ b/db/migrate/20131225002748_add_last_comment_bumped_at_to_posts.rb @@ -6,11 +6,6 @@ class AddLastCommentBumpedAtToPosts < ActiveRecord::Migration rename_index :posts, "index_posts_on_last_commented_at", "index_posts_on_last_comment_bumped_at" add_column :posts, :last_commented_at, :datetime - - # Post.joins(:comments).uniq.find_each do |post| - # post.update_column(:last_commented_at, post.comments.last.created_at) - # end - add_column :comments, :do_not_bump_post, :boolean, :null => false, :default => false end diff --git a/db/migrate/20131228230219_update_aliased_implication_antecedents.rb b/db/migrate/20131228230219_update_aliased_implication_antecedents.rb deleted file mode 100644 index 51b6c6404..000000000 --- a/db/migrate/20131228230219_update_aliased_implication_antecedents.rb +++ /dev/null @@ -1,21 +0,0 @@ -class UpdateAliasedImplicationAntecedents < ActiveRecord::Migration - def change - execute "set statement_timeout = 0" - TagImplication.find_each do |ti| - ta = TagAlias.where("antecedent_name = ? AND status != ?", ti.antecedent_name, "pending").first - if ta - existing_ti = TagImplication.where("antecedent_name = ? AND consequent_name = ?", ta.consequent_name, ti.consequent_name).first - existing_ti.destroy if existing_ti - - if ta.consequent_name == ti.consequent_name - ti.destroy - else - ti.antecedent_name = ta.consequent_name - ti.save - ti.update_posts - end - ta.update_posts - end - end - end -end