fixing index column names if property names being case converted #103

This commit is contained in:
Kononnable 2018-09-30 23:41:19 +02:00
parent fa48c3c969
commit c72ea59bc4

View File

@ -4,12 +4,11 @@ import {Index,Entity, PrimaryColumn, PrimaryGeneratedColumn, Column, OneToOne, O
@Entity("{{EntityName}}"{{#Schema}},{schema:"{{.}}"}{{/Schema}})
{{#Indexes}}{{^isPrimaryKey}}@Index("{{name}}",[{{#columns}}"{{name}}",{{/columns}}]{{#isUnique}},{unique:true}{{/isUnique}})
{{#Indexes}}{{^isPrimaryKey}}@Index("{{name}}",[{{#columns}}"{{toPropertyName name}}",{{/columns}}]{{#isUnique}},{unique:true}{{/isUnique}})
{{/isPrimaryKey}}{{/Indexes}}export class {{toEntityName EntityName}} {
{{#Columns}}
{{^relations}}{{#is_generated}} @PrimaryGeneratedColumn({
{{/is_generated}}{{^is_generated}} @Column("{{sql_type}}",{ {{#is_nullable}}
{{^relations}}{{#is_generated}} @PrimaryGeneratedColumn({ {{/is_generated}}{{^is_generated}} @Column("{{sql_type}}",{ {{#is_nullable}}
nullable:true,{{/is_nullable}}{{^is_nullable}}
nullable:false,{{/is_nullable}}{{#isPrimary}}
primary:{{isPrimary}},{{/isPrimary}}{{/is_generated}}{{#is_unique}}