Skip to content

Commit 91854bd

Browse files
author
Liran Cohen
committed
Fix foreign key on migration.
1 parent e8f8266 commit 91854bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

database/migrations/create_custom_fields_tables.php.stub

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class CreateCustomFieldsTables extends Migration
2424

2525
Schema::create(config('custom-fields.tables.field_responses', 'custom_field_responses'), function (Blueprint $table) {
2626
$table->increments('id');
27-
$table->unsignedInteger('field_id')->references('id')->on(config('custom-fields.tables.fields', 'custom_fields'));
27+
$table->unsignedInteger('field_id');
28+
$table->foreign('field_id')->references('id')->on(config('custom-fields.tables.fields', 'custom_fields'));
2829
$table->unsignedInteger('model_id');
2930
$table->string('model_type');
3031
$table->string('value_str')->nullable();

0 commit comments

Comments
 (0)