room.model.js 779 Bytes
Newer Older
우지원's avatar
우지원 committed
1
import { DataTypes } from "sequelize";
2
3
4
5
6
7

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

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