fox/database/migrations/2025_01_01_000012_create_go...

30 lines
848 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('goals', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('description')->nullable();
$table->string('status')->default('active'); // active | paused | done | abandoned
$table->unsignedTinyInteger('progress')->default(0); // 0-100
$table->jsonb('metadata')->nullable();
$table->timestamp('last_reviewed_at')->nullable();
$table->timestamps();
$table->index('status');
});
}
public function down(): void
{
Schema::dropIfExists('goals');
}
};