id(); $table->foreignId('slot_id')->constrained()->cascadeOnDelete(); // Уникальный индекс и обеспечивает идемпотентность: две // одновременные вставки с одним ключом невозможны. $table->uuid('idempotency_key')->unique(); $table->enum('status', ['held', 'confirmed', 'cancelled'])->default('held'); $table->dateTime('expires_at'); $table->dateTime('confirmed_at')->nullable(); $table->dateTime('cancelled_at')->nullable(); $table->timestamps(); // Под подсчёт активных холдов слота. $table->index(['slot_id', 'status', 'expires_at']); }); } public function down(): void { Schema::dropIfExists('holds'); } };