summaryrefslogtreecommitdiff
path: root/rt/etc/upgrade/4.1.13/backcompat
diff options
context:
space:
mode:
Diffstat (limited to 'rt/etc/upgrade/4.1.13/backcompat')
-rw-r--r--rt/etc/upgrade/4.1.13/backcompat34
1 files changed, 34 insertions, 0 deletions
diff --git a/rt/etc/upgrade/4.1.13/backcompat b/rt/etc/upgrade/4.1.13/backcompat
new file mode 100644
index 000000000..0dc53d224
--- /dev/null
+++ b/rt/etc/upgrade/4.1.13/backcompat
@@ -0,0 +1,34 @@
+my $upgrade = shift;
+
+my $groups = RT::Groups->new( RT->SystemUser );
+$groups->Limit(
+ FIELD => 'Name', OPERATOR => '!=', VALUE => 'main.Type', QUOTEVALUE => 0
+);
+$groups->Limit(
+ FIELD => 'Name', OPERATOR => 'IS', VALUE => 'NULL',
+);
+$groups->Limit(
+ FIELD => 'Domain',
+ VALUE => 'SystemInternal',
+ CASESENSITIVE => 0,
+);
+$groups->RowsPerPage(1);
+if ( $groups->Next ) {
+ my $dbh = $RT::Handle->dbh;
+ my $db_type = RT->Config->Get('DatabaseType');
+ if ( $db_type eq 'Oracle' || $db_type eq 'Pg' ) {
+ $dbh->do(
+ "UPDATE Groups SET Name = Type
+ WHERE LOWER(Domain) IN ('aclequivalence', 'systeminternal')
+ OR LOWER(Domain) LIKE '%-role'"
+ );
+ } else {
+ $dbh->do(
+ "UPDATE Groups SET Name = Type
+ WHERE Domain IN ('ACLEquivalence', 'SystemInternal')
+ OR Domain LIKE '%-Role'"
+ );
+ }
+}
+
+$upgrade->();