593 601 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
use strict;
use libdb;
use emdb;

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

    if (!DBSlotExists("future_reservations", "uuid")) {
	DBQueryFatal("alter table future_reservations add ".
		     "  `uuid` varchar(40) NOT NULL default ''");
    }
    my $query_result =
	DBQueryFatal("select idx from future_reservations ".
		     "where uuid=''");
    while (my ($idx) = $query_result->fetchrow_array()) {
	DBQueryFatal("update future_reservations set ".
		     "  uuid=uuid() ".
		     "where idx='$idx'");
	sleep(1);
    }
    return 0;
}

# Local Variables:
# mode:perl
# End: