diff --git a/vendor/magento/module-indexer/etc/db_schema.xml b/vendor/magento/module-indexer/etc/db_schema.xml index e316e50f79e..87ff8fa9ecd 100644 --- a/vendor/magento/module-indexer/etc/db_schema.xml +++ b/vendor/magento/module-indexer/etc/db_schema.xml @@ -1,8 +1,8 @@ - diff --git a/vendor/magento/framework/Mview/View/Changelog.php b/vendor/magento/framework/Mview/View/Changelog.php index d836fec8585..efd25690686 100644 --- a/vendor/magento/framework/Mview/View/Changelog.php +++ b/vendor/magento/framework/Mview/View/Changelog.php @@ -126,7 +126,7 @@ class Changelog implements ChangelogInterface $changelogTableName )->addColumn( self::VERSION_ID_COLUMN_NAME, - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + \Magento\Framework\DB\Ddl\Table::TYPE_BIGINT, null, ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], 'Version ID' @@ -149,6 +149,7 @@ class Changelog implements ChangelogInterface } else { // change the charset to utf8mb4 $getTableSchema = $this->connection->getCreateTable($changelogTableName) ?? ''; + $this->changeVersionIdToBigInt($getTableSchema, $changelogTableName); if (preg_match('/\b('. self::OLDCHARSET .')\b/', $getTableSchema)) { $charset = $this->columnConfig->getDefaultCharset(); $collate = $this->columnConfig->getDefaultCollation(); @@ -164,6 +165,32 @@ class Changelog implements ChangelogInterface } } + /** + * Change version_id from int to bigint + * + * @param string $getTableSchema + * @param string $changelogTableName + * @return void + */ + private function changeVersionIdToBigInt(string $getTableSchema, string $changelogTableName): void + { + $pattern = '/`version_id`\s+int\b/i'; + if (preg_match($pattern, $getTableSchema)) { + $this->connection->modifyColumn( + $changelogTableName, + self::VERSION_ID_COLUMN_NAME, + [ + 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BIGINT, + 'nullable' => false, + 'identity' => true, + 'unsigned' => true, + 'primary' => true, + 'comment' => 'Version ID' + ] + ); + } + } + /** * Retrieve additional column data *