Answer the question
In order to leave comments, you need to log in
Transactions do not work with migrations in Yii2. ??
Please tell me what could be wrong.
I am doing migrations in Yii2 using the safeUp and safeDown methods. Base - MySQL.
And in one migration, several labels are created. If an error occurs while creating one of the labels, then all the labels that were created earlier in this migration will be created. As far as I understand, the safeUp and safeDown methods should use a transaction, but it turns out that it does not work.
What could be wrong?
Answer the question
In order to leave comments, you need to log in
This is both the code and the link, click and you will see a performance test. The whole point of the s
modifier is to recognize all text as 1 line.
In order not to escape the slash, I used delimiters ~
If something doesn't work out, write a language and a function.
DDL (create, alter, drop) cannot be rolled back. This is not Yii or even PHP, but MySQL.
in short, within a transaction, you can manipulate the data stored in the database, but not with the structure of the database itself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question