diff --git a/src/entity.mst b/src/entity.mst index 99af1be..eb5388b 100644 --- a/src/entity.mst +++ b/src/entity.mst @@ -1,25 +1,11 @@ -import { - BaseEntity, - Column, - Entity, - Index, - JoinColumn, - JoinTable, - ManyToMany, - ManyToOne, - OneToMany, - OneToOne, - PrimaryColumn, - PrimaryGeneratedColumn, - RelationId -} from "typeorm"; +import {BaseEntity,Column,Entity,Index,JoinColumn,JoinTable,ManyToMany,ManyToOne,OneToMany,OneToOne,PrimaryColumn,PrimaryGeneratedColumn,RelationId} from "typeorm"; {{relationImports}}{{#each UniqueImports}}import {{curly true}}{{toEntityName this}}{{curly false}} from "./{{toFileName this}}"; {{/each}} @Entity("{{EntityName}}"{{#Schema}},{schema:"{{.}}"}{{/Schema}}) {{#Indexes}}{{^isPrimaryKey}}@Index("{{name}}",[{{#columns}}"{{toPropertyName name}}",{{/columns}}]{{#isUnique}},{unique:true}{{/isUnique}}) -{{/isPrimaryKey}}{{/Indexes}}export class {{toEntityName EntityName}}{{#if IsActiveRecord}} extends BaseEntity{{/if}} { +{{/isPrimaryKey}}{{/Indexes}}export class {{toEntityName EntityName}}{{#IsActiveRecord}} extends BaseEntity{{/IsActiveRecord}} { {{#Columns}} {{^relations}}{{#isGenerated}} @PrimaryGeneratedColumn({ diff --git a/test/utils/GeneralTestUtils.ts b/test/utils/GeneralTestUtils.ts index e3c3c47..596e9e1 100644 --- a/test/utils/GeneralTestUtils.ts +++ b/test/utils/GeneralTestUtils.ts @@ -71,7 +71,8 @@ export async function createMSSQLModels(filesOrgPath: string, resultsPath: strin lazy: false, constructor: false, namingStrategy, - relationIds: false + relationIds: false, + activeRecord: false }); conn = await createConnection(connOpt) @@ -143,7 +144,8 @@ export async function createPostgresModels(filesOrgPath: string, resultsPath: st lazy: false, constructor: false, namingStrategy, - relationIds: false + relationIds: false, + activeRecord: false }); conn = await createConnection(connOpt) @@ -207,7 +209,8 @@ export async function createSQLiteModels(filesOrgPath: string, resultsPath: stri lazy: false, constructor: false, namingStrategy, - relationIds: false + relationIds: false, + activeRecord: false }); conn = await createConnection(connOpt) @@ -269,7 +272,8 @@ export async function createMysqlModels(filesOrgPath: string, resultsPath: strin lazy: false, constructor: false, namingStrategy, - relationIds: false + relationIds: false, + activeRecord: false }); return engine; @@ -323,7 +327,8 @@ export async function createMariaDBModels(filesOrgPath: string, resultsPath: str lazy: false, constructor: false, namingStrategy, - relationIds: false + relationIds: false, + activeRecord: false }); @@ -380,7 +385,8 @@ export async function createOracleDBModels(filesOrgPath: string, resultsPath: st lazy: false, constructor: false, namingStrategy, - relationIds: false + relationIds: false, + activeRecord: false }); return engine;