From b84da3dbb7e7524df02cd25a47b6390acbe70502 Mon Sep 17 00:00:00 2001
From: Leigh B Stoller <stoller@flux.utah.edu>
Date: Thu, 14 Aug 2014 13:10:15 -0600
Subject: [PATCH] Fix to image version support.

---
 sql/database-create.sql | 6 +++---
 sql/updates/4/398       | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sql/database-create.sql b/sql/database-create.sql
index b68e025c29..73eaf3ae5e 100644
--- a/sql/database-create.sql
+++ b/sql/database-create.sql
@@ -2949,13 +2949,13 @@ CREATE TABLE `nodes` (
   `role` enum('testnode','virtnode','ctrlnode','testswitch','ctrlswitch','powerctrl','widearea_switch','unused') NOT NULL default 'unused',
   `inception` datetime default NULL,
   `def_boot_osid` int(8) unsigned default NULL,
-  `def_boot_osid_vers` int(8) unsigned default NULL,
+  `def_boot_osid_vers` int(8) unsigned default '0',
   `def_boot_path` text,
   `def_boot_cmd_line` text,
   `temp_boot_osid` int(8) unsigned default NULL,
-  `temp_boot_osid_vers` int(8) unsigned default NULL,
+  `temp_boot_osid_vers` int(8) unsigned default '0',
   `next_boot_osid` int(8) unsigned default NULL,
-  `next_boot_osid_vers` int(8) unsigned default NULL,
+  `next_boot_osid_vers` int(8) unsigned default '0',
   `next_boot_path` text,
   `next_boot_cmd_line` text,
   `pxe_boot_path` text,
diff --git a/sql/updates/4/398 b/sql/updates/4/398
index d6bad94635..63b8dbda6f 100644
--- a/sql/updates/4/398
+++ b/sql/updates/4/398
@@ -67,6 +67,7 @@ sub DoUpdate($$$)
 	DBQueryFatal("replace into emulab_indicies ".
 		     "select 'next_profile',max(profileid)+1 ".
 		     " from apt_profiles");
+	DBQueryFatal("drop table apt_profiles_old");
     }
     return 0;
 }
-- 
GitLab