createIfNotExists('distributed_locks', function ($table) { // Lock Key - Primary Key $table->string('lock_key', 255)->primary(); // Worker der den Lock hält $table->string('worker_id', 32); // Timestamps $table->timestamp('acquired_at')->default('CURRENT_TIMESTAMP'); $table->timestamp('expires_at'); // Indexes $table->index('worker_id', 'idx_lock_worker'); $table->index('expires_at', 'idx_lock_expires'); $table->index(['worker_id', 'expires_at'], 'idx_lock_worker_expires'); }); $schema->execute(); } public function down(ConnectionInterface $connection): void { $schema = new Schema($connection); $schema->dropIfExists('distributed_locks'); $schema->execute(); } public function getVersion(): MigrationVersion { return MigrationVersion::fromTimestamp("2024_12_19_144000"); } public function getDescription(): string { return 'Create distributed_locks table for distributed job processing locks'; } public function getDomain(): string { return "Framework"; } }