nerdexam
Adobe

AD0-E724 · Question #68

Which mechanism is recommended for executing database schema changes during module installation or upgrade?

The correct answer is C. Data Patch. Data Patches are the recommended approach (in frameworks like Magento 2) because they are version-tracked, idempotent, and run only once - the system records each applied patch in the database, preventing accidental re-execution on subsequent upgrades. This makes them far safer…

Setup and Configuration

Question

Which mechanism is recommended for executing database schema changes during module installation or upgrade?

Options

  • ADependency Injection Configuration
  • BModule Registry
  • CData Patch
  • DInstaller Script

How the community answered

(36 responses)
  • A
    3% (1)
  • B
    6% (2)
  • C
    92% (33)

Explanation

Data Patches are the recommended approach (in frameworks like Magento 2) because they are version-tracked, idempotent, and run only once - the system records each applied patch in the database, preventing accidental re-execution on subsequent upgrades. This makes them far safer and more maintainable than older approaches for evolving your schema over time.

Why the distractors are wrong:

  • A (Dependency Injection Configuration) manages how objects and services are wired together, not database operations - it has no mechanism for executing SQL or schema changes.
  • B (Module Registry) tracks module metadata and status, not schema execution logic.
  • D (Installer Script) is the old approach (e.g., InstallSchema/UpgradeSchema) that has been deprecated precisely because it lacks reliable tracking and is hard to maintain across versions.

Memory tip: Think "patch it once, track it forever." Data Patches solve the classic problem of "did this schema change already run?" by recording themselves - Installer Scripts had no such guarantee, which is why they were replaced.

Topics

#data patch#schema changes#module upgrade#database migration

Community Discussion

No community discussion yet for this question.

Full AD0-E724 Practice