Commit 7e7631b1 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

DB changes to support multiple prereservations per project.

parent a335a217
......@@ -3025,6 +3025,19 @@ CREATE TABLE `node_licensekeys` (
PRIMARY KEY (`node_id`,`keytype`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `node_reservations`
--
DROP TABLE IF EXISTS `node_reservations`;
CREATE TABLE `node_reservations` (
`node_id` varchar(32) NOT NULL default '',
`pid` varchar(48) NOT NULL default '',
`pid_idx` mediumint(8) unsigned NOT NULL default '0',
`reservation_name` varchar(48) NOT NULL default 'default',
PRIMARY KEY (`node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `node_rusage`
--
......@@ -3234,6 +3247,7 @@ CREATE TABLE `nodes` (
`destination_y` float default NULL,
`destination_orientation` float default NULL,
`reserved_pid` varchar(48) default NULL,
`reservation_name` varchar(48) default NULL,
`uuid` varchar(40) NOT NULL default '',
`reserved_memory` int(10) unsigned default '0',
`nonfsmounts` tinyint(1) NOT NULL default '0',
......@@ -3985,6 +3999,7 @@ DROP TABLE IF EXISTS `project_reservations`;
CREATE TABLE `project_reservations` (
`pid` varchar(48) NOT NULL default '',
`pid_idx` mediumint(8) unsigned NOT NULL default '0',
`name` varchar(48) NOT NULL default 'default',
`priority` smallint(5) NOT NULL default '0',
`count` smallint(5) NOT NULL default '0',
`types` varchar(128) default NULL,
......@@ -3994,19 +4009,8 @@ CREATE TABLE `project_reservations` (
`start` datetime default NULL,
`end` datetime default NULL,
`active` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`pid_idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `node_reservations`
--
DROP TABLE IF EXISTS `node_reservations`;
CREATE TABLE `node_reservations` (
`node_id` varchar(32) NOT NULL default '',
`pid` varchar(48) NOT NULL default '',
`pid_idx` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`node_id`)
`terminal` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`pid_idx`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("project_reservations", "name")) {
DBQueryFatal("alter table project_reservations add ".
" `name` varchar(48) NOT NULL default 'default' ".
"after pid_idx");
DBQueryFatal("alter table project_reservations drop primary key");
DBQueryFatal("alter table project_reservations add primary key ".
" (`pid_idx`,`name`)");
}
if (!DBSlotExists("project_reservations", "terminal")) {
DBQueryFatal("alter table project_reservations add ".
" `terminal` tinyint(1) NOT NULL default '0' ".
"after active");
}
if (!DBSlotExists("node_reservations", "reservation_name")) {
DBQueryFatal("alter table node_reservations add ".
" `reservation_name` varchar(48) NOT NULL ".
" default 'default' ".
"after pid_idx");
}
if (!DBSlotExists("nodes", "reservation_name")) {
DBQueryFatal("alter table nodes add ".
" `reservation_name` varchar(48) default NULL ".
"after reserved_pid");
}
return 0;
}
# Local Variables:
# mode:perl
# End:
Supports Markdown
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