From 485bce7430cb6ee853067252496e7dde7f642b9a Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Thu, 17 Aug 2023 12:52:49 +0100 Subject: [PATCH] Introduce alias type mapping Signed-off-by: Kamil Tekiela --- src/Types.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Types.php b/src/Types.php index 76cb1abc3bd0..605698a2029e 100644 --- a/src/Types.php +++ b/src/Types.php @@ -729,7 +729,7 @@ public function getIntegerTypes(): array public function mapAliasToMysqlType(string $alias): string { - return [ + return match ($alias) { 'BOOL' => 'TINYINT', 'BOOLEAN' => 'TINYINT', 'CHARACTER VARYING' => 'VARCHAR', @@ -746,7 +746,8 @@ public function mapAliasToMysqlType(string $alias): string 'LONG' => 'MEDIUMTEXT', 'MIDDLEINT' => 'MEDIUMINT', 'NUMERIC' => 'DECIMAL', - ][$alias] ?? $alias; + default => $alias, + }; } /**