#929 implement first half of multi tenancy with tenant_databases setting

This commit is contained in:
Oliver Gorwits
2022-09-24 19:01:05 +01:00
parent b391f83d60
commit 1d5f3ce316
71 changed files with 355 additions and 205 deletions

View File

@@ -175,13 +175,13 @@ sub store_arp {
debug sprintf 'store_arp - mac %s ip %s', $mac->as_ieee, $ip;
schema('netdisco')->txn_do(sub {
my $current = schema('netdisco')->resultset('NodeIp')
schema(vars->{'tenant'})->txn_do(sub {
my $current = schema(vars->{'tenant'})->resultset('NodeIp')
->search(
{ ip => $ip, -bool => 'active'},
{ columns => [qw/mac ip/] })->update({active => \'false'});
schema('netdisco')->resultset('NodeIp')
schema(vars->{'tenant'})->resultset('NodeIp')
->update_or_create(
{
mac => $mac->as_ieee,