You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have different files which define the different schemas of my tables and one index file that aggregates them and normally associate the tables if needed.
This is my index.js:
I get [TypeError: Cannot call method 'getTableName' of undefined].
So my first question is: is the classMethods in reportData.js the correct way to associate models, as I see when I examin my db2 object that it doesn't associate anything.
Does the order matter? as I can see that files that contain the different files that defines every table are called in alphabetical order which makes reportPeriod being called after reportData has been defined.
Or should I put the different table associations in index.js and in that case how?
Thx
The text was updated successfully, but these errors were encountered:
When you define sequelize.define('RootConcept', { the model will be stored as db.RootConcept. In your associate function you are trying to access reportData.belongsTo(models.rootConcept); (lower case r)
Closing this issue, since it is neither a bug report nor a feature request.
Hi,
I have different files which define the different schemas of my tables and one index file that aggregates them and normally associate the tables if needed.
This is my index.js:
Then I have these schemas:
first
reportData.js
then
reportPeriod.js
:then
rootConcept.js
:My query is the following:
I get
[TypeError: Cannot call method 'getTableName' of undefined]
.So my first question is: is the
classMethods
inreportData.js
the correct way to associate models, as I see when I examin my db2 object that it doesn't associate anything.Does the order matter? as I can see that files that contain the different files that defines every table are called in alphabetical order which makes
reportPeriod
being called afterreportData
has been defined.Or should I put the different table associations in
index.js
and in that case how?Thx
The text was updated successfully, but these errors were encountered: