Conversation
| }, | ||
|
|
||
| down: async (queryInterface, Sequelize) => { | ||
| queryInterface.addColumn('collections', 'filename', Sequelize.STRING) |
There was a problem hiding this comment.
down is supposed to be reverse of up not same
| }, | ||
|
|
||
| down: async (queryInterface, Sequelize) => { | ||
| queryInterface.addColumn('collections', 'category', Sequelize.STRING) |
There was a problem hiding this comment.
down is supposed to be reverse of up not same
| }, | ||
|
|
||
| down: async (queryInterface, Sequelize) => { | ||
| await queryInterface.dropTable('collections') |
There was a problem hiding this comment.
down is supposed to be reverse of up so it should not delete collection
api/models/collectionModel.js
Outdated
|
|
||
| Collection.associate = function (models) { | ||
| Collection.hasMany(models.CollectionUser, { | ||
| as: 'collection', |
There was a problem hiding this comment.
as is alias for collectionuser so it should not say collection as collection is the main table and associated table should hae different alias
api/models/resourceModel.js
Outdated
|
|
||
| Resources.associate = function (models) { | ||
| Resources.belongsToMany(ResourceUser, { | ||
| as: 'resource', |
There was a problem hiding this comment.
as is alias for resourceuser so it should not say collection as collection is the main table and associated table should have different alias possibly followers or just resourceuser
| }) | ||
| } | ||
| User.associate = function (models) { | ||
| User.hasMany(models.ResourceUser, { |
There was a problem hiding this comment.
as is alias for resourceuser so it should not say collection as collection is the main table and associated table should have different alias possibly resourceuser
api/models/userModel.js
Outdated
|
|
||
| User.associate = function (models) { | ||
| User.hasMany(models.CollectionUser, { | ||
| as: 'user', |
There was a problem hiding this comment.
as is alias for collectionuser so it should not say collection as collection is the main table and associated table should have different alias possibly followers or just collectionuser
836ebfc to
248accc
Compare
f10b1e1 to
8376107
Compare
No description provided.