File: /home/armgroup/libs/database/migrations/2022_09_15_113324_create_article_category_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateArticleCategoryTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('article_category', function (Blueprint $table) {
$table->foreignId('article_id')->constrained()->onUpdate('cascade')->onDelete('cascade');
$table->foreignId('category_id')->constrained()->onUpdate('cascade')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('article_category');
}
}