- Move 12 markdown files from root to docs/ subdirectories - Organize documentation by category: • docs/troubleshooting/ (1 file) - Technical troubleshooting guides • docs/deployment/ (4 files) - Deployment and security documentation • docs/guides/ (3 files) - Feature-specific guides • docs/planning/ (4 files) - Planning and improvement proposals Root directory cleanup: - Reduced from 16 to 4 markdown files in root - Only essential project files remain: • CLAUDE.md (AI instructions) • README.md (Main project readme) • CLEANUP_PLAN.md (Current cleanup plan) • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements) This improves: ✅ Documentation discoverability ✅ Logical organization by purpose ✅ Clean root directory ✅ Better maintainability
62 lines
1.7 KiB
PHP
62 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Queue\Migrations;
|
|
|
|
use App\Framework\Database\ConnectionInterface;
|
|
use App\Framework\Database\Migration\Migration;
|
|
use App\Framework\Database\Migration\MigrationVersion;
|
|
use App\Framework\Database\Schema\Schema;
|
|
|
|
/**
|
|
* Migration für Distributed Locks Tabelle
|
|
*/
|
|
final readonly class CreateDistributedLocksTable implements Migration
|
|
{
|
|
public function up(ConnectionInterface $connection): void
|
|
{
|
|
$schema = new Schema($connection);
|
|
|
|
$schema->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";
|
|
}
|
|
} |