1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00

Merge pull request #6102 from turbo124/v5-develop

Cross fill subdomains
This commit is contained in:
David Bomba 2021-06-22 17:46:12 +10:00 committed by GitHub
commit a952011bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,37 @@ class SubdomainFill extends Command
});
$db1 = Company::on('db-ninja-01')->get();
$db1->each(function ($company){
$db2 = Company::on('db-ninja-02a')->find($company->id);
if($db2)
{
$db2->subdomain = $company->subdomain;
$db2->save();
}
});
$db1 = null;
$db2 = null;
$db2 = Company::on('db-ninja-02')->get();
$db2->each(function ($company){
$db1 = Company::on('db-ninja-01a')->find($company->id);
if($db1)
{
$db1->subdomain = $company->subdomain;
$db1->save();
}
});
}
}