magento 2 - modify db_schema.xml field length

Magento Asked by Sairaj Gadekar on September 4, 2020

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

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

And your module should depend on Magento_CatalogRule

<?xml version="1.0"?>
<config xmlns:xsi="" 
    <module name="{VendorName_ModuleName}">
            <module name="Magento_CatalogRule"/>

Correct answer by Amit Bera on September 4, 2020

Add your own answers!

Related Questions

Create quick order form at product page

0  Asked on July 29, 2020 by faraz-bashir


How to Special price based on attribute?

2  Asked on July 26, 2020 by user90560


is creating block within template in magento 2 good practice

0  Asked on July 24, 2020 by herve-tribouilloy


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP