Set the foreign key person_targets->person_id from 'on delete restrict' to 'on
delete cascade', since it should be possible to delete a person which is even and has paid all debts. Before showing the delete confirmation dialog, it is checked, if there is any open target.
This commit is contained in:
@@ -20,7 +20,7 @@ class CreatePersonTargetsTable extends Migration
|
||||
// target
|
||||
$table->integer('person_id')->unsigned();
|
||||
$table->foreign('person_id')->references('id')->on('people')
|
||||
->onDelete('restrict');
|
||||
->onDelete('cascade');
|
||||
|
||||
// The date on which the debt arises
|
||||
$table->date('date');
|
||||
|
||||
Reference in New Issue
Block a user