-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ZAI-229] Remove UpgradeSchema.php; Create InstallSchema.php & Uninst…
…all.php scripts. Update version number.
- Loading branch information
Showing
5 changed files
with
133 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
|
||
|
||
namespace Zaius\Engage\Setup; | ||
|
||
use Magento\Framework\Setup\InstallSchemaInterface; | ||
use Magento\Framework\Setup\ModuleContextInterface; | ||
use Magento\Framework\Setup\SchemaSetupInterface; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
class InstallSchema implements InstallSchemaInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) | ||
*/ | ||
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) | ||
{ | ||
/** | ||
* Create table 'zaius_job' | ||
*/ | ||
$table = $setup->getConnection() | ||
->newTable($setup->getTable('zaius_job')) | ||
->addColumn( | ||
'id', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, | ||
null, | ||
['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], | ||
'id' | ||
) | ||
->addColumn( | ||
'handler', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | ||
null, | ||
['nullable' => false], | ||
'handler' | ||
) | ||
->addColumn( | ||
'queue', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | ||
255, | ||
['nullable' => false, 'default' => 'default'], | ||
'queue' | ||
) | ||
->addColumn( | ||
'attempts', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, | ||
null, | ||
['unsigned' => true, 'nullable' => false, 'default' => 0], | ||
'attempts' | ||
) | ||
->addColumn( | ||
'run_at', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_DATETIME, | ||
null, | ||
['nullable' => true], | ||
'run_at' | ||
) | ||
->addColumn( | ||
'locked_at', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_DATETIME, | ||
null, | ||
['nullable' => true], | ||
'locked_at' | ||
) | ||
->addColumn( | ||
'locked_by', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | ||
255, | ||
['nullable' => true], | ||
'locked_by' | ||
) | ||
->addColumn( | ||
'failed_at', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_DATETIME, | ||
null, | ||
['nullable' => true], | ||
'failed_at' | ||
) | ||
->addColumn( | ||
'error', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | ||
null, | ||
['nullable' => true], | ||
'error' | ||
) | ||
->addColumn( | ||
'created_at', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_DATETIME, | ||
null, | ||
['nullable' => false], | ||
'created_at' | ||
)->setComment("Zaius Job Table"); | ||
$setup->getConnection()->createTable($table); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
|
||
namespace Zaius\Engage\Setup; | ||
|
||
use Magento\Framework\Setup\ModuleContextInterface; | ||
use Magento\Framework\Setup\SchemaSetupInterface; | ||
use Magento\Framework\Setup\UninstallInterface as UninstallInterface; | ||
/** | ||
* Class Uninstall | ||
*/ | ||
class Uninstall implements UninstallInterface | ||
{ | ||
/** | ||
* Atwix Sample Table Name | ||
*/ | ||
const ZAIUS_JOB = 'zaius_job'; | ||
/** | ||
* Invoked when remove-data flag is set during module uninstall | ||
* | ||
* @param SchemaSetupInterface $setup | ||
* @param ModuleContextInterface $context | ||
* | ||
* @return void | ||
*/ | ||
public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context) | ||
{ | ||
$setup->startSetup(); | ||
$connection = $setup->getConnection(); | ||
$connection->dropTable($connection->getTableName(self::ZAIUS_JOB)); | ||
$setup->endSetup(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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