for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tkotosz\CommandScheduler\Setup\Schema;
use Tkotosz\CommandScheduler\Ddl\CommandScheduleTable;
use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\Setup\SchemaSetupInterface;
class CommandScheduleTableManager
{
public function createTable(SchemaSetupInterface $setup)
$table = $setup->getConnection()->newTable($setup->getTable('tkotosz_command_schedule'));
$table
->addColumn(
CommandScheduleTable::COLUMN_SCHEDULE_ID,
Table::TYPE_INTEGER,
null,
['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true]
)
CommandScheduleTable::COLUMN_COMMAND_NAME,
Table::TYPE_TEXT, 256,
['nullable' => false],
'Command Name'
CommandScheduleTable::COLUMN_COMMAND_PARAMS,
Table::TYPE_TEXT,
'Command Params'
CommandScheduleTable::COLUMN_STATUS,
256,
'Status'
CommandScheduleTable::COLUMN_RESULT,
['nullable' => true],
'Result'
CommandScheduleTable::COLUMN_SCHEDULED_AT,
Table::TYPE_TIMESTAMP,
['nullable' => false, 'default' => Table::TIMESTAMP_INIT],
'Scheduled At'
CommandScheduleTable::COLUMN_UPDATED_AT,
['nullable' => false, 'default' => Table::TIMESTAMP_INIT_UPDATE],
'Updated At'
;
$setup->getConnection()->createTable($table);
}