Support the ongoing development of Laravel.io →
posted 5 years ago
Last updated 2 years ago.
0

Hi Vlad,

=> Create a nullable field on this Schema:

$table->unsignedInteger('LessonEventRateCriterion_Id')->nullable();

=> Then create another migration for the foreign key with

$table->foreign('LessonEventRateCriterion_Id')
                ->references('Id')
                ->on('LessonEventRateCriterion')
                ->onDelete('set null');

=> and on the down method, the name must be inside a array:

$table->dropForeign(['LessonEventRateCriterion_Id']);

=> I believe this should work.

0

have to be unsigned int :)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Vlad redrain Joined 22 Apr 2019

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.