public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        if (version_compare($context->getVersion(), "1.1.0") < 0) {
            $setup->startSetup();

            $logTable = $setup->getConnection()->newTable($setup->getTable('elasticsuite_tracker_log_event'))
                ->addColumn(
                    'event_id',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '32',
                    ['nullable' => false, 'primary' => true],
                    'Event Id'
                )
                ->addColumn(
                    'date',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
                    null,
                    ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT],
                    'Event date'
                )
                ->addColumn(
                    'data',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '2M',
                    ['nullable' => false],
                    'Event data'
                )
                ->addColumn(
                    'data',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '2M',
                    ['nullable' => false],
                    'Event data'
                );

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

        if (version_compare($context->getVersion(), '1.2.0', '<')) {
            $this->createCustomerLinkTable($setup);
        }

        $setup->endSetup();
    }
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        if (version_compare($context->getVersion(), "1.1.0") < 0) {
            $setup->startSetup();

            $logTable = $setup->getConnection()->newTable($setup->getTable('elasticsuite_tracker_log_event'))
                ->addColumn(
                    'event_id',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '32',
                    ['nullable' => false, 'primary' => true],
                    'Event Id'
                )
                ->addColumn(
                    'date',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
                    null,
                    ['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT],
                    'Event date'
                )
                ->addColumn(
                    'data',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '2M',
                    ['nullable' => false],
                    'Event data'
                )
                ->addColumn(
                    'data',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    '2M',
                    ['nullable' => false],
                    'Event data'
                );

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

        if (version_compare($context->getVersion(), '1.2.0', '<')) {
            $this->createCustomerLinkTable($setup);
        }

        $setup->endSetup();
    }
public function upgrade ( SchemaSetupInterface $ setup , ModuleContextInterface $ context ) { $ setup -> startSetup ( ) ; if ( version_compare ( $ context -> getVersion ( ) , "1.1.0" ) < 0 ) { $ setup -> startSetup ( ) ; $ logTable = $ setup -> getConnection ( ) -> newTable ( $ setup -> getTable ( 'elasticsuite_tracker_log_event' ) ) -> addColumn ( 'event_id' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_TEXT , '32' , [ 'nullable' => false , 'primary' => true ] , 'Event Id' ) -> addColumn ( 'date' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_TIMESTAMP , null , [ 'nullable' => false , 'default' => \ Magento \ Framework \ DB \ Ddl \ Table :: TIMESTAMP_INIT ] , 'Event date' ) -> addColumn ( 'data' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_TEXT , '2M' , [ 'nullable' => false ] , 'Event data' ) -> addColumn ( 'data' , \ Magento \ Framework \ DB \ Ddl \ Table :: TYPE_TEXT , '2M' , [ 'nullable' => false ] , 'Event data' ) ; $ setup -> getConnection ( ) -> createTable ( $ logTable ) ; } if ( version_compare ( $ context -> getVersion ( ) , '1.2.0' , '<' ) ) { $ this -> createCustomerLinkTable ( $ setup ) ; } $ setup -> endSetup ( ) ; }
Create table for the tracking module.

@param SchemaSetupInterface   $setup   The setup interface
@param ModuleContextInterface $context The module Context

@return void
Create table for the tracking module .