Skip to content

Commit

Permalink
fix(mysql): ensure number & AutoIncrement is always int
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed May 3, 2024
1 parent ef7e284 commit 69feb17
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/mysql/src/mysql-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@

import { Pool } from 'mariadb';
import { mySqlSerializer } from './mysql-serializer.js';
import { isReferenceType, isUUIDType, ReflectionClass, ReflectionKind, ReflectionProperty, Serializer, Type, TypeNumberBrand } from '@deepkit/type';
import {
isAutoIncrementType,
isReferenceType,
isUUIDType,
ReflectionClass,
ReflectionKind,
ReflectionProperty,
Serializer,
Type,
TypeNumberBrand,
} from '@deepkit/type';
import {
Column,
DefaultPlatform,
Expand Down Expand Up @@ -51,6 +61,7 @@ export class MySQLPlatform extends DefaultPlatform {
this.addType(() => true, 'json');

this.addType(typeResolvesToNumber, 'double');
this.addType(isAutoIncrementType, 'int');
this.addType(typeResolvesToInteger, 'integer');
this.addType(typeResolvesToBigInt, 'bigint');
this.addType(typeResolvesToBoolean, 'tinyint', 1);
Expand Down

0 comments on commit 69feb17

Please sign in to comment.