migrations
migrations copied to clipboard
Add warning about implicit commit to documentation
Q | A |
---|---|
Version | 3.7.1 |
Documentation Request
Hi i just spent a lot of time debugging why the rollback on our migrations don't seem to work.
Well the code looks good, but if it encounters an error the rollback never works because the transaction is gone.
From what i found out i am 90% sure it is because we use statements that do an implicit commit: https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html
The listed statements, especially ALTER TABLE
are used in pretty much all migrations. And i am sure others will have the same issue.
I am not sure how many db softwares this affects. But it would be nice to have an info box here that warns about this behavior: https://www.doctrine-project.org/projects/doctrine-migrations/en/3.7/reference/configuration.html#all-or-nothing-transaction
Pretty sure I covered this here: https://www.doctrine-project.org/projects/doctrine-migrations/en/stable/explanation/implicit-commits
In all fairness, I think a reference to the explanation can be linked within the --all-or-nothing detail. because I believe not many people may be aware of the ramifications of the DB engines like MySQL not supporting transactional DDL.
I was also bitten by this lack of awareness when working on a migration last year, which then led to this PR and the subsequent ones I made.
Another thing I noticed, the Implicit commits
sidebar only appears on the index page which may reduce the visibility as people may come from a google search, not landing on the index page.
Seems fair. Please send PRs to address these issues.
I will look into it these days.
@greg0ire how can I test the documentation changes locally? I cannot find any tooling locally.
Right now you can't, in the future you will be able to once we migrate to phpDocumentor/guides In the meantime, all you have is Github's preview, unless you're willing to install doctrine-website (which, while hard should be far easier than a few months ago)
unless you're willing to install doctrine-website
I'll give it a go, because I think to implement my suggestionI'll need to understand why the explanation on the sidebar disappears on other pages besides the index.rst.
@greg0ire apologies, I ended up forgetting about this issue. I'm not sure I would be able to come back to this experimentation I wanted to make. will need to allocate some time to look into this.