[Rt-commit] rt branch, 4.4/index-upgrade-scripts-return-true, created. rt-4.4.0-26-gcda2ec7

Jim Brandt jbrandt at bestpractical.com
Fri Feb 12 15:42:18 EST 2016


The branch, 4.4/index-upgrade-scripts-return-true has been created
        at  cda2ec742e7cf7886bfba2c3d13a905a529754b3 (commit)

- Log -----------------------------------------------------------------
commit 1a66b657a6dcb244165f9a4b8f51d44c6b3aacff
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Feb 11 16:14:39 2016 -0500

    Add a true value to index upgrade files
    
    The indexes files added in 433f0a09 are require'd when
    evaluated by RT's upgrade script and therefore need to
    return a true value.

diff --git a/etc/upgrade/3.3.0/indexes b/etc/upgrade/3.3.0/indexes
index 1aefdcc..729ac07 100644
--- a/etc/upgrade/3.3.0/indexes
+++ b/etc/upgrade/3.3.0/indexes
@@ -23,3 +23,4 @@ $RT::Handle->MakeSureIndexExists(
     Columns => ['CustomField','ObjectType','ObjectId'],
 );
 
+1;
diff --git a/etc/upgrade/3.7.81/indexes b/etc/upgrade/3.7.81/indexes
index 79b6716..9b49b9e 100644
--- a/etc/upgrade/3.7.81/indexes
+++ b/etc/upgrade/3.7.81/indexes
@@ -5,3 +5,5 @@ $RT::Handle->MakeSureIndexExists(
     Table => 'CachedGroupMembers',
     Columns => ['MemberId', 'ImmediateParentId'],
 );
+
+1;
diff --git a/etc/upgrade/3.8.3/indexes b/etc/upgrade/3.8.3/indexes
index 311d1c6..d094ccd 100644
--- a/etc/upgrade/3.8.3/indexes
+++ b/etc/upgrade/3.8.3/indexes
@@ -6,3 +6,5 @@ $RT::Handle->MakeSureIndexExists(
     Unique => 1,
     Columns => ['GroupId', 'MemberId'],
 );
+
+1;

commit 486c6317100356ce0cfd2593b5a019773846fe3d
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Feb 12 13:45:22 2016 -0500

    Override default sort order for Queues during upgrade
    
    Commit 067ca0a7 added sort order to queues, which uses a new
    SortOrder column. Older RTs don't have it yet, so override
    OrderBy manually so the upgrade script can run.

diff --git a/etc/upgrade/4.0.9/content b/etc/upgrade/4.0.9/content
index 6f526ce..f04b4ab 100644
--- a/etc/upgrade/4.0.9/content
+++ b/etc/upgrade/4.0.9/content
@@ -7,6 +7,10 @@ our @Initial = (
             'Going to update empty Queue Lifecycle column to "default"');
 
         my $queues = RT::Queues->new( RT->SystemUser );
+
+        # override the default order by SortOrder, because it doesn't exist yet
+        $queues->OrderByCols();
+
         $queues->FindAllRows;
         $queues->Limit(
             FIELD    => 'Lifecycle',

commit cda2ec742e7cf7886bfba2c3d13a905a529754b3
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Feb 12 14:32:05 2016 -0500

    Add exception to skip newer roles during upgrade
    
    New roles introduced with Assets did not exist before
    RT 4.4 and produced errors when the upgrade script
    attempted to load the Groups. Skip these new roles
    during the upgrade process.

diff --git a/etc/upgrade/4.1.4/content b/etc/upgrade/4.1.4/content
index b320695..ca33412 100644
--- a/etc/upgrade/4.1.4/content
+++ b/etc/upgrade/4.1.4/content
@@ -8,6 +8,9 @@ push @Final, sub {
     my $handle = RT->DatabaseHandle;
 
     for my $role (RT::System->Roles) {
+        # HeldBy and Contact come in with Assets, didn't exist yet in 4.1.4
+        next if ( $role eq 'HeldBy' or $role eq 'Contact');
+
         my $group       = RT::Group->new( RT->SystemUser );
         my ($ok, $msg)  = $group->LoadRoleGroup(
             Object  => RT->System,
diff --git a/etc/upgrade/4.2.11/content b/etc/upgrade/4.2.11/content
index 5e43db7..7192142 100644
--- a/etc/upgrade/4.2.11/content
+++ b/etc/upgrade/4.2.11/content
@@ -24,8 +24,12 @@ EOSQL
         # Those are not allowed to be granted on global role groups
         my $invalid = RT::ACL->new( RT->SystemUser );
         $invalid->LimitToObject( 'RT::System' );
-        $invalid->LimitToPrincipal( Id => RT::System->RoleGroup($_)->PrincipalId )
-            for RT::System->Roles;
+
+        foreach my $role ( RT::System->Roles ){
+            # HeldBy and Contact come in with Assets, didn't exist yet in 4.2.11
+            next if ( $role eq 'HeldBy' or $role eq 'Contact');
+            $invalid->LimitToPrincipal( Id => RT::System->RoleGroup($role)->PrincipalId )
+        }
         $invalid->Limit( FIELD => 'RightName', OPERATOR => 'IN', VALUE => \@rights );
 
         return unless $invalid->Count;

-----------------------------------------------------------------------


More information about the rt-commit mailing list