QUALITY PATCH

ACSD-60989: Modifying a column with a foreign key via declarative schema on MariaDB fails due…

Modifying a column with a foreign key via declarative schema on MariaDB fails due to foreign key constraint errors during setup upgrade. Quality patch ACSD-60989 for magento/framework applies to Magento Open Source and Adobe Commerce 2.4.4 to 2.4.7-p10.

Categories
Other
Components
magento/framework
Origin
adobe-commerce-support
Since QPT
1.1.78

Issue

Modifying a column with a foreign key via declarative schema on MariaDB fails due to foreign key constraint errors during setup upgrade.

Steps to reproduce

1. Go to Admin > Stores > Settings > Order Status. 1. Click Create New Status, enter test in all fields, and save. 1. Click Assign Status to State. 1. Set Order Status to test. 1. Set Order State to Received. 1. Save the assignment. 1. Create, register, and enable a custom module, and add the following to db_schema.xml: <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/etc/db_schema.xsd"> <table name="sales_order_status"> <column xsi:type="varchar" name="status" nullable="false" length="64" comment="Order Status"/> </table> <table name="sales_order_status_state"> <column xsi:type="varchar" name="status" nullable="false" length="64" comment="Order Status"/> </table> <table name="sales_order_status_label"> <column xsi:type="varchar" name="status" nullable="false" length="64" comment="Order Status"/> </table> </schema> 1. Run the following command: bin/magento setup:upgrade

Adobe's page lists 2.4.4 <2.4.8 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-60989. On Cloud, add ACSD-60989 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-60989/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/framework
Packages across compatible versions (1): magento/framework

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.