393 1.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#
# Add the relocatable flag to indicate whether the lba_low field must
# be respected (0) or whether the image is "position independent" (1).
#
use strict;
use libdb;

sub DoUpdate($$$)
{
    my ($dbhandle, $dbname, $version) = @_;

    if (!DBSlotExists("apt_profiles", "locked")) {
	DBQueryFatal("ALTER TABLE apt_profiles ADD ".
		     " `locked` datetime default NULL ".
		     "   AFTER listed");
    }
    if (!DBSlotExists("apt_profiles", "status")) {
	DBQueryFatal("ALTER TABLE apt_profiles ADD ".
		     " `status` varchar(32) default NULL ".
		     "   AFTER locked");
    }
    if (!DBTableExists("web_sessions")) {
	DBQueryFatal("CREATE TABLE `web_sessions` ( ".
Leigh B Stoller's avatar
Leigh B Stoller committed
24
		     " `session_id` varchar(128) NOT NULL default '', ".
25 26 27 28 29 30 31 32
		     " `session_expires` datetime NOT NULL ".
		     "          default '0000-00-00 00:00:00', ".
		     " `session_data` text, ".
		     " PRIMARY KEY  (`session_id`) ".
		     ") ENGINE=MyISAM DEFAULT CHARSET=latin1");
    }
    if (!DBTableExists("web_tasks")) {
	DBQueryFatal("CREATE TABLE `web_tasks` ( ".
Leigh B Stoller's avatar
Leigh B Stoller committed
33
		     " `task_id` varchar(128) NOT NULL default '', ".
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
		     " `created` datetime NOT NULL ".
		     "             default '0000-00-00 00:00:00', ".
		     " `modified` datetime NOT NULL ".
		     "             default '0000-00-00 00:00:00', ".
		     " `exited` datetime default NULL, ".
		     " `process_id` int(11) default '0', ".
		     " `object_uuid` varchar(40) NOT NULL default '', ".
		     " `exitcode` tinyint(3) default '0', ".
		     " `task_data` text, ".
		     " PRIMARY KEY  (`task_id`), ".
		     " KEY `object_uuid` (`object_uuid`) ".
		     ") ENGINE=MyISAM DEFAULT CHARSET=latin1");
    }
    return 0;
}

# Local Variables:
# mode:perl
# End: