diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index 53b71a8dcd..d11e364eda 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -209,7 +209,11 @@ public function getEnumDeclarationSQL(array $column): string throw ColumnValuesRequired::new($this, 'ENUM'); } - return $this->getStringTypeDeclarationSQL(['length' => max(...array_map(mb_strlen(...), $column['values']))]); + $length = count($column['values']) > 1 + ? max(...array_map(mb_strlen(...), $column['values'])) + : mb_strlen($column['values'][key($column['values'])]); + + return $this->getStringTypeDeclarationSQL(['length' => $length]); } /**