From 4e3c0b37adbde563de3c70f32c3c27632196db58 Mon Sep 17 00:00:00 2001
From: TienLeok Ngo <tienleok@gmail.com>
Date: Mon, 21 Oct 2019 13:42:54 +0800
Subject: [PATCH 1/5] Fix #209

---
 src/index.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/index.ts b/src/index.ts
index 4e9df15..a0dab7f 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -243,7 +243,7 @@ async function GetUtilParametersByInquirer() {
             {
                 message: "Database port:",
                 name: "port",
-                type: "input",
+                type: "number",
                 default() {
                     return driver.standardPort;
                 },

From 896698a9d11958806fd826ef6c1c04c090110eb4 Mon Sep 17 00:00:00 2001
From: TienLeok Ngo <tienleok@gmail.com>
Date: Tue, 22 Oct 2019 17:44:31 +0800
Subject: [PATCH 2/5] Fix for #212

---
 src/index.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/index.ts b/src/index.ts
index 4e9df15..3a3fe4f 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -334,7 +334,7 @@ async function GetUtilParametersByInquirer() {
             const { timeout } = (await inquirer.prompt({
                 message: "Query timeout(ms):",
                 name: "timeout",
-                type: "input",
+                type: "number",
                 validate(value) {
                     const valid = !Number.isNaN(parseInt(value, 10));
                     return valid || "Please enter a valid number";

From a975a46e216f002dadec96071045b09d64ea2a9f Mon Sep 17 00:00:00 2001
From: TienLeok Ngo <tienleok@gmail.com>
Date: Wed, 23 Oct 2019 15:16:09 +0800
Subject: [PATCH 3/5] Update entity.mst

Fix for:
Argument of type '{ type: "int"; unique: boolean; name: string; }' is not assignable to parameter of type 'PrimaryGeneratedColumnNumericOptions'.
---
 src/entity.mst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/entity.mst b/src/entity.mst
index e809475..49bd95f 100644
--- a/src/entity.mst
+++ b/src/entity.mst
@@ -12,8 +12,8 @@ import {BaseEntity,Column,Entity,Index,JoinColumn,JoinTable,ManyToMany,ManyToOne
         type:"{{type}}", {{/generated}}{{^generated}} @Column("{{type}}",{ {{#nullable}}
         nullable:true,{{/nullable}}{{^nullable}}
         nullable:false,{{/nullable}}{{#primary}}
-        primary:{{primary}},{{/primary}}{{/generated}}{{#unique}}
-        unique: true,{{/unique}}{{#length}}
+        primary:{{primary}},{{/primary}}{{#unique}}
+        unique: true,{{/unique}}{{/generated}}{{#length}}
         length:{{.}},{{/length}}{{#width}}
         width:{{.}},{{/width}}{{#unsigned}}
         unsigned: true,{{/unsigned}}{{#default}}

From 16596a0eb23f14002ebb69b82a9604ae4f729811 Mon Sep 17 00:00:00 2001
From: Kononnable <kononnable@gmail.com>
Date: Sun, 3 Nov 2019 17:18:43 +0100
Subject: [PATCH 4/5] parse timeout parameter passed by inqiorer

---
 src/index.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/index.ts b/src/index.ts
index 3a3fe4f..099c33d 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -334,13 +334,13 @@ async function GetUtilParametersByInquirer() {
             const { timeout } = (await inquirer.prompt({
                 message: "Query timeout(ms):",
                 name: "timeout",
-                type: "number",
+                type: "input",
                 validate(value) {
                     const valid = !Number.isNaN(parseInt(value, 10));
                     return valid || "Please enter a valid number";
                 }
             })) as any;
-            connectionOptions.timeout = timeout;
+            connectionOptions.timeout = parseInt(timeout, 10);
         }
     }
     const { customizeGeneration } = (await inquirer.prompt([

From d94b83c450a355b082908c048df0776ddb1e860e Mon Sep 17 00:00:00 2001
From: Kononnable <kononnable@gmail.com>
Date: Sun, 3 Nov 2019 17:22:15 +0100
Subject: [PATCH 5/5] parse port parameter passed by inquirer

---
 src/index.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/index.ts b/src/index.ts
index a0dab7f..e3590fd 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -243,7 +243,7 @@ async function GetUtilParametersByInquirer() {
             {
                 message: "Database port:",
                 name: "port",
-                type: "number",
+                type: "input",
                 default() {
                     return driver.standardPort;
                 },
@@ -293,7 +293,7 @@ async function GetUtilParametersByInquirer() {
                 }
             ])) as any).schema;
         }
-        connectionOptions.port = answ.port;
+        connectionOptions.port = parseInt(answ.port, 10);
         connectionOptions.host = answ.host;
         connectionOptions.user = answ.login;
         connectionOptions.password = answ.password;