From e43cd3a8da101d3bc173cce18942606f9f2ae532 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 11 Feb 2011 15:33:27 -0800 Subject: [PATCH] Make error in migration more descriptive --- db/migrate/20110211204804_unique_index_post_visibilities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20110211204804_unique_index_post_visibilities.rb b/db/migrate/20110211204804_unique_index_post_visibilities.rb index 70b7f2164..22b264438 100644 --- a/db/migrate/20110211204804_unique_index_post_visibilities.rb +++ b/db/migrate/20110211204804_unique_index_post_visibilities.rb @@ -23,7 +23,7 @@ class UniqueIndexPostVisibilities < ActiveRecord::Migration execute("DELETE FROM `post_visibilities` WHERE `post_visibilities`.id IN (#{undesired_ids.join(",")});") unless undesired_ids.empty? new_result = execute(sql) - raise "Not all violating visibilities deleted" unless new_result.to_a.empty? + raise "Not all violating visibilities deleted, try migrating again if this is the first occurence" unless new_result.to_a.empty? remove_index :post_visibilities, [:aspect_id, :post_id] add_index :post_visibilities, [:aspect_id, :post_id], :unique => true