Skip to content

Migrations

Health check database setup runs through internal migrations under Subscribed\IncidentMonitor\HealthCheck\Migrations\....

Structure

  • Migrations\Migration Extends the base-plugin migration contract for a migration step
  • Migrations\Migrator Registers health check migrations through the base-plugin migrator architecture
  • Migrations\Versions\Version_1_0_0 Initial schema creation for health check tables
  • Migrations\Versions\Version_1_1_0 Renames legacy health check tables to the more explicit health-check-prefixed names

Current version

The current schema uses:

  • {$wpdb->prefix}incident_monitor_health_check_statuses
  • {$wpdb->prefix}incident_monitor_health_check_runs

The actual table creation SQL is kept in:

  • Subscribed\IncidentMonitor\HealthCheck\Storage\SchemaManager

Runtime behavior

The health check app registers the migrator through the base-plugin migration hook:

  • it hooks into barberklingen/migrations/completed
  • it checks the stored database version when the hook runs
  • it installs any newer migration classes in order
  • it updates the stored version after each successful install
  • Version_1_1_0 renames the old incident_monitor_* tables in place when they exist

The current option key is:

db_version_package-incident-monitor-health-check