mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for deleting account
This commit is contained in:
parent
3ed5fdf09f
commit
861672e9e9
@ -1254,8 +1254,9 @@ class AccountController extends BaseController
|
|||||||
$this->accountRepo->unlinkAccount($account);
|
$this->accountRepo->unlinkAccount($account);
|
||||||
if ($account->company->accounts->count() == 1) {
|
if ($account->company->accounts->count() == 1) {
|
||||||
$account->company->forceDelete();
|
$account->company->forceDelete();
|
||||||
}
|
} else {
|
||||||
$account->forceDelete();
|
$account->forceDelete();
|
||||||
|
}
|
||||||
|
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
Session::flush();
|
Session::flush();
|
||||||
|
@ -49,7 +49,7 @@ class EnterprisePlan extends Migration
|
|||||||
Schema::table('accounts', function($table)
|
Schema::table('accounts', function($table)
|
||||||
{
|
{
|
||||||
$table->unsignedInteger('company_id')->nullable();
|
$table->unsignedInteger('company_id')->nullable();
|
||||||
$table->foreign('company_id')->references('id')->on('companies');
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user