room.model.js 797 Bytes
Newer Older
seoyeon's avatar
seoyeon committed
1
2
import pkg from 'sequelize';
const { DataTypes } = pkg;
3
4
5
6
7
8

const RoomModel = (sequelize) => {
  const Room = sequelize.define(
    "room",
    {
      id: {
우지원's avatar
e    
우지원 committed
9
        type: DataTypes.STRING,
10
11
12
13
14
15
        primaryKey: true,
      },
      name: {
        type: DataTypes.STRING,
      },
      owner: {
Kim, Chaerin's avatar
merge19    
Kim, Chaerin committed
16
        type: DataTypes.INTEGER,
17
18
      },
      member: {
우지원's avatar
우지원 committed
19
        type: DataTypes.ARRAY(DataTypes.STRING),
Kim, Chaerin's avatar
merge19    
Kim, Chaerin committed
20
        //type: DataTypes.STRING,
21
      },
우지원's avatar
0716    
우지원 committed
22
23
      profileimg: {
        type: DataTypes.STRING,
Kim, Chaerin's avatar
Kim, Chaerin committed
24
        defaultValue: "defaultimg"
25
26
27
      },
      channel: {
        type: DataTypes.ARRAY(DataTypes.JSON),
Kim, Chaerin's avatar
Kim, Chaerin committed
28
        defaultValue: [{"회의": ["지원", "재연"]}, {"사담": ["지원", "재연", "서연"]}],
29
30
31
32
33
34
35
36
      },
    },
    { timestamps: true }
  );
  return Room;
};

export default RoomModel;
우지원's avatar
e    
우지원 committed
37

seoyeon's avatar
seoyeon committed
38