Initial commit of the L'Ami Fiduciaire SaaS platform built on Laravel 12, Vue 3, Inertia.js 2, and Tailwind CSS 4. Story 0.1 (rename folders to declarations in database) is implemented and code-reviewed: migration, rollback, and 6 Pest tests all passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
957 B
PHP
36 lines
957 B
PHP
<?php
|
|
|
|
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('messages', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('folder_id')->constrained()->cascadeOnDelete();
|
|
$table->string('type'); // invite, situation, file_request, confirmation, text
|
|
$table->text('body');
|
|
$table->string('sent_by_type'); // user, client
|
|
$table->unsignedBigInteger('sent_by_id');
|
|
$table->json('metadata')->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->index(['folder_id', 'created_at']);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('messages');
|
|
}
|
|
};
|