[Rt-commit] rt branch, 5.0/fix-upgrade-configurations-warning, created. rt-5.0.0beta2-6-g6fcda11806
? sunnavy
sunnavy at bestpractical.com
Fri Jun 26 10:57:11 EDT 2020
The branch, 5.0/fix-upgrade-configurations-warning has been created
at 6fcda11806432b2cbf4dbfe283451860273d553c (commit)
- Log -----------------------------------------------------------------
commit 6fcda11806432b2cbf4dbfe283451860273d553c
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jun 26 22:24:53 2020 +0800
Avoid upgrade warning of "no such table: Configurations" before it's created
diff --git a/lib/RT.pm b/lib/RT.pm
index 1aabd41ad5..83fa8d28fd 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -199,7 +199,7 @@ sub Init {
ConnectToDatabase();
InitSystemObjects();
InitClasses(%args);
- RT->Config->LoadConfigFromDatabase();
+ RT->Config->LoadConfigFromDatabase() unless $args{SkipConfigurations};
InitLogging();
ProcessPreInitMessages();
InitPlugins();
diff --git a/sbin/rt-setup-database.in b/sbin/rt-setup-database.in
index c3391f0445..38e658544e 100644
--- a/sbin/rt-setup-database.in
+++ b/sbin/rt-setup-database.in
@@ -354,8 +354,13 @@ sub action_insert {
unless ($RAN_INIT) {
$RT::Handle = RT::Handle->new;
my $dbh = get_admin_dbh();
- my $has_custom_roles = grep { lc($_) eq 'customroles' } $RT::Handle->_TableNames($dbh);
- RT::Init(SkipCustomRoles => !$has_custom_roles);
+ my %skip_args;
+ my %tables = map { lc $_ => 1 } $RT::Handle->_TableNames($dbh);
+ for my $item ( qw/CustomRoles Configurations/ ) {
+ $skip_args{"Skip$item"} = 1 unless $tables{lc $item};
+ }
+ RT::Init(%skip_args);
+
$RAN_INIT++;
}
$log_actions = 1;
-----------------------------------------------------------------------
More information about the rt-commit
mailing list