add news-news_categories relation

This commit is contained in:
Alexis Gousseau 2022-11-30 12:16:23 +01:00
parent a7efa704ef
commit 4fd50034fa

View file

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewsNewsCategoryTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news_news_category', function (Blueprint $table) {
$table->foreignId('news_id')->references('id')->on('news');
$table->foreignId('news_category_id')->references('id')->on('news_categories');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news_news_category');
}
}