How To Add a column in quote_payment table In Magento2 - Magento Source24

 How To Add a column in quote_payment table In Magento2


Follow Bellow Steps To Add a column in quote_payment table In Magento2 : 

👉 Create a file db_schema.xml file in Vendor\Extension\etc\db_schema.xml Folder : 

I'm added a new column paymentpocomment in sales_order_payment table using db_schema : 


<?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_payment" resource="checkout" engine="innodb" comment="Sales Flat Quote Payment">

        <column xsi:type="text" name="paymentpocomment" nullable="true" comment="PO Comment"/>

    </table>

</schema>


👉  After Done Above Code then Run Bellow Command - 

  1. php bin/magento setup:upgrade 
  2. php bin/magento setup:static-content:deploy -f 
  3. php bin/magento cache:flush


👉   and check your quote_payment Databse table : your column is here


Deepak Kumar Bind

Success is peace of mind, which is a direct result of self-satisfaction in knowing you made the effort to become the best of which you are capable.

Post a Comment

If you liked this post please do not forget to leave a comment. Thanks

Previous Post Next Post