Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions resources/guidelines/code/core/database-migations.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ To make those tests fast to run and easier to understand you should not use any
You should also especially not rely on the kernel being booted and the service container being available.
To test your migration you can get a database connection via `KernelLifecycleManager::getConnection()`.
Besides obviously relying on the database, the migration tests should behave like unit tests and rely on nothing else external.
Migration tests should verify idempotence by executing the migration's `update()` method twice whenever that is feasible for the migration under test.
When a migration test needs to create multiple fixture rows, prefer `MultiInsertQueryQueue` to reduce database round-trips and write overhead. This is recommended, but optional.

**Be careful with implicit commits**

Expand Down