migrations
migrations copied to clipboard
Introduce addDeferredSql method in migration class
| Q | A |
|---|---|
| Type | feature |
| BC Break | no |
Summary
This will allow to add queries that needs to be executed after changes made to schema object.
Reason for this change
When people need to write data in newly created table / added column, they probably resorts to calling $this->connection->executeStatement in postUp, and this may be wrong in at least two scenarios:
- When testing migration with
--dry-runoption,executeStatementis always called, since migration does not know about dry-run mode - Such SQLs are not visible if executed with
-vvor--write-sqloptions, sinceexecuteStatementdoes not log queries likeaddSql.