Commit 84e63b54 authored by Leigh Stoller's avatar Leigh Stoller

Add "failed" state to apt_datasets and slot to store error message

for user.
parent ca2aa5ad
......@@ -155,7 +155,7 @@ CREATE TABLE `apt_datasets` (
`updated` datetime default NULL,
`expires` datetime default NULL,
`last_used` datetime default NULL,
`state` enum('new','valid','unapproved','grace','locked','expired','busy') NOT NULL default 'new',
`state` enum('new','valid','unapproved','grace','locked','expired','busy','failed') NOT NULL default 'new',
`type` enum('stdataset','ltdataset','imdataset','unknown') NOT NULL default 'unknown',
`fstype` varchar(40) NOT NULL default 'none',
`size` int(10) unsigned NOT NULL default '0',
......@@ -166,6 +166,7 @@ CREATE TABLE `apt_datasets` (
`locked` datetime default NULL,
`locker_pid` int(11) default '0',
`webtask_id` varchar(128) default NULL,
`error` text,
`credential_string` text,
PRIMARY KEY (`idx`),
UNIQUE KEY `plid` (`pid_idx`,`dataset_id`),
use strict;
use libdb;
sub DoUpdate($$$)
my ($dbhandle, $dbname, $version) = @_;
my $type = DBSlotType("apt_datasets", "state");
if (!$type) {
Fatal("Could not get type for 'state' in 'apt_datasets'");
if (! ($type =~ /failed/)) {
DBQueryFatal("alter table apt_datasets modify `state` ".
" enum('new','valid','unapproved','grace','locked',".
" 'expired','busy','failed') ".
" NOT NULL default 'new'");
if (!DBSlotExists("apt_datasets", "error")) {
DBQueryFatal("alter table apt_datasets add ".
" `error` text after `webtask_id`");
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