From dedb250e2cc79e7b3225dc668d67a34cbd40a2b4 Mon Sep 17 00:00:00 2001
From: Alessandro Vullo <avullo@ebi.ac.uk>
Date: Tue, 14 May 2013 11:19:59 +0000
Subject: [PATCH] [ENSCORESW-461]. Changed logic for -oldest option.

---
 misc-scripts/schema_patcher.pl | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/misc-scripts/schema_patcher.pl b/misc-scripts/schema_patcher.pl
index 42716c338e..bca8ef8411 100755
--- a/misc-scripts/schema_patcher.pl
+++ b/misc-scripts/schema_patcher.pl
@@ -499,11 +499,13 @@ while ( $sth->fetch() ) {
     printf( "Considering '%s' [%s,%s,%d]\n",
             $database, defined($species) ? $species : 'unknown',
             $schema_type, $schema_version );
-    $opt_oldest = ($schema_version == $latest_release) ? $latest_release : $latest_release - 1;
+    if ($opt_fixlast) {
+      $opt_oldest = ($schema_version == $latest_release) ? $latest_release : $latest_release - 1;
+
+      next "Cannot use --fixlast with a schema release too far from the latest release; oldest allowed is $opt_oldest. Skipping $database" if $schema_version < ($opt_oldest);
+      printf("--fixlast is active. Will apply patches for version %d and up (if available)\n", $opt_oldest);
+    }
 
-    next "Cannot use --fixlast with a schema release too far from the latest release; oldest allowed is $opt_oldest. Skipping $database" 
-      if $schema_version < ($opt_oldest);
-    printf("--fixlast is active. Will apply patches for version %d and up (if available)\n", $opt_oldest);
   }
   else { 
     if($opt_verbose) {
-- 
GitLab