Skip to content

collection mapping and adding files#239

Open
dixitsigdel8 wants to merge 9 commits intomainfrom
library-collection
Open

collection mapping and adding files#239
dixitsigdel8 wants to merge 9 commits intomainfrom
library-collection

Conversation

@dixitsigdel8
Copy link
Copy Markdown
Contributor

No description provided.

},

down: async (queryInterface, Sequelize) => {
queryInterface.addColumn('collections', 'filename', Sequelize.STRING)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

down is supposed to be reverse of up not same

},

down: async (queryInterface, Sequelize) => {
queryInterface.addColumn('collections', 'category', Sequelize.STRING)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

down is supposed to be reverse of up not same

},

down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('collections')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

down is supposed to be reverse of up so it should not delete collection


Collection.associate = function (models) {
Collection.hasMany(models.CollectionUser, {
as: 'collection',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as is alias for collectionuser so it should not say collection as collection is the main table and associated table should hae different alias


Resources.associate = function (models) {
Resources.belongsToMany(ResourceUser, {
as: 'resource',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


User.associate = function (models) {
User.hasMany(models.CollectionUser, {
as: 'user',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@lmmrssa lmmrssa force-pushed the library-collection branch from 836ebfc to 248accc Compare June 12, 2021 02:10
@lmmrssa lmmrssa force-pushed the library-collection branch from f10b1e1 to 8376107 Compare June 17, 2021 16:03
@SujalLama SujalLama self-assigned this Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants