From 721ae932143ac09e4c4434d539addee405c7d97d Mon Sep 17 00:00:00 2001 From: Kononnable Date: Mon, 1 Apr 2019 12:00:21 +0200 Subject: [PATCH] fixes after merge to latest master, added tests --- src/drivers/MysqlDriver.ts | 8 ++++---- test/integration/entityTypes/mariadb/entity/Post.ts | 3 +++ test/integration/entityTypes/mysql/entity/Post.ts | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/drivers/MysqlDriver.ts b/src/drivers/MysqlDriver.ts index 25dbc1e..82ec859 100644 --- a/src/drivers/MysqlDriver.ts +++ b/src/drivers/MysqlDriver.ts @@ -74,11 +74,11 @@ export class MysqlDriver extends AbstractDriver { colInfo.tsType = "number"; break; case "bit": - if (resp.column_type == "bit(1)") { - colInfo.width = 1; - colInfo.ts_type = "boolean"; + if (resp.COLUMN_TYPE === "bit(1)") { + colInfo.options.width = 1; + colInfo.tsType = "boolean"; } else { - colInfo.ts_type = "number"; + colInfo.tsType = "number"; } break; case "tinyint": diff --git a/test/integration/entityTypes/mariadb/entity/Post.ts b/test/integration/entityTypes/mariadb/entity/Post.ts index 142c281..491f16b 100644 --- a/test/integration/entityTypes/mariadb/entity/Post.ts +++ b/test/integration/entityTypes/mariadb/entity/Post.ts @@ -9,6 +9,9 @@ export class Post { @Column() name: string; + @Column("bit") + bit: boolean; + @Column("int") int: number; diff --git a/test/integration/entityTypes/mysql/entity/Post.ts b/test/integration/entityTypes/mysql/entity/Post.ts index 707ea9e..6e468d9 100644 --- a/test/integration/entityTypes/mysql/entity/Post.ts +++ b/test/integration/entityTypes/mysql/entity/Post.ts @@ -9,6 +9,9 @@ export class Post { @Column() name: string; + @Column("bit") + bit: boolean; + @Column("int") int: number; @@ -113,5 +116,4 @@ export class Post { @Column("geometrycollection") geometrycollection: string; - }