@@ -126,7 +126,7 @@ public function create()
126
126
$ changelogTableName
127
127
)->addColumn (
128
128
self ::VERSION_ID_COLUMN_NAME ,
129
- \Magento \Framework \DB \Ddl \Table::TYPE_INTEGER ,
129
+ \Magento \Framework \DB \Ddl \Table::TYPE_BIGINT ,
130
130
null ,
131
131
['identity ' => true , 'unsigned ' => true , 'nullable ' => false , 'primary ' => true ],
132
132
'Version ID '
@@ -149,6 +149,7 @@ public function create()
149
149
} else {
150
150
// change the charset to utf8mb4
151
151
$ getTableSchema = $ this ->connection ->getCreateTable ($ changelogTableName ) ?? '' ;
152
+ $ this ->changeVersionIdToBigInt ($ getTableSchema , $ changelogTableName );
152
153
if (preg_match ('/\b( ' . self ::OLDCHARSET .')\b/ ' , $ getTableSchema )) {
153
154
$ charset = $ this ->columnConfig ->getDefaultCharset ();
154
155
$ collate = $ this ->columnConfig ->getDefaultCollation ();
@@ -164,6 +165,32 @@ public function create()
164
165
}
165
166
}
166
167
168
+ /**
169
+ * Change version_id from int to bigint
170
+ *
171
+ * @param string $getTableSchema
172
+ * @param string $changelogTableName
173
+ * @return void
174
+ */
175
+ private function changeVersionIdToBigInt (string $ getTableSchema , string $ changelogTableName ): void
176
+ {
177
+ $ pattern = '/`version_id`\s+int\b/i ' ;
178
+ if (preg_match ($ pattern , $ getTableSchema )) {
179
+ $ this ->connection ->modifyColumn (
180
+ $ changelogTableName ,
181
+ self ::VERSION_ID_COLUMN_NAME ,
182
+ [
183
+ 'type ' => \Magento \Framework \DB \Ddl \Table::TYPE_BIGINT ,
184
+ 'nullable ' => false ,
185
+ 'identity ' => true ,
186
+ 'unsigned ' => true ,
187
+ 'primary ' => true ,
188
+ 'comment ' => 'Version ID '
189
+ ]
190
+ );
191
+ }
192
+ }
193
+
167
194
/**
168
195
* Retrieve additional column data
169
196
*
0 commit comments