I'm using Laravel 5.8.
my migration :
public function up()
{
Schema::create('category_emergency', function (Blueprint $table) {
$table->bigInteger('emergency_id')->unsigned();
$table->bigInteger('category_id')->unsigned();
$table->foreign('emergency_id')->references('id')->on('emergencies')
->onDelete('cascade');
$table->foreign('category_id')->references('id')->on('categories')
->onDelete('cascade');
$table->engine = 'InnoDB';
});
}
when I delete a category it doesn't delete the emergency related to it?
I'm using belongToMany relationship.
I have tried to set the engine to InnoDB but not working
And it's not showing any kind of errors:
Am I doing something wrong Here?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30llc6Y
via IFTTT
Aucun commentaire:
Enregistrer un commentaire