Closed kop7 closed 5 years ago
We found the issue. We had this:
// src/entity/index.ts
export * from './ad.entity';
export * from './category.entity';
// ...
and then we imported entities like this, to write less lines and organize better:
import { Ad, Category, WhatEverOtherEntity } from ./;
and not like this:
import { Ad } from ./ad.entity;
import { Category } from ./category.entity;
// separate imports
This seems to be an issue with typeorm-fixtures-cli
, even though other stuff works normally and the application builds successfully.
please see this issue https://github.com/RobinCK/typeorm-fixtures/issues/58 and this sample https://github.com/RobinCK/typeorm-fixtures-sample I think Ads.yml is not correct you need to create category.yml and ads.yml and set category reference in ads structure
You are correct, we fixed the fixtures.
entity: Ad
items:
ad{1..100}:
title: '{{name.jobType}}'
categories:
- '@category*'
- '@category*'
entity: Category
items:
category{1..10}:
name: '{{name.jobArea}}'
However, we had this exact setup earlier. The version @kop7 posted was a result of trying to work around the error. We found that the error was caused soley by the imports. We didn't suspect that because the application has worked well that way. Thank you very much for your help. π₯
"typeorm-fixtures-cli": "^1.3.5"
Getting error when run fixtures Ads.yml:
Fail fixture loading: Entity metadata for Category#ads was not found.
maybe is bug?
Ads.yml