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

Add same product to quote as a separate item in Magento 2

1  Asked on December 1, 2020 by chirag-dodia


How to Add Html Link Additional Options in Magento 2.3.3

1  Asked on November 30, 2020 by kanchi_1695


How to create a Grid View Slider. Magento 2

1  Asked on November 29, 2020 by asad-khan


Magento 2 Get all attributes option in phtml

3  Asked on November 29, 2020 by user1799722


magento 1.9, export data from grid to csv file

0  Asked on November 29, 2020 by denys-maksiura


magento admin login not working

3  Asked on November 28, 2020 by nitesh-kumar-singh


Magento 2.3 How to edit existing Order without cancel?

0  Asked on November 28, 2020 by rajesh-stanley


Ask a Question

Get help from others!

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