Почему мой Laravel "Каскадное удаление" не работает? Не могли бы вы мне помочь?
Schema::create('payments', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('account_id');
$table->decimal('amount', 13, 2);
$table->timestamps();
});
Schema::create('revenues', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('account_id');
$table->decimal('amount', 13, 2);
$table->timestamps();
});
Schema::create('transactions', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('user_id');
$table->date('date');
$table->decimal('amount', 13, 2);
$table->unsignedBigInteger('payment_id');
$table->unsignedBigInteger('revenue_id');
$table->bigInteger('category_id');
$table->bigInteger('subcategory_id');
$table->string('remarks')->nullable();
$table->timestamps();
$table->foreign('payment_id')->references('id')->on('payments')->onDelete('cascade');
$table->foreign('revenue_id')->references('id')->on('revenues')->onDelete('cascade');
});
Мой двигатель InnoDB. 10.4.8-MariaDB, Laravel 6.