blob: 0dc53d224fcf03bfc76e3e09576cfd617b31be7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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->();
|