diff --git a/database/migrations/2026_05_17_120004_create_slots_table.php b/database/migrations/2026_05_17_120004_create_slots_table.php new file mode 100644 index 0000000..c027790 --- /dev/null +++ b/database/migrations/2026_05_17_120004_create_slots_table.php @@ -0,0 +1,23 @@ +id(); + $table->unsignedInteger('capacity'); + $table->unsignedInteger('remaining'); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('slots'); + } +}; diff --git a/database/migrations/2026_05_17_120022_create_holds_table.php b/database/migrations/2026_05_17_120022_create_holds_table.php new file mode 100644 index 0000000..b91cafa --- /dev/null +++ b/database/migrations/2026_05_17_120022_create_holds_table.php @@ -0,0 +1,27 @@ +id(); + $table->foreignId('slot_id')->constrained()->cascadeOnDelete(); + $table->uuid('idempotency_key')->unique(); + $table->string('status', 20); + $table->timestamp('expires_at'); + $table->timestamps(); + + $table->index(['slot_id', 'status', 'expires_at']); + }); + } + + public function down(): void + { + Schema::dropIfExists('holds'); + } +};