From f06d6dc34543251580e54ae7e3b3d1028b9aa36d Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 22 Jun 2024 20:22:01 +0530 Subject: [PATCH] Apply work-around for https://github.com/yiisoft/yii2/issues/20209 --- src/lib/SchemaToDatabase.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/SchemaToDatabase.php b/src/lib/SchemaToDatabase.php index 9e555310..3a94b4d8 100644 --- a/src/lib/SchemaToDatabase.php +++ b/src/lib/SchemaToDatabase.php @@ -334,9 +334,8 @@ public static function attributesFromColumnSchemas(array $columnSchemas) ]) && $columnSchema->isPrimaryKey === true && $columnSchema->autoIncrement ) { - if (stripos($columnSchema->dbType, 'BIGINT') !== false # MySQL, MariaDB - || stripos($columnSchema->dbType, 'bigserial') !== false # PgSQL - ) { + str_ireplace(['BIGINT', 'int8', 'bigserial', 'serial8'], 'nothing',$columnSchema->dbType, $count); # can be refactored if https://github.com/yiisoft/yii2/issues/20209 is fixed + if ($count) { if ($columnSchema->unsigned) { $attribute->dbType = Schema::TYPE_UBIGPK; } else {