Solved rollback problem in create_people_table (foreign key problem).

This commit is contained in:
Lukas Halbritter
2018-09-04 00:29:32 +02:00
parent acca76f814
commit 9a1983d42f
2 changed files with 2 additions and 3 deletions
@@ -45,6 +45,7 @@ class CreatePeopleTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('person_targets');
Schema::dropIfExists('people'); Schema::dropIfExists('people');
} }
} }
@@ -31,9 +31,7 @@ class CreatePersonTargetsTable extends Migration
// The type of the target. It can be either a payable or a // The type of the target. It can be either a payable or a
// receivable. A payable is of type 'expediture' and a receivable is // receivable. A payable is of type 'expediture' and a receivable is
// of type 'income'. // of type 'income'.
$table->integer('io_type')->unsigned(); $table->tinyInteger('io_type');
$table->foreign('io_type')->references('id')->on('io_types')
->onDelete('no action');
// A reference text which describes the target // A reference text which describes the target
$table->string('reference'); $table->string('reference');