I have this db_schema.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<!-- Setup table vendor_shipping_option -->
<table name="vendor_shipping_option" resource="default" engine="innodb">
<column name="rate_id" xsi:type="int" padding="10" unsigned="true" nullable="false" identity="true" comment="Entity ID" />
<column name="name" xsi:type="varchar" length="255" nullable="true" comment="Name" />
<column name="description" xsi:type="text" nullable="true" comment="Description" />
<column name="type" xsi:type="varchar" length="255" nullable="true" comment="Type" />
<column name="source" xsi:type="varchar" length="255" nullable="true" comment="Source" />
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="rate_id" />
</constraint>
<constraint xsi:type="foreign" referenceId="VENDORSHIPPING_SOURCE_INVENTORY_SOURCE_SOURCE_CODE" table="vendor_shipping_option" column="source" referenceTable="inventory_source" referenceColumn="source_code" onDelete="CASCADE" />
</table>
<!-- Setup table vendor_shipping_click_and_collect_availability -->
<table name="vendor_shipping_click_and_collect_availability" resource="default" engine="innodb">
<column name="rate_id" xsi:type="int" padding="10" unsigned="true" nullable="false" comment="Entity ID" />
<column name="click_and_collect_window_id" xsi:type="int" padding="10" unsigned="true" nullable="true" comment="Click And Collect Window Id"/>
<column name="day" xsi:type="varchar" length="255" nullable="true" comment="Day" />
<column name="delivery_hours" xsi:type="varchar" length="255" nullable="true" comment="Delivery Hours" />
<column name="start" xsi:type="datetime" on_update="false" nullable="true" comment="Start"/>
<column name="end" xsi:type="datetime" on_update="false" nullable="true" comment="End"/>
<constraint xsi:type="foreign" referenceId="VENDORSHIPPING_CAC_AVAI_RATE_ID_VENDORSHIPPING_RATE_ID" table="vendor_shipping_click_and_collect_availability" column="rate_id" referenceTable="vendor_shipping_option" referenceColumn="rate_id" onDelete="CASCADE" />
</table>
</schema>
Then i run setup command, and in db i got foreign key VENDORSHIPPING_CAC_AVAI_RATE_ID_VENDORSHIPPING_RATE_ID
changed to FK_A9DDDF3AAD5A318C723BEEE21737E6A0
.
Does anyone know how to resolve this problem?