public function createPositionTable(SchemaSetupInterface $setup)
    {
        /**
         * Create table 'smile_virtualcategory_catalog_category_product_position'
         */
        $tableName = 'smile_virtualcategory_catalog_category_product_position';
        $table = $setup->getConnection()
            ->newTable($setup->getTable($tableName))
            ->addColumn(
                'category_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                ['unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'],
                'Category ID'
            )
            ->addColumn(
                'product_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                ['unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'],
                'Product ID'
            )
            ->addColumn(
                'store_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
                null,
                ['unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'],
                'Store ID'
            )
            ->addColumn(
                'position',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                ['nullable' => true],
                'Position'
            )
            ->addColumn(
                'is_blacklisted',
                \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
                null,
                ['nullable' => false, 'default' => '0'],
                'If the product is blacklisted'
            )
            ->addIndex($setup->getIdxName($tableName, ['product_id']), ['product_id'])
            ->addForeignKey(
                $setup->getFkName($tableName, 'category_id', 'catalog_category_entity', 'entity_id'),
                'category_id',
                $setup->getTable('catalog_category_entity'),
                'entity_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
            )
            ->addForeignKey(
                $setup->getFkName($tableName, 'product_id', 'catalog_product_entity', 'entity_id'),
                'product_id',
                $setup->getTable('catalog_product_entity'),
                'entity_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
            )
            ->addForeignKey(
                $setup->getFkName($tableName, 'store_id', 'store', 'store_id'),
                'store_id',
                $setup->getTable('store'),
                'store_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
            )
            ->setComment('Catalog product position for the virtual categories module.');

        $setup->getConnection()->createTable($table);
    }
public function createPositionTable(SchemaSetupInterface $setup)
    {
        /**
         * Create table 'smile_virtualcategory_catalog_category_product_position'
         */
        $tableName = 'smile_virtualcategory_catalog_category_product_position';
        $table = $setup->getConnection()
            ->newTable($setup->getTable($tableName))
            ->addColumn(
                'category_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                ['unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'],
                'Category ID'
            )
            ->addColumn(
                'product_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                ['unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'],
                'Product ID'
            )
            ->addColumn(
                'store_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
                null,
                ['unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'],
                'Store ID'
            )
            ->addColumn(
                'position',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                ['nullable' => true],
                'Position'
            )
            ->addColumn(
                'is_blacklisted',
                \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
                null,
                ['nullable' => false, 'default' => '0'],
                'If the product is blacklisted'
            )
            ->addIndex($setup->getIdxName($tableName, ['product_id']), ['product_id'])
            ->addForeignKey(
                $setup->getFkName($tableName, 'category_id', 'catalog_category_entity', 'entity_id'),
                'category_id',
                $setup->getTable('catalog_category_entity'),
                'entity_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
            )
            ->addForeignKey(
                $setup->getFkName($tableName, 'product_id', 'catalog_product_entity', 'entity_id'),
                'product_id',
                $setup->getTable('catalog_product_entity'),
                'entity_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
            )
            ->addForeignKey(
                $setup->getFkName($tableName, 'store_id', 'store', 'store_id'),
                'store_id',
                $setup->getTable('store'),
                'store_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
            )
            ->setComment('Catalog product position for the virtual categories module.');

        $setup->getConnection()->createTable($table);
    }
public function createPositionTable ( SchemaSetupInterface $ setup ) { /**
         * Create table 'smile_virtualcategory_catalog_category_product_position'
         */ $ tableName = 'smile_virtualcategory_catalog_category_product_position' ; $ table = $ setup -> getConnection ( ) -> newTable ( $ setup -> getTable ( $ tableName ) ) -> addColumn ( 'category_id' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_INTEGER , null , [ 'unsigned' => true , 'nullable' => false , 'primary' => true , 'default' => '0' ] , 'Category ID' ) -> addColumn ( 'product_id' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_INTEGER , null , [ 'unsigned' => true , 'nullable' => false , 'primary' => true , 'default' => '0' ] , 'Product ID' ) -> addColumn ( 'store_id' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_SMALLINT , null , [ 'unsigned' => true , 'nullable' => false , 'primary' => true , 'default' => '0' ] , 'Store ID' ) -> addColumn ( 'position' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_INTEGER , null , [ 'nullable' => true ] , 'Position' ) -> addColumn ( 'is_blacklisted' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_BOOLEAN , null , [ 'nullable' => false , 'default' => '0' ] , 'If the product is blacklisted' ) -> addIndex ( $ setup -> getIdxName ( $ tableName , [ 'product_id' ] ) , [ 'product_id' ] ) -> addForeignKey ( $ setup -> getFkName ( $ tableName , 'category_id' , 'catalog_category_entity' , 'entity_id' ) , 'category_id' , $ setup -> getTable ( 'catalog_category_entity' ) , 'entity_id' , \ Magento \ Framework \ DB \ Ddl \ Table :: ACTION_CASCADE ) -> addForeignKey ( $ setup -> getFkName ( $ tableName , 'product_id' , 'catalog_product_entity' , 'entity_id' ) , 'product_id' , $ setup -> getTable ( 'catalog_product_entity' ) , 'entity_id' , \ Magento \ Framework \ DB \ Ddl \ Table :: ACTION_CASCADE ) -> addForeignKey ( $ setup -> getFkName ( $ tableName , 'store_id' , 'store' , 'store_id' ) , 'store_id' , $ setup -> getTable ( 'store' ) , 'store_id' , \ Magento \ Framework \ DB \ Ddl \ Table :: ACTION_CASCADE ) -> setComment ( 'Catalog product position for the virtual categories module.' ) ; $ setup -> getConnection ( ) -> createTable ( $ table ) ; }
Create table containing position of products in virtual categories.

@param SchemaSetupInterface $setup Schema Setup Interface
Create table containing position of products in virtual categories .