Image Asset tests, upgrade package, and code.

RSS Limiter tests, upgrade package, and code.
This commit is contained in:
Brian Medley 2009-03-23 21:11:10 +00:00
commit 4c408da55a
10 changed files with 856 additions and 13 deletions

Binary file not shown.

View file

@ -31,10 +31,15 @@ my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
addWelcomeMessageTemplateToSettings( $session );
addStatisticsCacheTimeoutToMatrix( $session );
# image mods
addImageAnnotation($session);
# rss mods
addRssLimit($session);
finish($session); # this line required
sub addWelcomeMessageTemplateToSettings {
@ -45,6 +50,28 @@ sub addWelcomeMessageTemplateToSettings {
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addRssLimit {
my $session = shift;
print "\tAdding rssLimit to RSSCapable table, if needed... \n" unless $quiet;
my $sth = $session->db->read('describe RSSCapable rssCableRssLimit');
if (! defined $sth->hashRef) {
$session->db->write("alter table RSSCapable add column rssCableRssLimit integer");
}
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addImageAnnotation {
my $session = shift;
print "\tAdding annotations to imageAsset table, if needed... \n" unless $quiet;
my $sth = $session->db->read('describe imageAsset annotations');
if (! defined $sth->hashRef) {
$session->db->write("alter table imageAsset add column annotations mediumtext");
}
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addStatisticsCacheTimeoutToMatrix{
my $session = shift;