Changed foreign key id field name in person_targets and account_classes from

'io_type' to 'io_type_id'.

Implemented PersonTarget factory.
This commit is contained in:
Lukas Halbritter
2018-09-13 16:04:40 +02:00
parent 47569b0525
commit f394ed773b
5 changed files with 23 additions and 15 deletions
@@ -31,8 +31,8 @@ class CreatePersonTargetsTable extends Migration
// The type of the target. It can be either a payable or a
// receivable. A payable is of type 'expediture' and a receivable is
// of type 'income'.
$table->integer('io_type')->unsigned();
$table->foreign('io_type')->references('id')->on('i_o_types')
$table->integer('io_type_id')->unsigned();
$table->foreign('io_type_id')->references('id')->on('i_o_types')
->onDelete('no action');
// A reference text which describes the target
@@ -23,8 +23,8 @@ class CreateAccountClassesTable extends Migration
$table->smallInteger('number')->unsigned()->unique();
// The type of the account class.
$table->integer('io_type')->unsigned();
$table->foreign('io_type')->references('id')->on('i_o_types')
$table->integer('io_type_id')->unsigned();
$table->foreign('io_type_id')->references('id')->on('i_o_types')
->onDelete('no action');
// The scope of the account class.