Added support for UNSIGNED columns in MySQL. (#179)
Added support for UNSIGNED columns in MySQL.
This commit is contained in:
commit
ce8d37c075
@ -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";
|
||||
|
@ -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}}
|
||||
|
@ -15,10 +15,13 @@ export class Post {
|
||||
@Column("int")
|
||||
int: number;
|
||||
|
||||
@Column("int", { unsigned: true })
|
||||
uint: number;
|
||||
|
||||
@Column("tinyint")
|
||||
tinyint: number;
|
||||
|
||||
@Column("tinyint",{width:1})
|
||||
@Column("tinyint", { width: 1 })
|
||||
boolean: boolean;
|
||||
|
||||
@Column("smallint")
|
||||
|
Loading…
Reference in New Issue
Block a user