Files
filament/tests/database/migrations/create_posts_table.php
T
Dan Harrin 043152f22a cs
2024-07-30 12:42:47 +01:00

29 lines
777 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('posts', function (Blueprint $table): void {
$table->id();
$table->foreignId('author_id');
$table->text('content')->nullable();
$table->boolean('is_published')->default(true);
$table->unsignedTinyInteger('rating')->default(0);
$table->json('tags')->nullable();
$table->string('title');
$table->timestamps();
$table->softDeletes();
});
}
public function down(): void
{
Schema::dropIfExists('posts');
}
};