SoftwareBrothers / adminjs-sequelizejs

Sequelizejs adapter for AdminBro
MIT License
27 stars 34 forks source link

fix: return tableName in property.reference() #51

Closed leibowitz closed 2 years ago

leibowitz commented 3 years ago

Solve issue when foreign key is not defined as a reference, but a relationship exists Fix #50

dziraf commented 2 years ago

I approved this PR but it seems to be failing on type checks:

Error: src/property.ts(77,54): error TS2339: Property 'tableName' does not exist on type 'TableNameWithSchema | ModelType<any, any>'.
leibowitz commented 2 years ago
Error: src/property.ts(77,54): error TS2339: Property 'tableName' does not exist on type 'TableNameWithSchema | ModelType<any, any>'.

You mean this? https://github.com/sequelize/sequelize/blob/c2459f09d1d1eb4b11234d32e43dd264e29f184f/src/dialects/abstract/query-interface.d.ts#L144-L150

Where is the type definition coming from? Looks like it's wrong somewhere Update: I think it's due to the ModelType, which doesn't seem to have tableName attribute – not sure if that's actually to be supported (when is model referring to ModelType vs TableNameWithSchema?) I'm a bit out of my depth on the type thing. And this PR is quite old. Feel free to fix or close if you don't want to invest more time into this change

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 2.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: