Commit ec168c1e authored by Leigh Stoller's avatar Leigh Stoller

DB changes for image aliases and architectures. This will probably

change as I get further into it.
parent 767c90c9
......@@ -2176,6 +2176,26 @@ CREATE TABLE `ifaces` (
KEY `lanid` (`lanid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `image_aliases`
--
DROP TABLE IF EXISTS `image_aliases`;
CREATE TABLE `image_aliases` (
`imagename` varchar(30) NOT NULL default '',
`imageid` int(8) unsigned NOT NULL default '0',
`pid` varchar(48) NOT NULL default '',
`pid_idx` mediumint(8) unsigned NOT NULL default '0',
`gid` varchar(32) NOT NULL default '',
`gid_idx` mediumint(8) unsigned NOT NULL default '0',
`uuid` varchar(40) NOT NULL default '',
`target_imagename` varchar(30) NOT NULL default '',
`target_imageid` int(8) unsigned NOT NULL default '0',
PRIMARY KEY (`imageid`),
UNIQUE KEY `pid` (`pid`,`imagename`),
KEY `uuid` (`uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `image_boot_status`
--
......@@ -2373,6 +2393,7 @@ CREATE TABLE `image_updates` (
DROP TABLE IF EXISTS `images`;
CREATE TABLE `images` (
`imagename` varchar(30) NOT NULL default '',
`architecture` varchar(30) default NULL,
`version` int(8) unsigned NOT NULL default '0',
`imageid` int(8) unsigned NOT NULL default '0',
`pid` varchar(48) NOT NULL default '',
......@@ -3230,6 +3251,7 @@ DROP TABLE IF EXISTS `node_types`;
CREATE TABLE `node_types` (
`class` varchar(30) default NULL,
`type` varchar(30) NOT NULL default '',
`architecture` varchar(30) default NULL,
`modelnetcore_osid` varchar(35) default NULL,
`modelnetedge_osid` varchar(35) default NULL,
`isvirtnode` tinyint(4) NOT NULL default '0',
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("node_types", "architecture")) {
DBQueryFatal("alter table node_types add ".
" `architecture` varchar(30) default NULL ".
" after `type`");
}
if (!DBSlotExists("images", "architecture")) {
DBQueryFatal("alter table images add ".
" `architecture` varchar(30) default NULL ".
" after `imagename`");
}
if (!DBTableExists("image_aliases")) {
DBQueryFatal("CREATE TABLE `image_aliases` ( ".
" `imagename` varchar(30) NOT NULL default '', ".
" `imageid` int(8) unsigned NOT NULL default '0', ".
" `pid` varchar(48) NOT NULL default '', ".
" `pid_idx` mediumint(8) unsigned NOT NULL default '0', ".
" `gid` varchar(32) NOT NULL default '', ".
" `gid_idx` mediumint(8) unsigned NOT NULL default '0', ".
" `uuid` varchar(40) NOT NULL default '', ".
" `target_imagename` varchar(30) NOT NULL default '', ".
" `target_imageid` int(8) unsigned NOT NULL default '0',".
" PRIMARY KEY (`imageid`), ".
" UNIQUE KEY `pid` (`pid`,`imagename`), ".
" KEY `uuid` (`uuid`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
# Need to fix up deleted images architecture.
# Fix up "generic" OSinfo objects; the version string should be unset.
DBQueryFatal("update os_info_versions set version='' ".
"where nextosid is not null and version!=''");
return 0;
}
# Local Variables:
# mode:perl
# End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment