Skip to main content
added 467 characters in body
Source Link
Rutvee Sojitra
  • 3.9k
  • 2
  • 22
  • 59

module.xmlmodule.xml

 <?xml version="1.0"?> <!-- /** * Copyright © Krish TechnoLabs, All rights reserved. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Ktpl_Test1" setup_version="1.0.0"> <sequence> <module name="Magento_Eav"/> </sequence> </module> </config> 

db_schema.xml

module.xml

module.xml

 <?xml version="1.0"?> <!-- /** * Copyright © Krish TechnoLabs, All rights reserved. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Ktpl_Test1" setup_version="1.0.0"> <sequence> <module name="Magento_Eav"/> </sequence> </module> </config> 

db_schema.xml

added 1594 characters in body
Source Link
Rutvee Sojitra
  • 3.9k
  • 2
  • 22
  • 59

I have follow this documnet https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html but not get success

module.xml

 <?xml version="1.0"?> <!-- /* * Copyright © 2019 Krish Technolabs. All rights reserved. * See COPYING.txt for license details */ --> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> <table comment="Test Table 1" engine="innodb" name="ktpl_test1" resource="default"> <column identity="true" name="test1_id" nullable="false" padding="10" unsigned="true" xsi:type="int"/> <column name="test_name" nullable="false" padding="10" unsigned="true" xsi:type="int"/> <column name="test2_id" nullable="false" padding="10" unsigned="true" xsi:type="int"/> <constraint referenceId="PRIMARY" xsi:type="primary"> <column name="test1_id"/> </constraint> <constraint xsi:type="foreign" referenceId="Test12ID" table="ktpl_test1" column="test2_id" referenceTable ="ktpl_test2" referenceColumn="test2_id"/> <constraint xsi:type="foreign" referenceId="Test13ID" table="ktpl_test1" column="test3_id" referenceTable ="ktpl_test3" referenceColumn="test3_id"/> </table> <table name="eav_attribute" resource="default" engine="innodb" comment="Eav Attribute"> <column xsi:type="mediumtext" name="note" nullable="false" length="500" comment="Note"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="attribute_id"/> </constraint> </table> </schema> 

I have follow this documnet https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html but not get success

module.xml

 <?xml version="1.0"?> <!-- /* * Copyright © 2019 Krish Technolabs. All rights reserved. * See COPYING.txt for license details */ --> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> <table comment="Test Table 1" engine="innodb" name="ktpl_test1" resource="default"> <column identity="true" name="test1_id" nullable="false" padding="10" unsigned="true" xsi:type="int"/> <column name="test_name" nullable="false" padding="10" unsigned="true" xsi:type="int"/> <column name="test2_id" nullable="false" padding="10" unsigned="true" xsi:type="int"/> <constraint referenceId="PRIMARY" xsi:type="primary"> <column name="test1_id"/> </constraint> <constraint xsi:type="foreign" referenceId="Test12ID" table="ktpl_test1" column="test2_id" referenceTable ="ktpl_test2" referenceColumn="test2_id"/> <constraint xsi:type="foreign" referenceId="Test13ID" table="ktpl_test1" column="test3_id" referenceTable ="ktpl_test3" referenceColumn="test3_id"/> </table> <table name="eav_attribute" resource="default" engine="innodb" comment="Eav Attribute"> <column xsi:type="mediumtext" name="note" nullable="false" length="500" comment="Note"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="attribute_id"/> </constraint> </table> </schema> 
Add new tag
Link
Rohan Hapani
  • 17.6k
  • 9
  • 57
  • 99
Source Link
Rutvee Sojitra
  • 3.9k
  • 2
  • 22
  • 59
Loading