From ce7fed699a70bc1f3f714d3c8e0fb4288ce98976 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Wed, 18 May 2011 16:09:52 +0200 Subject: [PATCH] actually, there's no problem, when both dates are the same this happens when testing the down and up migration --- db/migrate/20110513130147_remove_sprint_start_date.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/migrate/20110513130147_remove_sprint_start_date.rb b/db/migrate/20110513130147_remove_sprint_start_date.rb index 713220def4..faf4844364 100644 --- a/db/migrate/20110513130147_remove_sprint_start_date.rb +++ b/db/migrate/20110513130147_remove_sprint_start_date.rb @@ -8,7 +8,9 @@ class RemoveSprintStartDate < ActiveRecord::Migration Version.transaction do Version.all.each do |version| - if version.sprint_start_date.present? and version.start_date.present? + if version.sprint_start_date.present? and version.start_date.present? and + version.sprint_start_date != version.start_date + raise "Version #{version.id} has a start date and a sprint start date! Migrations were not executed in the correct order" elsif version.sprint_start_date.present? and version.start_date.blank?