444 1.11 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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#
# APT Stuff.
#
use strict;
use libdb;

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

    if (!DBSlotExists("apt_instances", "physnode_count")) {
	DBQueryFatal("alter table apt_instances add ".
		     " `physnode_count` smallint(5) unsigned ".
		     "      NOT NULL default '0' ".
		     "   after extension_days");
    }
    if (!DBSlotExists("apt_instances", "virtnode_count")) {
	DBQueryFatal("alter table apt_instances add ".
		     " `virtnode_count` smallint(5) unsigned ".
		     "      NOT NULL default '0' ".
		     "   after physnode_count");
    }
    if (!DBSlotExists("apt_instance_history", "physnode_count")) {
	DBQueryFatal("alter table apt_instance_history add ".
		     " `physnode_count` smallint(5) unsigned ".
		     "      NOT NULL default '0' ".
		     "   after extension_days");
    }
    if (!DBSlotExists("apt_instance_history", "virtnode_count")) {
	DBQueryFatal("alter table apt_instance_history add ".
		     " `virtnode_count` smallint(5) unsigned ".
		     "      NOT NULL default '0' ".
		     "   after physnode_count");
    }
    return 0;
}
1;

# Local Variables:
# mode:perl
# End: