diff --git a/src/Database/Drivers/Engines/MySQLEngine.php b/src/Database/Drivers/Engines/MySQLEngine.php index 79ab533b5..19a52ffa2 100644 --- a/src/Database/Drivers/Engines/MySQLEngine.php +++ b/src/Database/Drivers/Engines/MySQLEngine.php @@ -167,9 +167,6 @@ public function getForeignKeys(string $table): array public function resolveColumnConverter(array $meta, TypeConverter $converter): ?\Closure { return match ($meta['nativeType']) { - 'NEWDECIMAL' => $converter->convertDecimal - ? ($meta['scale'] === 0 ? $converter->toInt(...) : $converter->toFloat(...)) - : null, 'TINY' => $meta['length'] === 1 && $converter->convertBoolean ? $converter->toBool(...) : $converter->toInt(...), diff --git a/src/Database/Drivers/Engines/SQLServerEngine.php b/src/Database/Drivers/Engines/SQLServerEngine.php index 5f514f010..38dda9f84 100644 --- a/src/Database/Drivers/Engines/SQLServerEngine.php +++ b/src/Database/Drivers/Engines/SQLServerEngine.php @@ -224,7 +224,6 @@ public function getForeignKeys(string $table): array public function resolveColumnConverter(array $meta, TypeConverter $converter): ?\Closure { - dump($meta); return match ($meta['nativeType']) { 'timestamp' => null, // timestamp does not mean time in sqlsrv 'bit' => $converter->convertBoolean ? $converter->toBool(...) : $converter->toInt(...), diff --git a/src/Database/TypeConverter.php b/src/Database/TypeConverter.php index 97d746dae..6b228212d 100644 --- a/src/Database/TypeConverter.php +++ b/src/Database/TypeConverter.php @@ -66,7 +66,9 @@ public function resolve(array $meta): ?\Closure return match ($this->detectType($meta['nativeType'])) { self::Integer => $this->toInt(...), self::Float => $this->toFloat(...), - self::Decimal => $this->convertDecimal ? $this->toFloat(...) : null, + self::Decimal => $this->convertDecimal + ? ($meta['scale'] === 0 ? $this->toInt(...) : $this->toFloat(...)) + : null, self::Boolean => $this->convertBoolean ? $this->toBool(...) : null, self::DateTime, self::Date => $this->convertDateTime ? $this->toDateTime(...) : null, self::Time => $this->convertDateTime ? $this->toTime(...) : null,