Commit e1a25db1 authored by Kevin Atkinson's avatar Kevin Atkinson

Database changes in preparation for multi-image loading support.

parent 468d13e0
...@@ -228,9 +228,11 @@ CREATE TABLE `comments` ( ...@@ -228,9 +228,11 @@ CREATE TABLE `comments` (
DROP TABLE IF EXISTS `current_reloads`; DROP TABLE IF EXISTS `current_reloads`;
CREATE TABLE `current_reloads` ( CREATE TABLE `current_reloads` (
`node_id` varchar(32) NOT NULL default '', `node_id` varchar(32) NOT NULL default '',
`idx` smallint(5) unsigned NOT NULL default '0',
`image_id` int(8) unsigned NOT NULL default '0', `image_id` int(8) unsigned NOT NULL default '0',
`mustwipe` tinyint(4) NOT NULL default '0', `mustwipe` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`node_id`) `prepare` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`node_id`,`idx`)
) TYPE=MyISAM; ) TYPE=MyISAM;
-- --
......
...@@ -228,9 +228,11 @@ CREATE TABLE `comments` ( ...@@ -228,9 +228,11 @@ CREATE TABLE `comments` (
DROP TABLE IF EXISTS `current_reloads`; DROP TABLE IF EXISTS `current_reloads`;
CREATE TABLE `current_reloads` ( CREATE TABLE `current_reloads` (
`node_id` varchar(32) NOT NULL default '', `node_id` varchar(32) NOT NULL default '',
`idx` smallint(5) unsigned NOT NULL default '0',
`image_id` int(8) unsigned NOT NULL default '0', `image_id` int(8) unsigned NOT NULL default '0',
`mustwipe` tinyint(4) NOT NULL default '0', `mustwipe` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`node_id`) `prepare` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`node_id`,`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
......
...@@ -524,6 +524,8 @@ REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBSETUP','ISUP','Boo ...@@ -524,6 +524,8 @@ REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBSETUP','ISUP','Boo
REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBSETUP','TBSETUP','LongSetup'); REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBSETUP','TBSETUP','LongSetup');
REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBSETUP','TBFAILED','BootFail'); REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBSETUP','TBFAILED','BootFail');
REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBFAILED','SHUTDOWN','RebootAfterFail'); REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBFAILED','SHUTDOWN','RebootAfterFail');
REPLACE INTO state_transitions VALUES ('RELOAD','RELOADSETUP','RELOADOLDMFS','');
REPLACE INTO state_transitions VALUES ('RELOAD','RELOADOLDMFS','SHUTDOWN','');
-- --
-- Dumping data for table `state_triggers` -- Dumping data for table `state_triggers`
...@@ -540,6 +542,7 @@ REPLACE INTO state_triggers VALUES ('*','MINIMAL','ISUP','RESET'); ...@@ -540,6 +542,7 @@ REPLACE INTO state_triggers VALUES ('*','MINIMAL','ISUP','RESET');
REPLACE INTO state_triggers VALUES ('*','RELOAD-MOTE','RELOADDONE','RELOADDONE'); REPLACE INTO state_triggers VALUES ('*','RELOAD-MOTE','RELOADDONE','RELOADDONE');
REPLACE INTO state_triggers VALUES ('*','OPSNODEBSD','ISUP','SCRIPT:opsreboot'); REPLACE INTO state_triggers VALUES ('*','OPSNODEBSD','ISUP','SCRIPT:opsreboot');
REPLACE INTO state_triggers VALUES ('*','NORMALv2','WEDGED','POWERCYCLE'); REPLACE INTO state_triggers VALUES ('*','NORMALv2','WEDGED','POWERCYCLE');
REPLACE INTO state_triggers VALUES ('*','RELOAD','RELOADOLDMFS','RELOADOLDMFS');
-- --
-- Dumping data for table `table_regex` -- Dumping data for table `table_regex`
......
#
# Add slot to the virt_nodes table.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("current_reloads", "idx")) {
DBQueryFatal
("alter table current_reloads ".
"add idx smallint(5) unsigned NOT NULL default '0' after node_id, ".
"drop primary key, add primary key (node_id,idx)");
}
if (!DBSlotExists("current_reloads", "prepare")) {
DBQueryFatal("alter table current_reloads add prepare ".
"tinyint(4) NOT NULL default '0'");
}
DBQueryFatal("replace into state_transitions VALUES ".
"('RELOAD', 'RELOADSETUP', 'RELOADOLDMFS', '')");
DBQueryFatal("replace into state_transitions VALUES ".
"('RELOAD', 'RELOADOLDMFS', 'SHUTDOWN', '')");
DBQueryFatal("replace into state_triggers values ".
"('*', 'RELOAD', 'RELOADOLDMFS', 'RELOADOLDMFS')");
return 0;
}
1;
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