In the “Transactional Migrations” chapter there seems to be a logical mistake (or I am missing something obvious).
The note below first example says:
some DB queries cannot be put into a transaction. For some examples, please refer to implicit commit. If this is the case, you should still implement
up()
anddown()
, instead
When you click the given link you can read (in MySQL guide) you can read that CREATE TABLE
is among those SQL commands that implicitly end any transaction active.
This means that the example given above this not is pointless. There’s not point in wrapping up $this->createTable()
and $this->insert()
into transaction (in safeUp()
), because $this->createTable()
commits that transaction and won’t be rolled back, if subsequent $this->insert()
fails for any reason.
Am I correct?