Magento 2.3 : Remove Constraint from db_schema.xml file
-
17-03-2021 - |
Question
I just try to override db_schema.xml
file of a core customer module into my custom module , but there is no success.
I need to remove a constraint defined in customer db_schema.xml
file, how may I do that.
Thanks
Solution
After setting disabled="true"
to the constraint, run generate whitelist command and upgrade.
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="customer_entity">
<constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_EMAIL_WEBSITE_ID" disabled="true" />
</table>
</schema>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange