migrations icon indicating copy to clipboard operation
migrations copied to clipboard

Introduce addDeferredSql method in migration class

Open srsbiz opened this issue 10 months ago • 1 comments

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:

  1. When testing migration with --dry-run option, executeStatement is always called, since migration does not know about dry-run mode
  2. Such SQLs are not visible if executed with -vv or --write-sql options, since executeStatement does not log queries like addSql.

srsbiz avatar Dec 14 '24 19:12 srsbiz