-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First setup:upgrade fails on AddMollieShipmentIdAttribute patch #822
Comments
Hi @LucaGallinari, Thank you for opening this issue and providing the details. We’ve had the setup scripts integrated into our Continuous Integration workflow for quite some time now, and we’ve never encountered this problem. Could it be that there is a conflict with another module in your setup? |
I just ran into exactly the same problem. It only happens the first time you run the script, the second time everything is fine! Installation: Clean Magento 2 with sample data! $ composer require mollie/magento2
# default stuff
$ bin/magento setup:upgrade
# ....
Module 'Mollie_Payment':
Unable to apply data patch Mollie\Payment\Setup\Patch\Data\AddMollieShipmentIdAttribute for module Mollie_Payment. Original exception message: DDL statements are not allowed in transactions
$ bin/magento setup:upgrade
# OK |
Thanks @JeroenBoersma , we will take a look into it! |
So, I can reproduce it time after time... # install a clean Magento, nothing else and run setup:install
$ rm -rf generated
$ composer require mollie/magento2
$ bin/magento setup:upgrade --keep-generated
# ....
Module 'Mollie_Payment':
Unable to apply data patch Mollie\Payment\Setup\Patch\Data\AddMollieShipmentIdAttribute for module Mollie_Payment. Original exception message: DDL statements are not allowed in transactions
$ bin/magento setup:upgrade So my last comment was incomplete, the @LucaGallinari did you also use the System settings:
|
That’s helpful, @JeroenBoersma! We spent this morning trying to reproduce it, and now it seems we have a good lead on where and with what setup this might be happening. Thanks—I’ll follow up on this soon! |
It could be it! Locally i don't use that flag infact i never had this problem, instead on our CI/deploy we are using that flag and it failed on first "runs". Btw, as i pointed out in the original post, the correct way to add a column is via a Declarative Schema and NOT via a DataPatch. We never run into this kind of problems by using declarative schema. |
Describe the bug
Sometimes, during the first setup:upgrade of the module, the procedure fails while adding the
mollie_shipment_id
to thesales_shipment
table:Theoretically this should always fails as you shouldn't be able to add a column via DataPatch, but sometimes, especially on the second run of the setup:upgrade, it adds the column properly without errors.
Btw, it should be replaced with a proper definition of the column via db_schema file.
Used versions
The text was updated successfully, but these errors were encountered: