room.model.js 719 Bytes
Newer Older
우지원's avatar
0    
우지원 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),
20
      },
우지원's avatar
0716    
우지원 committed
21
22
      profileimg: {
        type: DataTypes.STRING,
우지원's avatar
0805    
우지원 committed
23
        // defaultValue: "defaultimg"
24
25
26
      },
      channel: {
        type: DataTypes.ARRAY(DataTypes.JSON),
이재연's avatar
   
이재연 committed
27
        defaultValue: [{"회의": []}, {"일반": []}],
28
29
30
31
32
33
34
35
      },
    },
    { timestamps: true }
  );
  return Room;
};

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