Skip to content

Docs gap: Migration patches — reloading automations and packages #354

@jstanden

Description

@jstanden

Question

How do I reload built-in automations and packages inside a migration patch file (e.g., `11.2.0.php`)?

Gap

No documentation exists for the migration patch system used in `features/cerberusweb.core/patches/`. Developers writing upgrade patches need to know:

  1. Reimporting automations — Use `DAO_Automation::importFromJson($data)` with the parsed JSON from `assets/automations/`. This replaces the existing automation script in the database, so no separate `UPDATE` query is needed.

  2. Reimporting packages — Use `CerberusApplication::packages()->importToLibraryFromFiles($files, $path)` with an array of package filenames and the base path to `packages/library/`.

Both patterns are demonstrated in `features/cerberusweb.core/patches/11.x/11.0.0.php`.

Closest existing page

None found.

Suggested content

A developer guide page covering:

  • The patch file lifecycle (when they run, idempotency requirements)
  • Pattern for reimporting built-in automations via `importFromJson`
  • Pattern for reimporting packages via `importToLibraryFromFiles`
  • Code snippet examples from 11.0.0.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-proposedDocumentation improvements proposed by AI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions