448 806 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 30 31 32
#
# Add slots to allow the existence of both full and delta image files
# for an image version.
#
use strict;
use libdb;

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

    if (!DBSlotExists("image_versions", "deltahash")) {
	DBQueryFatal("ALTER TABLE image_versions ADD ".
		     " `deltahash` varchar(64) default NULL ".
		     "   AFTER hash");
    }
    if (!DBSlotExists("image_versions", "deltasize")) {
	DBQueryFatal("ALTER TABLE image_versions ADD ".
		     " `deltasize` bigint unsigned NOT NULL default '0' ".
		     "   AFTER size");
    }
    if (!DBSlotExists("image_versions", "uploader_path")) {
	DBQueryFatal("ALTER TABLE image_versions ADD ".
		     " `uploader_path` tinytext ".
		     "   AFTER nodetypes");
    }
    return 0;
}

# Local Variables:
# mode:perl
# End: