Files
MoveMate/database/migrations/2025_03_05_223432_create_tasks_table.php
2025-03-06 19:57:42 +09:00

37 lines
947 B
PHP

<?php
use App\Models\Category;
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('tasks', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
$table->foreignIdFor(Category::class)->constrained()->cascadeOnDelete();
$table->string('name');
$table->longText('description');
$table->string('location');
$table->string('time_estimate');
$table->boolean('completed');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tasks');
}
};