hypothetical/database/migrations/2020_04_23_234824_add_blog_tags_table.php
2023-03-13 17:33:19 -04:00

31 lines
785 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('blog_tags', function(Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('blog_id')->unsigned();
$table->foreign('blog_id')->references('id')->on('blog')->onDelete('cascade');
$table->string('name')->nullable();
$table->integer('order')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::drop('blog_tags');
}
};