public function createOptimizerTable(SchemaSetupInterface $setup)
    {
        if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME))) {
            $table = $setup->getConnection()
                ->newTable($setup->getTable(OptimizerInterface::TABLE_NAME))
                ->addColumn(
                    OptimizerInterface::OPTIMIZER_ID,
                    \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
                    null,
                    ['identity' => true, 'nullable' => false, 'primary' => true],
                    'Optimizer ID'
                )
                ->addColumn(
                    OptimizerInterface::STORE_ID,
                    \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
                    null,
                    ['nullable' => false],
                    'Store id'
                )
                ->addColumn(
                    OptimizerInterface::IS_ACTIVE,
                    \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
                    null,
                    ['nullable' => false, 'default' => '1'],
                    'Is Optimizer Active'
                )
                ->addColumn(
                    OptimizerInterface::FROM_DATE,
                    \Magento\Framework\DB\Ddl\Table::TYPE_DATE,
                    null,
                    ['nullable' => true],
                    'Enable rule from date'
                )
                ->addColumn(
                    OptimizerInterface::TO_DATE,
                    \Magento\Framework\DB\Ddl\Table::TYPE_DATE,
                    null,
                    ['nullable' => true],
                    'Enable rule to date'
                )
                ->addColumn(
                    OptimizerInterface::NAME,
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    255,
                    ['nullable' => false],
                    'Optimizer Name'
                )
                ->addColumn(
                    OptimizerInterface::MODEL,
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    255,
                    [],
                    'Optimizer model'
                )
                ->addColumn(
                    OptimizerInterface::CONFIG,
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '',
                    [],
                    'Optimizer serialized configuration'
                )
                ->addColumn(
                    OptimizerInterface::RULE_CONDITION,
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '',
                    [],
                    'Optimizer rule condition configuration'
                )
                ->setComment('Search optimizer Table');

            $setup->getConnection()->createTable($table);
        }
    }