Commit 1f2f10cb authored by Leigh Stoller's avatar Leigh Stoller

Changes for handling image relocations from remote clusters back

to the Mothership.
parent 93c4fcc2
......@@ -135,6 +135,7 @@ CREATE TABLE `apt_aggregates` (
`disabled` tinyint(1) NOT NULL default '0',
`noupdate` tinyint(1) NOT NULL default '0',
`nomonitor` tinyint(1) NOT NULL default '0',
`nolocalimages` tinyint(1) NOT NULL default '0',
`deferrable` tinyint(1) NOT NULL default '0',
`updated` datetime NOT NULL default '0000-00-00 00:00:00',
`weburl` tinytext,
......@@ -2579,6 +2580,28 @@ CREATE TABLE `image_history` (
KEY `imagestamp` (`imageid`,`stamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `image_incoming_relocations`
--
DROP TABLE IF EXISTS `image_incoming_relocations`;
CREATE TABLE `image_incoming_relocations` (
`imagename` varchar(30) NOT NULL default '',
`uid` varchar(8) NOT NULL DEFAULT '',
`uid_idx` mediumint(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',
`remote_urn` varchar(128) default NULL,
`metadata_url` int(8) unsigned NOT NULL default '0',
`created` varchar(8) default NULL,
`locked` datetime default NULL,
PRIMARY KEY (`pid_idx`,`imagename`),
UNIQUE KEY `remote_urn` (`remote_urn`),
UNIQUE KEY `metadata_url` (`metadata_url`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `image_notifications`
--
......@@ -2674,7 +2697,7 @@ CREATE TABLE `image_versions` (
`origin_neednotify` tinyint(1) NOT NULL default '0',
`origin_needupdate` tinyint(1) NOT NULL default '0',
`authority_urn` varchar(128) default NULL,
`credential_string` text,
`credential_string_save` text,
`logfileid` varchar(40) default NULL,
`noexport` tinyint(1) NOT NULL default '0',
`noclone` tinyint(1) NOT NULL default '0',
......@@ -2733,6 +2756,8 @@ CREATE TABLE `images` (
`nodelta` tinyint(1) NOT NULL default '0',
`noversioning` tinyint(1) NOT NULL default '0',
`metadata_url` tinytext,
`relocate_urn` tinytext,
`credential_string` text,
`locked` datetime default NULL,
`locker_pid` int(11) default '0',
PRIMARY KEY (`imageid`),
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_aggregates", "nolocalimages")) {
DBQueryFatal("alter table apt_aggregates add ".
" `nolocalimages` tinyint(1) NOT NULL default '0' ".
" after nomonitor");
}
if (!DBSlotExists("images", "relocate_urn")) {
DBQueryFatal("alter table images add " .
" `relocate_urn` tinytext after `metadata_url`");
}
if (!DBSlotExists("images", "credential_string")) {
DBQueryFatal("alter table images add " .
" `credential_string` text after `relocate_urn`");
}
if (!DBSlotExists("image_versions", "credential_string_save")) {
DBQueryFatal("alter table image_versions change `credential_string` " .
" `credential_string_save` text");
}
if (!DBTableExists("image_incoming_relocations")) {
DBQueryFatal("CREATE TABLE `image_incoming_relocations` ( ".
" `imagename` varchar(30) NOT NULL default '', ".
" `uid` varchar(8) NOT NULL DEFAULT '', ".
" `uid_idx` mediumint(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', ".
" `remote_urn` varchar(128) default NULL, ".
" `metadata_url` int(8) unsigned NOT NULL default '0', ".
" `created` varchar(8) default NULL, ".
" `locked` datetime default NULL, ".
" PRIMARY KEY (`pid_idx`,`imagename`), ".
" UNIQUE KEY `remote_urn` (`remote_urn`), ".
" UNIQUE KEY `metadata_url` (`metadata_url`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
return 0;
}
1;
# 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