Commit 2e54dec9 authored by Kirk Webb's avatar Kirk Webb

Modify schema to account for implicit default values (make explicit).

Fix for a quibble from schemacheck.
parent e7d969db
......@@ -144,7 +144,7 @@ CREATE TABLE `blockstore_state` (
`node_id` varchar(32) NOT NULL default '',
`bs_id` varchar(32) NOT NULL default '',
`remaining_capacity` int(10) unsigned NOT NULL default '0',
`ready` tinyint(4) unsigned,
`ready` tinyint(4) unsigned NOT NULL default '0',
PRIMARY KEY (`bsidx`),
UNIQUE KEY nidbid (`node_id`,`bs_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......@@ -4361,7 +4361,7 @@ CREATE TABLE `virt_blockstores` (
`exptidx` int(11) NOT NULL default '0',
`vname` varchar(32) NOT NULL default '',
`type` varchar(30) default NULL,
`role` enum ('remote','local'),
`role` enum('remote','local','unknown') NOT NULL default 'unknown',
`size` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`exptidx`,`vname`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
......@@ -1217,7 +1217,7 @@ REPLACE INTO table_regex VALUES ('virt_blockstores','pid','text','redirect','pro
REPLACE INTO table_regex VALUES ('virt_blockstores','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','vname','text','regex','^[-\\w]+$',1,32,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','type','text','regex','^[-\\w]*$',0,30,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','role','text','regex','^(remote|local)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','role','text','regex','^(remote|local|unknown)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','size','int','redirect','default:int',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstore_attributes','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstore_attributes','eid','text','redirect','experiments:eid',0,0,NULL);
......
......@@ -38,7 +38,7 @@ sub DoUpdate($$$)
" `node_id` varchar(32) NOT NULL default '',".
" `bs_id` varchar(32) NOT NULL default '',".
" `remaining_capacity` int(10) unsigned NOT NULL default '0',".
" `ready` tinyint(4) unsigned,".
" `ready` tinyint(4) unsigned NOT NULL default '0',".
" PRIMARY KEY (`bsidx`),".
" UNIQUE KEY nidbid (`node_id`,`bs_id`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
......@@ -51,7 +51,7 @@ sub DoUpdate($$$)
" `exptidx` int(11) NOT NULL default '0',".
" `vname` varchar(32) NOT NULL default '',".
" `type` varchar(30) default NULL,".
" `role` enum ('remote','local'),".
" `role` enum('remote','local','unknown') NOT NULL default 'unknown',".
" `size` int(10) unsigned NOT NULL default '0',".
" PRIMARY KEY (`exptidx`,`vname`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
......@@ -100,7 +100,7 @@ sub DoUpdate($$$)
"'^[-\\\\w]*\$',0,30,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','role','text','regex',".
"'^(remote|local)\$',0,0,NULL)");
"'^(remote|local|unknown)\$',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','size','int','redirect',".
"'default:int',0,0,NULL)");
......
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