461 1.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
# Image import and IMS stuff.
#
use strict;
use libdb;

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

    if (!DBSlotExists("image_versions", "origin_urn")) {
	DBQueryFatal("alter table image_versions add ".
		     " `origin_urn` varchar(128) default NULL ".
		     "   after imagefile_url");
    }
16
17
18
19
20
    if (!DBSlotExists("image_versions", "origin_name")) {
	DBQueryFatal("alter table image_versions add ".
		     " `origin_name` varchar(128) default NULL ".
		     "   after origin_urn");
    }
21
22
23
    if (!DBSlotExists("image_versions", "origin_uuid")) {
	DBQueryFatal("alter table image_versions add ".
		     " `origin_uuid` varchar(64) default NULL ".
24
		     "   after origin_name");
25
26
27
28
29
30
    }
    if (!DBSlotExists("image_versions", "origin_neednotify")) {
	DBQueryFatal("alter table image_versions add ".
		     " `origin_neednotify` tinyint(1) NOT NULL default '0' ".
		     "   after origin_uuid");
    }
31
32
33
34
35
    if (!DBSlotExists("image_versions", "origin_needupdate")) {
	DBQueryFatal("alter table image_versions add ".
		     " `origin_needupdate` tinyint(1) NOT NULL default '0' ".
		     "   after origin_neednotify");
    }
36
37
38
39
40
41
42
43
44
45

    my $var = "protogeni/use_imagetracker";
    if (!TBSiteVarExists($var)) {
	my $desc   = "Enable use of the image tracker.";
	my $defval = "0";

	DBQueryFatal("INSERT INTO sitevariables VALUES ".
                     "('$var',NULL,'$defval','$desc',0)");
    }
    
46
47
48
49
50
51
52
    return 0;
}
1;

# Local Variables:
# mode:perl
# End: