文章对应分类多个

This commit is contained in:
2021-04-02 10:15:47 +08:00
parent 5e1c402087
commit ead950990f
12 changed files with 324 additions and 180 deletions

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateArticleCategoriesTable extends Migration
{
/**
* Run the migrations.
* @return void
*/
public function up()
{
Schema::create('article_category', function (Blueprint $table) {
$table->foreignId('article_id');
$table->foreignId('category_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
* @return void
*/
public function down()
{
Schema::dropIfExists('article_categories');
}
}