From c72ea59bc4d45a06a0108844553e0a2f8ed6fb4c Mon Sep 17 00:00:00 2001 From: Kononnable Date: Sun, 30 Sep 2018 23:41:19 +0200 Subject: [PATCH] fixing index column names if property names being case converted #103 --- src/entity.mst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/entity.mst b/src/entity.mst index 882a464..83e4971 100644 --- a/src/entity.mst +++ b/src/entity.mst @@ -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}}