Skip to content
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

Error running migrations when upgrading OroCommerce from 4.1.12 to 4.2.5 #1070

Closed
AdamJHall opened this issue Aug 11, 2021 · 1 comment
Closed

Comments

@AdamJHall
Copy link

Summary
I'm currently in the process of upgrading a project from 4.1.12 CE to 4.2.5 however I'm getting the following when running oro:platform:update

> Oro\Bundle\CheckoutBundle\Migrations\Schema\v1_12\RemoveAlternativeCheckoutWorkflow
    ERROR: An exception occurred while executing 'SELECT e.id FROM oro_checkout e INNER JOIN oro_workflow_item wi ON (CAST(wi.entity_id as integer) = e.id) AND (wi.entity_class = ?) WHERE wi.workflow_name = ?' with params ["Oro\\Bundle\\CheckoutBundle\\Entity\\Checkout", "b2b_flow_alternative_checkout"]:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer) = e.id) AND (wi.entity_class = 'Oro\\Bundle\\CheckoutBundle\\Entity\\Ch' at line 1 

This looks to be caused by the cast on line 60 of Oro\Bundle\WorkflowBundle\Migration\RemoveWorkflowAwareEntitiesQuery which I believe for Mysql 8.0 should either be removed or changed to CAST(wi.entity_id as UNSIGNED)

Happy to create a PR to make the change just wanted to confirm it was needed first.

Steps to reproduce

  1. Start with a OroCommerce CE 4.1.12 project
  2. Upgrade to 4.2.5
  3. Perform oro:platform:update

Actual Result
Migrations fail with:

> Oro\Bundle\CheckoutBundle\Migrations\Schema\v1_12\RemoveAlternativeCheckoutWorkflow
    ERROR: An exception occurred while executing 'SELECT e.id FROM oro_checkout e INNER JOIN oro_workflow_item wi ON (CAST(wi.entity_id as integer) = e.id) AND (wi.entity_class = ?) WHERE wi.workflow_name = ?' with params ["Oro\\Bundle\\CheckoutBundle\\Entity\\Checkout", "b2b_flow_alternative_checkout"]:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'integer) = e.id) AND (wi.entity_class = 'Oro\\Bundle\\CheckoutBundle\\Entity\\Ch' at line 1 

Expected Result
Migrations complete successfully

Details about your environment

  • OroPlatform version: 4.2.5
  • PHP version: 8.0
  • Mysql 8.0

Additional information
Current workaround is to require https://packagist.org/packages/oro/commerce-demo-checkouts so the migration does not run.

@AdamJHall
Copy link
Author

Looks like this is a duplicate of: oroinc/orocommerce#131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant