public function createOptimizerSearchContainerTable(SchemaSetupInterface $setup)
    {
        if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER))) {
            $table = $setup->getConnection()
                ->newTable($setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER))
                ->addColumn(
                    OptimizerInterface::OPTIMIZER_ID,
                    \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
                    null,
                    ['nullable' => false, 'primary' => true],
                    'Optimizer ID'
                )
                ->addColumn(
                    OptimizerInterface::SEARCH_CONTAINER,
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    255,
                    ['nullable' => false, 'primary' => true],
                    'Search Container'
                )
                ->addColumn(
                    'apply_to',
                    \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
                    null,
                    ['nullable' => false, 'default' => 0],
                    'If this optimizer applies to specific entities or not.'
                )
                ->addIndex(
                    $setup->getIdxName(OptimizerInterface::TABLE_NAME, [OptimizerInterface::SEARCH_CONTAINER]),
                    [OptimizerInterface::SEARCH_CONTAINER]
                )
                ->addForeignKey(
                    $setup->getFkName(
                        OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER,
                        OptimizerInterface::OPTIMIZER_ID,
                        OptimizerInterface::TABLE_NAME,
                        OptimizerInterface::OPTIMIZER_ID
                    ),
                    OptimizerInterface::OPTIMIZER_ID,
                    $setup->getTable(OptimizerInterface::TABLE_NAME),
                    OptimizerInterface::OPTIMIZER_ID,
                    \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
                )
                ->setComment('Query type per optimizer table');

            $setup->getConnection()->createTable($table);
        }
    }
public function createOptimizerSearchContainerTable(SchemaSetupInterface $setup)
    {
        if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER))) {
            $table = $setup->getConnection()
                ->newTable($setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER))
                ->addColumn(
                    OptimizerInterface::OPTIMIZER_ID,
                    \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
                    null,
                    ['nullable' => false, 'primary' => true],
                    'Optimizer ID'
                )
                ->addColumn(
                    OptimizerInterface::SEARCH_CONTAINER,
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    255,
                    ['nullable' => false, 'primary' => true],
                    'Search Container'
                )
                ->addColumn(
                    'apply_to',
                    \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
                    null,
                    ['nullable' => false, 'default' => 0],
                    'If this optimizer applies to specific entities or not.'
                )
                ->addIndex(
                    $setup->getIdxName(OptimizerInterface::TABLE_NAME, [OptimizerInterface::SEARCH_CONTAINER]),
                    [OptimizerInterface::SEARCH_CONTAINER]
                )
                ->addForeignKey(
                    $setup->getFkName(
                        OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER,
                        OptimizerInterface::OPTIMIZER_ID,
                        OptimizerInterface::TABLE_NAME,
                        OptimizerInterface::OPTIMIZER_ID
                    ),
                    OptimizerInterface::OPTIMIZER_ID,
                    $setup->getTable(OptimizerInterface::TABLE_NAME),
                    OptimizerInterface::OPTIMIZER_ID,
                    \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
                )
                ->setComment('Query type per optimizer table');

            $setup->getConnection()->createTable($table);
        }
    }
public function createOptimizerSearchContainerTable ( SchemaSetupInterface $ setup ) { if ( ! $ setup -> getConnection ( ) -> isTableExists ( $ setup -> getTable ( OptimizerInterface :: TABLE_NAME_SEARCH_CONTAINER ) ) ) { $ table = $ setup -> getConnection ( ) -> newTable ( $ setup -> getTable ( OptimizerInterface :: TABLE_NAME_SEARCH_CONTAINER ) ) -> addColumn ( OptimizerInterface :: OPTIMIZER_ID , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_SMALLINT , null , [ 'nullable' => false , 'primary' => true ] , 'Optimizer ID' ) -> addColumn ( OptimizerInterface :: SEARCH_CONTAINER , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_TEXT , 255 , [ 'nullable' => false , 'primary' => true ] , 'Search Container' ) -> addColumn ( 'apply_to' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_BOOLEAN , null , [ 'nullable' => false , 'default' => 0 ] , 'If this optimizer applies to specific entities or not.' ) -> addIndex ( $ setup -> getIdxName ( OptimizerInterface :: TABLE_NAME , [ OptimizerInterface :: SEARCH_CONTAINER ] ) , [ OptimizerInterface :: SEARCH_CONTAINER ] ) -> addForeignKey ( $ setup -> getFkName ( OptimizerInterface :: TABLE_NAME_SEARCH_CONTAINER , OptimizerInterface :: OPTIMIZER_ID , OptimizerInterface :: TABLE_NAME , OptimizerInterface :: OPTIMIZER_ID ) , OptimizerInterface :: OPTIMIZER_ID , $ setup -> getTable ( OptimizerInterface :: TABLE_NAME ) , OptimizerInterface :: OPTIMIZER_ID , \ Magento \ Framework \ DB \ Ddl \ Table :: ACTION_CASCADE ) -> setComment ( 'Query type per optimizer table' ) ; $ setup -> getConnection ( ) -> createTable ( $ table ) ; } }
Create Optimizer Query table.

@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance
Create Optimizer Query table .