Core/Events.php
public static function addMissingFieldsOnUpdate()
    {
        $dbMetaDataHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);

        $tableFields = array(
            'oepaypal_order'                => 'OEPAYPAL_TIMESTAMP',
            'oepaypal_orderpayments'        => 'OEPAYPAL_TIMESTAMP',
            'oepaypal_orderpaymentcomments' => 'OEPAYPAL_TIMESTAMP',
        );

        foreach ($tableFields as $tableName => $fieldName) {
            if (!$dbMetaDataHandler->fieldExists($fieldName, $tableName)) {
                \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute(
                    "ALTER TABLE `" . $tableName
                    . "` ADD `" . $fieldName . "` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;"
                );
            }
        }
    }
public static function addMissingFieldsOnUpdate()
    {
        $dbMetaDataHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);

        $tableFields = array(
            'oepaypal_order'                => 'OEPAYPAL_TIMESTAMP',
            'oepaypal_orderpayments'        => 'OEPAYPAL_TIMESTAMP',
            'oepaypal_orderpaymentcomments' => 'OEPAYPAL_TIMESTAMP',
        );

        foreach ($tableFields as $tableName => $fieldName) {
            if (!$dbMetaDataHandler->fieldExists($fieldName, $tableName)) {
                \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute(
                    "ALTER TABLE `" . $tableName
                    . "` ADD `" . $fieldName . "` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;"
                );
            }
        }
    }
public static function addMissingFieldsOnUpdate ( ) { $ dbMetaDataHandler = oxNew ( \ OxidEsales \ Eshop \ Core \ DbMetaDataHandler :: class ) ; $ tableFields = array ( 'oepaypal_order' => 'OEPAYPAL_TIMESTAMP' , 'oepaypal_orderpayments' => 'OEPAYPAL_TIMESTAMP' , 'oepaypal_orderpaymentcomments' => 'OEPAYPAL_TIMESTAMP' , ) ; foreach ( $ tableFields as $ tableName => $ fieldName ) { if ( ! $ dbMetaDataHandler -> fieldExists ( $ fieldName , $ tableName ) ) { \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> execute ( "ALTER TABLE `" . $ tableName . "` ADD `" . $ fieldName . "` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;" ) ; } } }
Add missing field if it activates on old DB
Add missing field if it activates on old DB