-1

I try to change the type of the field customer_note in the quote table from varchar to text. I went the declarative way:

VendorName/Module/etc/db_schema.xml:

<?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="quote" >
        <column xsi:type="text" name="customer_note" />
    </table>
</schema>

Then I try the CLI command

bin/magento setup:db-declaration:generate-whitelist --module-name=VendorName_Module

The result:

Invalid Document
Element 'column', attribute 'length': The attribute 'length' is not allowed. 
Line: 59

The "Line 59" is inside the db_schema.xml in the "Quote" module of the org. magento 2 sources. Is this a known bug and is there any known work around for this? Or did I do something wrong?

Add info: my module.xml contains a

   <sequence>
        <module name="Magento_Quote"/>
   </sequence>
0

I solved it myself. There is an official bug report: https://github.com/magento/magento2/issues/26155

The bug is solved in the current 2.4.1 release. But just in the way, that they changed the 'Quote' db-schema.xml.

Well, that is nice, but did why did the official way using the declarative way did not work?

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.