Created
December 13, 2016 13:53
-
-
Save eperrotta/84d75d5ca8323faa8259644efa613853 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Training\Render\Setup; | |
use Magento\Framework\Setup\InstallSchemaInterface; | |
use Magento\Framework\Setup\ModuleContextInterface; | |
use Magento\Framework\Setup\SchemaSetupInterface; | |
class InstallSchema implements InstallSchemaInterface | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) | |
{ | |
$installer = $setup; | |
$installer->startSetup(); | |
/** | |
* Create table 'training_vendor_entity' | |
*/ | |
$table = $installer->getConnection()->newTable( | |
$installer->getTable('training_vendor_entity') | |
)->addColumn( | |
'vendor_id', | |
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, | |
null, | |
['identity' => true, 'nullable' => false, 'primary' => true], | |
'Block ID' | |
)->addColumn( | |
'name', | |
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | |
255, | |
['nullable' => false], | |
'Vendor Name' | |
)->addColumn( | |
'email', | |
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | |
255, | |
['nullable' => false], | |
'Vendor Email' | |
)->addColumn( | |
'creation_time', | |
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, | |
null, | |
[], | |
'Vendor Creation Time' | |
)->addColumn( | |
'update_time', | |
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, | |
null, | |
[], | |
'Vendor Modification Time' | |
)->addColumn( | |
'is_active', | |
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, | |
null, | |
['nullable' => false, 'default' => '1'], | |
'Is Vendor Active' | |
)->setComment( | |
'Vendor Table' | |
); | |
$installer->getConnection()->createTable($table); | |
$installer->endSetup(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> | |
<module name="Training_Render" setup_version="0.1.0"/> | |
</config> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\Magento\Framework\Component\ComponentRegistrar::register( | |
\Magento\Framework\Component\ComponentRegistrar::MODULE, | |
'Training_Render', | |
__DIR__ | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment