InsideDarkWeb.com

magento 2 - modify db_schema.xml field length

I want to change the length of action_operator field to 50 character in catalogrule_product table

<column xsi:type="varchar" name="action_operator" nullable="true" length="10" default="to_fixed"
                comment="Action Operator"/>

how to override the db_schema.xml
Please help

Magento Asked by Sairaj Gadekar on September 4, 2020

1 Answers

One Answer

You change that Field length from Custom module.

Create db_schema.xml at your module and add below code:

<?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="catalogrule_product" resource="default" >
<column xsi:type="varchar" name="action_operator" nullable="true" length="50" default="to_fixed"
                comment="Action Operator"/>
    </table>
</schema>

And your module should depend on Magento_CatalogRule

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="{VendorName_ModuleName}">
        <sequence>
            <module name="Magento_CatalogRule"/>
        </sequence>
    </module>
</config>

Correct answer by Amit Bera on September 4, 2020

Add your own answers!

Related Questions

Special Price suddenly not showing

1  Asked on January 23, 2021 by dickson

 

How to activate product navigation in Magento 2?

2  Asked on January 22, 2021 by morison

     

Quote with no items – add to cart error

1  Asked on January 22, 2021 by fra

     

Magento 2 get cart items in block class

1  Asked on January 20, 2021 by khooshbu-patel

   

Magento custom option text field max length

1  Asked on January 19, 2021 by k-i

 

How to show downloadable links in a block?

0  Asked on January 16, 2021 by kamzata

     

Magento tax_class_id not importing

1  Asked on January 15, 2021 by sushivam

     

How to add firebase cdn’s in magento2?

0  Asked on January 15, 2021 by usama-sohail

   

Paypal log error

1  Asked on January 14, 2021 by fja3omega

     

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.