Skip to content

Commit f06d6dc

Browse files
committed
Apply work-around for yiisoft/yii2#20209
1 parent e0b96a3 commit f06d6dc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib/SchemaToDatabase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,8 @@ public static function attributesFromColumnSchemas(array $columnSchemas)
334334
])
335335
&& $columnSchema->isPrimaryKey === true && $columnSchema->autoIncrement
336336
) {
337-
if (stripos($columnSchema->dbType, 'BIGINT') !== false # MySQL, MariaDB
338-
|| stripos($columnSchema->dbType, 'bigserial') !== false # PgSQL
339-
) {
337+
str_ireplace(['BIGINT', 'int8', 'bigserial', 'serial8'], 'nothing',$columnSchema->dbType, $count); # can be refactored if https://github.com/yiisoft/yii2/issues/20209 is fixed
338+
if ($count) {
340339
if ($columnSchema->unsigned) {
341340
$attribute->dbType = Schema::TYPE_UBIGPK;
342341
} else {

0 commit comments

Comments
 (0)