652 760 Bytes
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 24 25 26 27 28 29
use strict;
use libdb;

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

    DBQueryFatal("ALTER TABLE apt_aggregate_status change `status` " .
		 " `status` enum('up','down','offline','unknown') ".
		 "    NOT NULL default 'unknown'");

    if (!DBTableExists("apt_aggregate_events")) {
	DBQueryFatal("CREATE TABLE `apt_aggregate_events` ( ".
		     " `urn` varchar(128) NOT NULL default '', ".
		     " `event` enum('up','down','offline','unknown') ".
		     "         NOT NULL default 'unknown', ".
		     " `stamp` datetime NOT NULL ".
		     "      default '0000-00-00 00:00:00', ".
		     " PRIMARY KEY  (`urn`,`stamp`) ".
		     ") ENGINE=MyISAM DEFAULT CHARSET=latin1");
    }
    return 0;
}

1;

# Local Variables:
# mode:perl
# End: