Files
michaelschiemer/src/Framework/Queue/Migrations/CreateFailoverEventsTable.php
Michael Schiemer 5050c7d73a docs: consolidate documentation into organized structure
- 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
2025-10-05 11:05:04 +02:00

79 lines
2.4 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 Failover Events Tabelle
*/
final readonly class CreateFailoverEventsTable implements Migration
{
public function up(ConnectionInterface $connection): void
{
$schema = new Schema($connection);
$schema->createIfNotExists('failover_events', function ($table) {
// Auto-incrementing ID
$table->id();
// Job der betroffen war
$table->string('job_id', 32);
// Worker die beim Failover beteiligt waren
$table->string('failed_worker_id', 32);
$table->string('new_worker_id', 32)->nullable();
// Event Typ
$table->enum('event_type', [
'worker_failure',
'job_reassignment',
'recovery_completed',
'manual_failover'
]);
// Zusätzliche Event-Daten
$table->json('event_data')->nullable()->comment('Additional failover context and metrics');
// Timestamps
$table->timestamp('failover_at')->default('CURRENT_TIMESTAMP');
// Indexes
$table->index('job_id', 'idx_failover_job');
$table->index('failed_worker_id', 'idx_failover_failed_worker');
$table->index('new_worker_id', 'idx_failover_new_worker');
$table->index('event_type', 'idx_failover_event_type');
$table->index('failover_at', 'idx_failover_time');
$table->index(['failed_worker_id', 'failover_at'], 'idx_failover_worker_time');
});
$schema->execute();
}
public function down(ConnectionInterface $connection): void
{
$schema = new Schema($connection);
$schema->dropIfExists('failover_events');
$schema->execute();
}
public function getVersion(): MigrationVersion
{
return MigrationVersion::fromTimestamp("2024_12_19_151000");
}
public function getDescription(): string
{
return 'Create failover_events table for tracking worker failover and recovery events';
}
public function getDomain(): string
{
return "Framework";
}
}