summaryrefslogtreecommitdiff
path: root/rt/etc/upgrade/4.0.0rc7/content
blob: 4fd63e71c0731b663b2a432e0f910967844ec149 (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
use strict;
use warnings;

our @Initial = (
    sub {
        RT->Logger->debug("Going to set lifecycle for approvals");

        my $queue = RT::Queue->new( RT->SystemUser );
        $queue->Load('___Approvals');
        unless ( $queue->id ) {
            RT->Logger->warning("There is no ___Approvals queue in the DB");
            return 1;
        }

        return 1 if $queue->Lifecycle && $queue->Lifecycle eq 'approvals';

        my ($status, $msg) = $queue->SetLifecycle('approvals');
        unless ( $status ) {
            RT->Logger->error("Couldn't set lifecycle for '___Approvals' queue: $msg");
            return 0;
        }
        return 1;
    },
);