Putting 4.2.0 on top of 4.0.17
[usit-rt.git] / etc / upgrade / 4.1.13 / backcompat
CommitLineData
af59614d
MKG
1my $upgrade = shift;
2
3my $groups = RT::Groups->new( RT->SystemUser );
4$groups->Limit(
5 FIELD => 'Name', OPERATOR => '!=', VALUE => 'main.Type', QUOTEVALUE => 0
6);
7$groups->Limit(
8 FIELD => 'Domain',
9 VALUE => 'SystemInternal',
10 CASESENSITIVE => 0,
11);
12$groups->RowsPerPage(1);
13if ( $groups->Next ) {
14 my $dbh = $RT::Handle->dbh;
15 my $db_type = RT->Config->Get('DatabaseType');
16 if ( $db_type eq 'Oracle' || $db_type eq 'Pg' ) {
17 $dbh->do(
18 "UPDATE Groups SET Name = Type
19 WHERE LOWER(Domain) IN ('aclequivalence', 'systeminternal')
20 OR LOWER(Domain) LIKE '%-role'"
21 );
22 } else {
23 $dbh->do(
24 "UPDATE Groups SET Name = Type
25 WHERE Domain IN ('ACLEquivalence', 'SystemInternal')
26 OR Domain LIKE '%-Role'"
27 );
28 }
29}
30
31$upgrade->();