Skip to content
Snippets Groups Projects
Select Git revision
  • 167c0c400e776e2ab27faced791c33fa4364355c
  • master default protected
  • deploy
  • develop
4 results

ChatRoomParticipants.js

Blame
  • ChatRoomParticipants.js 534 B
    // schemas/ChatRoomParticipant.js
    
    const mongoose = require('mongoose');
    
    const ChatRoomParticipantSchema = new mongoose.Schema({
      chat_room_id: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'ChatRoom',
        required: true,
      },
      user_id: {
        type: Number, // SQL의 Users 테이블 ID 참조
        required: true,
      },
      left_at: {
        type: Date,
        default: null,
      },
    }, {
      timestamps: { createdAt: 'joined_at', updatedAt: false },
    });
    
    module.exports = mongoose.model('ChatRoomParticipant', ChatRoomParticipantSchema);