diff --git a/concept/database/database_concept.dia b/concept/database/database_concept.dia index 82b4fa7..52a0884 100644 Binary files a/concept/database/database_concept.dia and b/concept/database/database_concept.dia differ diff --git a/database/factories/PersonTargetFactory.php b/database/factories/PersonTargetFactory.php index 339fcc5..732f354 100644 --- a/database/factories/PersonTargetFactory.php +++ b/database/factories/PersonTargetFactory.php @@ -1,9 +1,17 @@ define(App\PersonTarget::class, function (Faker $faker) { return [ - // + 'io_type_id' => IOType::all('id')->random()->id, + 'date' => $faker->dateTimeInInterval('2014-04-01'), + 'amount' => $faker->randomFloat(2, 10, 2000), + 'reference' => $faker->text(20), + 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), + 'updated_at' => Carbon::now()->format('Y-m-d H:i:s') ]; }); diff --git a/database/migrations/2018_09_07_090338_create_person_targets_table.php b/database/migrations/2018_09_07_090338_create_person_targets_table.php index 05cce3e..4a890fe 100644 --- a/database/migrations/2018_09_07_090338_create_person_targets_table.php +++ b/database/migrations/2018_09_07_090338_create_person_targets_table.php @@ -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 diff --git a/database/migrations/2018_09_07_090452_create_account_classes_table.php b/database/migrations/2018_09_07_090452_create_account_classes_table.php index 383f9f1..5fbae7f 100644 --- a/database/migrations/2018_09_07_090452_create_account_classes_table.php +++ b/database/migrations/2018_09_07_090452_create_account_classes_table.php @@ -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. diff --git a/database/seeds/constants/AccountClassesTableSeeder.php b/database/seeds/constants/AccountClassesTableSeeder.php index f01604c..bcf7bce 100644 --- a/database/seeds/constants/AccountClassesTableSeeder.php +++ b/database/seeds/constants/AccountClassesTableSeeder.php @@ -15,7 +15,7 @@ class AccountClassesTableSeeder extends Seeder DB::table('account_classes')->insert([ [ 'scope_id' => 1, - 'io_type' => 1, + 'io_type_id' => 1, 'number' => 1000, 'name' => 'EINNAHMEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -23,7 +23,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 1, - 'io_type' => 2, + 'io_type_id' => 2, 'number' => 1500, 'name' => 'AUSGABEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -31,7 +31,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 2, - 'io_type' => 1, + 'io_type_id' => 1, 'number' => 2000, 'name' => 'EINNAHMEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -39,7 +39,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 2, - 'io_type' => 2, + 'io_type_id' => 2, 'number' => 2500, 'name' => 'AUSGABEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -47,7 +47,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 3, - 'io_type' => 1, + 'io_type_id' => 1, 'number' => 3000, 'name' => 'EINNAHMEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -55,7 +55,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 3, - 'io_type' => 2, + 'io_type_id' => 2, 'number' => 3500, 'name' => 'AUSGABEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -63,7 +63,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 4, - 'io_type' => 1, + 'io_type_id' => 1, 'number' => 4000, 'name' => 'EINNAHMEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -71,7 +71,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 4, - 'io_type' => 2, + 'io_type_id' => 2, 'number' => 4500, 'name' => 'AUSGABEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -79,7 +79,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 5, - 'io_type' => 1, + 'io_type_id' => 1, 'number' => 5000, 'name' => 'EINNAHMEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), @@ -87,7 +87,7 @@ class AccountClassesTableSeeder extends Seeder ], [ 'scope_id' => 5, - 'io_type' => 2, + 'io_type_id' => 2, 'number' => 5500, 'name' => 'AUSGABEN', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),