matrix upgrade and privileging fixes
This commit is contained in:
parent
cc1c1d165a
commit
03dce77e90
7 changed files with 133 additions and 11 deletions
|
|
@ -254,7 +254,7 @@ sub upgradeMatrix {
|
|||
my $session = shift;
|
||||
print "\tUpgrading matrix assets... \n" unless $quiet;
|
||||
my $db = $session->db;
|
||||
$db->write("alter table Matrix drop column groupToRate, drop column groupToAdd, drop column privilegedGroup,
|
||||
$db->write("alter table Matrix drop column groupToRate, drop column privilegedGroup,
|
||||
drop column ratingTimeout, drop column ratingTimeoutPrivileged, drop column ratingDetailTemplateId,
|
||||
drop column visitorCacheTimeout");
|
||||
$db->write("alter table Matrix add column defaultSort char(22) not null default 'score',
|
||||
|
|
@ -337,6 +337,7 @@ sub upgradeMatrix {
|
|||
$listing->{title} = $listing->{productName};
|
||||
$listing->{version} = $listing->{versionNumber};
|
||||
$listing->{screenshots} = $listing->{storageId};
|
||||
$listing->{ownerUserId} = $listing->{maintainerId};
|
||||
$listing->{productURL} = $listing->{productUrl};
|
||||
$listing->{manufacturerURL} = $listing->{manufacturerUrl};
|
||||
my $newMatrixListing = $matrix->addChild($listing,undef,undef,{skipAutoCommitWorkflows=>1});
|
||||
|
|
|
|||
|
|
@ -32,8 +32,20 @@ my $session = start(); # this line required
|
|||
|
||||
# upgrade functions go here
|
||||
|
||||
addGroupToAddToMatrix( $session );
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub addGroupToAddToMatrix {
|
||||
my $session = shift;
|
||||
print "\tAdding groupToAdd to Matrix table, if needed... \n" unless $quiet;
|
||||
my $sth = $session->db->read('describe Matrix groupToAdd');
|
||||
if (! defined $sth->hashRef) {
|
||||
$session->db->write("alter table Matrix add column groupToAdd char(22) default 2");
|
||||
}
|
||||
print "Done.\n" unless $quiet;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ sub upgradeMatrix {
|
|||
my $session = shift;
|
||||
print "\tUpgrading matrix assets... \n" unless $quiet;
|
||||
my $db = $session->db;
|
||||
$db->write("alter table Matrix drop column groupToRate, drop column groupToAdd, drop column privilegedGroup,
|
||||
$db->write("alter table Matrix drop column groupToRate, drop column privilegedGroup,
|
||||
drop column ratingTimeout, drop column ratingTimeoutPrivileged, drop column ratingDetailTemplateId,
|
||||
drop column visitorCacheTimeout");
|
||||
$db->write("alter table Matrix add column defaultSort char(22) not null default 'score',
|
||||
|
|
@ -144,6 +144,7 @@ sub upgradeMatrix {
|
|||
$listing->{title} = $listing->{productName};
|
||||
$listing->{version} = $listing->{versionNumber};
|
||||
$listing->{screenshots} = $listing->{storageId};
|
||||
$listing->{ownerUserId} = $listing->{maintainerId};
|
||||
$listing->{productURL} = $listing->{productUrl};
|
||||
$listing->{manufacturerURL} = $listing->{manufacturerUrl};
|
||||
my $newMatrixListing = $matrix->addChild($listing,undef,undef,{skipAutoCommitWorkflows=>1});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue