diff --git a/models/fcmToken.js b/models/fcmToken.js index 0691d46f127f677911cda7fce19753581610e262..f9fa9207dcf3adaf53875e9c78fd040ee78f4eec 100644 --- a/models/fcmToken.js +++ b/models/fcmToken.js @@ -1,6 +1,6 @@ const { DataTypes } = require('sequelize'); const sequelize = require('../config/sequelize'); -const User = require('./User'); // �щ컮瑜� 寃쎈줈 �뺤씤 +const User = require('./user'); // �щ컮瑜� 寃쎈줈 �뺤씤 const FcmToken = sequelize.define('FcmToken', { userId: { @@ -20,10 +20,4 @@ const FcmToken = sequelize.define('FcmToken', { timestamps: true, }); -// 愿�怨� �ㅼ젙 -FcmToken.belongsTo(User, { foreignKey: 'userId', as: 'user' }); -User.hasMany(FcmToken, { foreignKey: 'userId', as: 'fcmTokenList' }); - - - module.exports = FcmToken; \ No newline at end of file diff --git a/models/index.js b/models/index.js index e4c4b6cc80107bfe28d820a4a50c289024fd6e87..a5096e08312b924c758f95b6b15ba077021696c6 100644 --- a/models/index.js +++ b/models/index.js @@ -28,6 +28,10 @@ User.hasMany(MeetingParticipant, { foreignKey: 'user_id', as: 'meetingParticipat Schedule.belongsTo(User, { foreignKey: 'user_id', as: 'user' }); User.hasMany(Schedule, { foreignKey: 'user_id', as: 'schedules' }); + +FcmToken.belongsTo(User, { foreignKey: 'userId', as: 'user' }); +User.hasMany(FcmToken, { foreignKey: 'userId', as: 'fcmTokenList' }); + Invite.belongsTo(Meeting, { foreignKey: 'meeting_id', as: 'meeting' }); Invite.belongsTo(User, { foreignKey: 'inviter_id', as: 'inviter' }); // 珥덈��� �ъ슜�� Invite.belongsTo(User, { foreignKey: 'invitee_id', as: 'invitee' }); // 珥덈�諛쏆� �ъ슜��