for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace IntegerNet\AsyncVarnish\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;
class InstallSchema implements InstallSchemaInterface
{
/**
* @param SchemaSetupInterface $setup
* @param ModuleContextInterface $context
* @throws \Zend_Db_Exception
*/
public function install( //phpcs:ignore
SchemaSetupInterface $setup,
ModuleContextInterface $context
) {
$setup->startSetup();
$this->createTagsTable($setup);
$setup->endSetup();
}
private function createTagsTable(SchemaSetupInterface $setup)
$tableName = $setup->getTable('integernet_async_varnish_tags');
if (!$setup->getConnection()->isTableExists($tableName)) {
$table = $setup->getConnection()
->newTable($tableName)
->addColumn(
'entity_id',
Table::TYPE_INTEGER,
null,
[
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true
],
'Entity ID'
)
'tag',
Table::TYPE_TEXT,
['nullable' => false, 'default' => ''],
'Tag'
->setComment('Keeps track of cache tags that need to be purged')
->setOption('charset', 'utf8');
$setup->getConnection()->createTable($table);