The separate Ping Alert Rules feature is merged into Workflow Rules by this upgrade — see Ping Alert Rules merged into Workflow Rules below.
TL;DR
- Back up your database.
- Deploy the 2.x code (pull the new image / checkout the new release).
- Run
php artisan migrate --force. - Run
php artisan db:seed --force(optional but recommended — idempotent, re-runs the token-ability rewrite as a safety net). - Restart long-running processes so they load the new code:
php artisan queue:restart, then restart PHP-FPM as needed, or- Docker: recreate the container (the queue workers and scheduler are s6-overlay services that start fresh with the new image).
- If you build frontend assets yourself (outside the image):
bun install --ignore-scripts && bun run build.
What happens automatically
1. Tables are renamed in place (data preserved)
The migrationdatabase/migrations/2026_08_12_000001_rename_legacy_alert_rules_to_workflow_rules_table.php renames the tables and their foreign-key column — all rows are kept:
The FK column
alert_rule_id on workflow_rule_conditions and workflow_rule_actions is renamed to workflow_rule_id.
2. Existing API tokens keep working
Stored token abilities are rewritten by the migration (up()), so a plain php artisan migrate is enough:
WorkflowRulesMigratorSeeder (registered in DatabaseSeeder) rewrites the same abilities and is fully idempotent — running php artisan db:seed --force after migrating is a harmless safety net.
3. Fresh 2.x installs need nothing extra
On a fresh 2.x install the tables are created directly asworkflow_*; the rename migration detects the legacy tables are absent and becomes a no-op.
4. Ping Alert Rules are merged into Workflow Rules
The migrationdatabase/migrations/2026_08_14_000001_merge_ping_alert_rules_into_workflow_rules.php folds the separate ping alert rules into workflow rules. Ping rules become ordinary workflow rules with event = 'ping' and a ping_target_id:
workflow_rules gains a nullable ping_target_id FK (cascade on delete) plus a unique (ping_target_id, name) index; workflow_rule_conditions gains a nullable lookback_minutes column. Stored ping-alerts:* token abilities are rewritten to workflow-rules:* in the same migration. After the migration the legacy ping_alert_* tables are dropped.
Breaking changes
Update any external consumers (scripts, dashboards, AI clients) that call the old endpoint, tool, or ability names.
Ping Alert Rules merged into Workflow Rules
Zepeed 2.x also merges the separate Ping Alert Rules feature into Workflow Rules:
The migration runs automatically on
php artisan migrate; existing ping rules and ping-alerts:* token abilities are preserved. New ping condition metrics (latency_avg, latency_max, consecutive_failures) live on WorkflowRuleMetric, and new operators (is_above_or_equal, is_below_or_equal) on WorkflowRuleOperator.
Not renamed (intentionally)
- Prometheus metric names —
zepeed_alert_rule_active,zepeed_alert_rule_last_triggered_timestamp,zepeed_ping_alert_rule_activeandzepeed_ping_alert_rule_last_triggered_timestampare a stable external contract for dashboards and are kept unchanged.
Rollback
php artisan migrate:rollback runs each migration’s down(): the rename migration restores the legacy alert_* table/column names and flips workflow-rules:* abilities back to alerts:*; the merge migration recreates the ping_alert_* tables, moves event = 'ping' workflow rules back into them, and drops the ping_target_id / lookback_minutes columns. If you only roll back the migrations while 2.x code is still deployed, the app will be broken — roll back the deployment as a unit.
On MariaDB/MySQL,down()performs the same foreign-key column renames asup()and can hit error 1025 mid-way, leaving a mixedalert_*/workflow_*state. Follow the backup-restore and drop/re-create-FK guidance in Troubleshooting if that happens.
Verification after upgrading
Troubleshooting
Mailer [...] is not definedafter upgrade — a long-running queue worker is still executing pre-upgrade code. Runphp artisan queue:restartand recreate the container / restart PHP-FPM.- MariaDB/MySQL: the rename migration errors with code 1025 — renaming a foreign-key column can hit this on some versions. Test the migration against a copy of your production data first; if it fails, drop and re-create the two foreign keys around the rename (see the migration file for the exact columns).
- The migration fails partway —
Schema::renameis not transactional on MySQL/MariaDB. Restore your backup and re-run, or complete the remaining renames manually (the migration is guarded and skips already-renamed tables).