Files
portal-api/database/migrations/2024_05_07_094540_post.php
2025-07-24 16:18:27 +07:00

39 lines
921 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.
*
* @return void
*/
public function up()
{
//
Schema::create('post',function (Blueprint $table){
$table->id()->autoIncrement();
$table->string('name',255)->nullable();
$table->string('slug',255)->unique()->nullable();
$table->string('thumbnail',255)->nullable();
$table->longText('content')->nullable();
$table->tinyInteger('status')->default(1)->comment('0: Pending; 1: Published; 2: Draft');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
};