fix(package): Fixed Bug where mssql Driver IsIdentity is not working with non dbo schemas

This commit is contained in:
Allan Amstadt 2020-05-13 11:52:19 +02:00
parent 414a17dfa5
commit afe212e49b
2 changed files with 1 additions and 1 deletions

0
bin/typeorm-model-generator Normal file → Executable file
View File

View File

@ -83,7 +83,7 @@ WHERE TABLE_TYPE='BASE TABLE' and TABLE_SCHEMA in (${schema}) AND TABLE_CATALOG
}[] = (
await request.query(`SELECT TABLE_NAME,TABLE_SCHEMA,COLUMN_NAME,COLUMN_DEFAULT,IS_NULLABLE,
DATA_TYPE,CHARACTER_MAXIMUM_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE,
COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') IsIdentity,
COLUMNPROPERTY(object_id(CONCAT(TABLE_SCHEMA,'.', TABLE_NAME)), COLUMN_NAME, 'IsIdentity') IsIdentity,
(SELECT count(*)
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
inner join INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE cu