Added support for UNSIGNED columns in MySQL.

This commit is contained in:
Vasil Rangelov 2019-07-02 15:18:47 +03:00
parent b70aba10c8
commit 2240cc3aeb
2 changed files with 5 additions and 1 deletions

View File

@ -72,6 +72,9 @@ export class MysqlDriver extends AbstractDriver {
resp.COLUMN_DEFAULT
);
colInfo.options.type = resp.DATA_TYPE as any;
colInfo.options.unsigned = resp.COLUMN_TYPE.endsWith(
" unsigned"
);
switch (resp.DATA_TYPE) {
case "int":
colInfo.tsType = "number";

View File

@ -15,7 +15,8 @@ import {BaseEntity,Column,Entity,Index,JoinColumn,JoinTable,ManyToMany,ManyToOne
primary:{{primary}},{{/primary}}{{/generated}}{{#unique}}
unique: true,{{/unique}}{{#length}}
length:{{.}},{{/length}}{{#width}}
width:{{.}},{{/width}}{{#default}}
width:{{.}},{{/width}}{{#unsigned}}
unsigned: true,{{/unsigned}}{{#default}}
default: {{.}},{{/default}}{{#precision}}
precision:{{.}},{{/precision}}{{#scale}}
scale:{{.}},{{/scale}}{{#enum}}