migrations icon indicating copy to clipboard operation
migrations copied to clipboard

Add warning about implicit commit to documentation

Open shylux opened this issue 1 year ago • 8 comments

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

shylux avatar Dec 05 '23 07:12 shylux

Pretty sure I covered this here: https://www.doctrine-project.org/projects/doctrine-migrations/en/stable/explanation/implicit-commits

greg0ire avatar Dec 05 '23 07:12 greg0ire

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.

agustingomes avatar Dec 06 '23 14:12 agustingomes

Seems fair. Please send PRs to address these issues.

greg0ire avatar Dec 06 '23 15:12 greg0ire

I will look into it these days.

agustingomes avatar Dec 06 '23 15:12 agustingomes

@greg0ire how can I test the documentation changes locally? I cannot find any tooling locally.

agustingomes avatar Dec 06 '23 16:12 agustingomes

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)

greg0ire avatar Dec 06 '23 17:12 greg0ire

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.

agustingomes avatar Dec 07 '23 13:12 agustingomes

@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.

agustingomes avatar Aug 23 '24 20:08 agustingomes