Can't generate migration when extending ProductVariant entity - TypeORMError #5212
Unanswered
AlexTechNoir
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Did you resolve it? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good day!
I'm trying to extend
ProductVariant
entity, following docs. I've created the files:src/models/productVariant.ts:
datasource.js:
(and just in case, here's my typeORM config)
ormconfig.js:
After
npm run build
, when I runnpx typeorm migration:generate -d datasource.js src/migrations/ProductVariantExtend
the terminal shows me TypeORM error:In
EntityMetadataBuilder.js
the error originates from here:We can see that the error appears because of
inverseEntityMetadata
being falsey. All conditions inside.find()
function are false - I checked. The values I put in my console.log above show the following:I found two answers in the corresponding issue in TypeORM's github. I don't think I misspelled anything, as I copied code from docs. Judging by the first answer, in my case TypeORM didn't find relation between
ProductVariant
andProduct
entities.What does this relation has to do with extending
ProductVariant
? And how can I resolve this migration generation issue?Beta Was this translation helpful? Give feedback.
All reactions