diff --git a/src/logic/define/sqlSchemaGenerator/defineSqlSchemaGeneratorCodeForDomainObject.ts b/src/logic/define/sqlSchemaGenerator/defineSqlSchemaGeneratorCodeForDomainObject.ts index 339be41..17e95ad 100644 --- a/src/logic/define/sqlSchemaGenerator/defineSqlSchemaGeneratorCodeForDomainObject.ts +++ b/src/logic/define/sqlSchemaGenerator/defineSqlSchemaGeneratorCodeForDomainObject.ts @@ -64,6 +64,7 @@ export const defineSqlSchemaGeneratorCodeForDomainObject = ({ const referenceImports = sqlSchemaRelationship.properties .map((propertyRelationship) => propertyRelationship.sqlSchema.reference) .filter(isPresent) + .filter((reference) => reference.of.name !== domainObject.name) // dont import references to self .map( (reference) => `import { ${camelCase(reference.of.name)} } from './${camelCase(