Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions models/team.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = function (sequelize, DataTypes) {
const Team = sequelize.define('Team', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
AllowNull: false
},
name: DataTypes.STRING,
description: DataTypes.STRING,
timestamps: true,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a return statement as well
return Team
its expected in index.js on line no 51. thats why your build is failing : |

}
31 changes: 31 additions & 0 deletions models/teamMember.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const Team = require('./team')
const User = require('./user')

module.exports = function (sequelize, DataTypes) {
const TeamMember = sequelize.define('TeamMember', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
AllowNull: false
},
team_id: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: 'Team',
key: 'id',
},
},
user_id: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: 'User',
key: 'id',
},
},
timestamps: true,
})
TeamMember.belongsTo(Team, { foreignKey: 'team_id' })
TeamMember.belongsTo(User, { foreignKey: 'user_id' })
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a return statement as well
return TeamMember
its expected in index.js on line no 51. thats why your build is failing : |

Copy link
Author

Choose a reason for hiding this comment

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

okay

}