Laravel 13 + Livewire/Volt app for managing client organizations, documents, passwords, flexible assets, virtual machines, contacts, domains, todos, shortcuts, and role-based user administration.
35 lines
1.2 KiB
PHP
35 lines
1.2 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('todos', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('organization_id')->constrained()->cascadeOnDelete();
|
|
$table->string('title');
|
|
$table->text('description')->nullable();
|
|
$table->string('category'); // infra|support|metier|autre
|
|
$table->string('criticality')->default('medium'); // low|medium|high|urgent
|
|
$table->date('due_date')->nullable();
|
|
$table->foreignId('assigned_to')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->boolean('is_done')->default(false);
|
|
$table->timestamp('completed_at')->nullable();
|
|
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
|
|
$table->index(['organization_id', 'is_done']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('todos');
|
|
}
|
|
};
|