ACSD-60989: 선언적 스키마를 통해 외래 키가 있는 열을 수정하면 MariaDB에 오류가 발생합니다.
ACSD-60989 패치는 MariaDB에서 선언적 스키마를 통해 외래 키로 열을 수정하면 외래 키 제약 조건으로 인해 설치 업그레이드 오류가 발생하는 문제를 해결합니다. 이 패치는 Quality Patches Tool (QPT) 1.1.78이 설치된 경우에 사용할 수 있습니다. 패치 ID는 ACSD-60989입니다. 이 문제는 Adobe Commerce 2.4.8에서 해결되었습니다.
영향을 받는 제품 및 버전
Adobe Commerce 버전에 대한 패치가 만들어졌습니다.
- Adobe Commerce(모든 배포 방법) 2.4.6-p6
Adobe Commerce 버전과 호환:
- Adobe Commerce(모든 배포 방법) >=2.4.4 <2.4.8
NOTE
새 Quality Patches Tool 릴리스가 있는 다른 버전에 패치를 적용할 수 있습니다. 패치가 Adobe Commerce 버전과 호환되는지 확인하려면
magento/quality-patches 패키지를 최신 버전으로 업데이트하고 Quality Patches Tool에서 호환성을 확인합니다. 패치 검색 페이지. 패치 ID를 검색 키워드로 사용하여 패치를 찾습니다.문제
설치 업그레이드 중 외래 키 제약 조건 오류로 인해 MariaDB에서 선언 스키마를 통해 외래 키가 있는 열을 수정하지 못했습니다.
재현 단계:
-
Admin > Stores > Settings > Order Status(으)로 이동합니다.
-
Create New Status을(를) 클릭하고 모든 필드에 test을(를) 입력한 다음 저장합니다.
-
Assign Status to State을(를) 클릭합니다.
- Order Status을(를) test(으)로 설정합니다.
- Order State을(를) 받음(으)로 설정합니다.
- 할당을 저장합니다.
-
사용자 지정 모듈을 만들고, 등록하고, 사용하도록 설정하고,
db_schema.xml에 다음을 추가하십시오.code language-none <?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> -
다음 명령을 실행합니다.
code language-none bin/magento setup:upgrade
예상 결과:
설치 업그레이드가 외래 키 제한 오류 없이 성공적으로 완료되었습니다.
실제 결과:
설치 업그레이드 도중 오류 발생:
Unable to apply patch Vendor\Sales\Setup\Patch\Schema\DataPatch for module Vendor_Sales.
Original exception message:
SQLSTATE[HY000]: General error: 1833 Cannot change column 'status': used in a foreign key constraint
'SALES_ORDER_STATUS_LABEL_STATUS_SALES_ORDER_STATUS_STATUS'
of table 'sales_order_status_label'
패치 적용
개별 패치를 적용하려면 배포 방법에 따라 다음 링크를 사용합니다.
- Adobe Commerce 또는 Magento Open Source 온-프레미스: Quality Patches Tool 가이드의 Quality Patches Tool > 사용량
- 클라우드 인프라의 Adobe Commerce: Commerce on Cloud Infrastructure 안내서의 업그레이드 및 패치 > 패치 적용.
관련 읽기
Quality Patches Tool에 대한 자세한 내용은 다음을 참조하세요.
recommendation-more-help
commerce-operations-help-tools