Let’s initiate a discussion!!
Magento 2.4 version have given feature to add table using declarative schema.
Module name : Magemonkeys_Core
We need to create db_schema.xml file in the app/code/Magemonkeys/Core/etc/ folder
1 2 3 4 5 6 7 8 9 10 11 |
<?xml version="1.0" encoding="UTF-8"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> <table name="customtable" resource="default" engine="innodb" comment="Custom table"> <column xsi:type="smallint" name="id" unsigned="false" nullable="false" identity="true" comment="ID" /> <column xsi:type="varchar" name="name" nullable="false" length="20" comment="Name" /> <column xsi:type="varchar" name="email" nullable="false" length="20" comment="Email" /> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="id" /> </constraint> </table> </schema> |
After that, we need to generate db white list schema json
For that, we need to run command as per below
1 |
php bin/magento setup:db-declaration:generate-whitelist --module-name=Magemonkeys_Core |
After that we need to run setup:upgrade and cache:flush command
That’s it.
[crayon-642168b514607767462724/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.