id(); $table->foreignId('tenant_id')->nullable()->constrained()->cascadeOnDelete(); $table->foreignId('booking_id')->constrained()->cascadeOnDelete(); $table->string('status', 20); $table->string('mode', 20); $table->string('purpose', 30); $table->json('fields'); $table->unsignedTinyInteger('followups_sent')->default(0); $table->unsignedTinyInteger('reminders_sent')->default(0); $table->unsignedSmallInteger('link_version')->default(1); $table->string('last_message', 20)->nullable(); $table->dateTime('last_sent_at')->nullable(); $table->dateTime('response_due_at')->nullable(); $table->dateTime('next_reminder_at')->nullable(); $table->dateTime('answered_at')->nullable(); $table->dateTime('closed_at')->nullable(); $table->string('closed_reason')->nullable(); $table->timestamps(); $table->index(['booking_id', 'status']); $table->index(['status', 'next_reminder_at']); }); Schema::table('booking_messages', function (Blueprint $table) { $table->string('message_id')->nullable()->after('subject')->index(); }); } public function down(): void { Schema::table('booking_messages', function (Blueprint $table) { $table->dropColumn('message_id'); }); Schema::dropIfExists('data_requests'); } };