33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
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('tasks', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
$table->string('title');
|
||
|
|
$table->text('description')->nullable();
|
||
|
|
$table->string('status')->default('todo');
|
||
|
|
$table->foreignId('project_id')->constrained()->cascadeOnDelete();
|
||
|
|
$table->integer('priority')->default(0);
|
||
|
|
$table->dateTime('due_at')->nullable();
|
||
|
|
$table->dateTime('started_at')->nullable();
|
||
|
|
$table->dateTime('completed_at')->nullable();
|
||
|
|
$table->integer('estimated_hours')->nullable();
|
||
|
|
$table->integer('actual_hours')->nullable();
|
||
|
|
$table->timestamps();
|
||
|
|
$table->softDeletes();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('tasks');
|
||
|
|
}
|
||
|
|
};
|