0

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

  • Could you share the code with overided file path.. – aravind Oct 30 '19 at 4:49
  • @aravind, I just have copied the file from vendor\module-customer\etc\db_schema.xml to my custom moulde <NAMESPACE>\<MODULE>\etc\db_schema.xml and did necessary changes regarding constrants, is any thing else I need to do ? – amit_game Oct 30 '19 at 4:54
  • NO this is the way..Have you run the whitelist command? – aravind Oct 30 '19 at 4:57
  • @aravind, I run command and the changes made I can see their in file, but still no hope. – amit_game Oct 30 '19 at 4:58
  • In which table did you change the constraint?and column name? – aravind Oct 30 '19 at 5:00
0

After setting disabled="true" to the constraint, run generate whitelist command and upgrade.

<?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">
<table name="customer_entity" resource="default" engine="innodb" comment="Customer Entity">    
<constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_EMAIL_WEBSITE_ID" disabled="true" />        
</table>
</schema>
  • Could you Check now..I have updated the answer.. – aravind Oct 30 '19 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.