Files
filament/tests/database/migrations/create_posts_table.php
T
2022-04-05 09:55:41 -04:00

26 lines
685 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->json('tags')->nullable();
$table->string('title');
$table->unsignedTinyInteger('rating')->default(0);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('posts');
}
};