#66 added union type with null for nullable columns
This commit is contained in:
parent
651a54ea79
commit
87502eab19
@ -223,7 +223,7 @@ export class Engine {
|
||||
"username": "${this.Options.user}",
|
||||
"password": "${this.Options.password}",
|
||||
"database": "${this.Options.databaseName}",
|
||||
"synchronize": false
|
||||
"synchronize": false,
|
||||
"entities": [
|
||||
"entities/*.js"
|
||||
]
|
||||
|
@ -22,12 +22,12 @@ import {Index,Entity, PrimaryColumn, Column, OneToOne, OneToMany, ManyToOne, Man
|
||||
enum:[{{.}}],{{/enumOptions}}
|
||||
name:"{{name}}"
|
||||
})
|
||||
{{toPropertyName name}}:{{ts_type}};
|
||||
{{toPropertyName name}}:{{ts_type}}{{#is_nullable}} | null{{/is_nullable}};
|
||||
{{/relations}}{{#relations}}
|
||||
@{{relationType}}(type=>{{toEntityName relatedTable}}, {{toPropertyName ../name}}=>{{toPropertyName ../name}}.{{#if isOwner}}{{toPropertyName ownerColumn}},{ {{#../isPrimary}}primary:true,{{/../isPrimary}}{{^../is_nullable}} nullable:false,{{/../is_nullable}}{{#actionOnDelete}}onDelete: '{{.}}',{{/actionOnDelete}}{{#actionOnUpdate}}onUpdate: '{{.}}'{{/actionOnUpdate}} }{{else}}{{toPropertyName relatedColumn}}{{#actionOnDelete}},{ onDelete: '{{.}}' }{{/actionOnDelete}}{{/if}}){{#isOwner}}
|
||||
{{#if isManyToMany}}@JoinTable(){{else}}@JoinColumn({ name:'{{ ../name}}'}){{/if}}{{/isOwner}}
|
||||
{{#if (or isOneToMany isManyToMany)}}{{toPropertyName ../name}}:{{toLazy (concat (toEntityName relatedTable) "[]")}};
|
||||
{{else}}{{toPropertyName ../name}}:{{toLazy (toEntityName relatedTable)}};
|
||||
{{else}}{{toPropertyName ../name}}:{{toLazy (concat (toEntityName relatedTable) ' | null')}};
|
||||
{{/if}}{{/relations}}
|
||||
{{/Columns}}
|
||||
{{#if GenerateConstructor}}
|
||||
|
Loading…
Reference in New Issue
Block a user