init
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
namespace WeltPixel\Backend\Setup\Patch\Schema;
|
||||
|
||||
use Magento\Framework\Setup\SchemaSetupInterface;
|
||||
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
|
||||
use Magento\Framework\Setup\Patch\PatchVersionInterface;
|
||||
|
||||
class AddLicenseTable implements SchemaPatchInterface, PatchVersionInterface
|
||||
{
|
||||
/**
|
||||
* @var SchemaSetupInterface $schemaSetup
|
||||
*/
|
||||
private $schemaSetup;
|
||||
|
||||
/**
|
||||
* @param SchemaSetupInterface $schemaSetup
|
||||
*/
|
||||
public function __construct(SchemaSetupInterface $schemaSetup)
|
||||
{
|
||||
$this->schemaSetup = $schemaSetup;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function apply()
|
||||
{
|
||||
$installer = $this->schemaSetup;
|
||||
$this->schemaSetup->startSetup();
|
||||
|
||||
/**
|
||||
* Create table 'weltpixel_license'
|
||||
*/
|
||||
$table = $installer->getConnection()->newTable(
|
||||
$installer->getTable('weltpixel_license')
|
||||
)->addColumn(
|
||||
'id',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
|
||||
null,
|
||||
['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
|
||||
'Id'
|
||||
)->addColumn(
|
||||
'module_name',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
|
||||
255,
|
||||
[],
|
||||
'Module Name'
|
||||
)->addColumn(
|
||||
'license_key',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
|
||||
1024,
|
||||
[],
|
||||
'License Key'
|
||||
)->setComment(
|
||||
'WeltPixel License'
|
||||
);
|
||||
|
||||
$installer->getConnection()->createTable($table);
|
||||
$this->schemaSetup->endSetup();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function getVersion()
|
||||
{
|
||||
return '1.1.1';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getAliases()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function getDependencies()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user