#985 allow netdisco-{deploy,do,db-deploy} on custom tenant with NETDISCO_DB_TENANT

This commit is contained in:
Oliver Gorwits
2023-03-08 14:15:12 +00:00
parent db112d99cd
commit c6e0ad75b9

View File

@@ -97,6 +97,13 @@ if (ref {} eq ref setting('database')) {
# and support tenancies by setting what the default schema points to # and support tenancies by setting what the default schema points to
setting('plugins')->{DBIC}->{'netdisco'}->{'alias'} = 'default'; setting('plugins')->{DBIC}->{'netdisco'}->{'alias'} = 'default';
# allow override of the default tenancy
setting('plugins')->{DBIC}->{'default'}
= setting('plugins')->{DBIC}->{$ENV{NETDISCO_DB_TENANT}}
if $ENV{NETDISCO_DB_TENANT}
and $ENV{NETDISCO_DB_TENANT} ne 'netdisco'
and exists setting('plugins')->{DBIC}->{$ENV{NETDISCO_DB_TENANT}};
} }
# always set this # always set this