Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (version_compare($context->getVersion(), '1.1.10', '<=')) {
- $installer = $setup;
- $installer->startSetup();
- // Get tutorial_simplenews table
- $tableName = $installer->getTable('blog_post');
- // Check if the table already exists
- if ($installer->getConnection()->isTableExists($tableName) != true) {
- // Create tutorial_simplenews table
- $table = $installer->getConnection()
- ->newTable($tableName)
- ->addColumn(
- 'id',
- Table::TYPE_INTEGER,
- [
- 'identity' => true,
- 'unsigned' => true,
- 'nullable' => false,
- 'primary' => true
- ],
- 'ID'
- )
- ->addColumn(
- 'docid',
- Table::TYPE_TEXT,
- 255,
- ['nullable' => false, 'default' => ''],
- 'docid'
- )
- ->addColumn(
- 'order_status',
- Table::TYPE_TEXT,
- 255,
- ['nullable' => false, 'default' => ''],
- 'Order Status'
- )
- ->addColumn(
- 'order_code',
- Table::TYPE_TEXT,
- 255,
- ['nullable' => false, 'default' => ''],
- 'Order Code'
- )
- ->addColumn(
- 'order_id',
- Table::TYPE_TEXT,
- 255,
- ['nullable' => false, 'default' => ''],
- 'Order Id'
- )
- ->addColumn(
- 'created_at',
- Table::TYPE_DATETIME,
- ['nullable' => false,'default' => MagentoFrameworkDBDdlTable::TIMESTAMP_INIT_UPDATE],
- 'Created At'
- )
- ->addColumn(
- 'update_at',
- Table::TYPE_DATETIME,
- ['nullable' => false, 'default' => ''],
- 'Updated At'
- )
- ->setComment('dfdfd')
- ->setOption('type', 'InnoDB')
- ->setOption('charset', 'utf8');
- $installer->getConnection()->createTable($table);
- }
- $installer->endSetup();
- }
- Warning: array_key_exists() expects parameter 2 to be array, string given i
- n /var/www/html/readyresale_beta/vendor/magento/framework/DB/Ddl/Table.php
- on line 352
- $installer = $setup;
- $installer->startSetup();
- if (version_compare($context->getVersion(), '1.1.10') < 0) {
- // Get module table
- $tableName = $installer->getTable('blog_post');
- // Check if the table already exists
- if ($installer->getConnection()->isTableExists($tableName) == true) {
- // Declare data
- $columns = array(
- 'id' => array(
- 'type' => Table::TYPE_INTEGER,
- 'size' => null,
- 'options' => array('nullable' => false, 'default' => ''),
- 'comment' => 'Id',
- ),
- 'docid' => array(
- 'type' => Table::TYPE_INTEGER,
- 'size' => null,
- 'options' => array('nullable' => true, 'default' => ''),
- 'comment' => 'Docid',
- ),
- // Do the same for the other...
- );
- $connection = $installer->getConnection();
- foreach ($columns as $name => $definition) {
- $connection->addColumn($tableName, $name, $definition);
- }
- }
- }
Add Comment
Please, Sign In to add comment