room.model.js 641 Bytes
Newer Older
Kim, Chaerin's avatar
Kim, Chaerin 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: {
우지원's avatar
e    
우지원 committed
16
        type: DataTypes.ARRAY(DataTypes.STRING),
17
18
      },
      member: {
우지원's avatar
e    
우지원 committed
19
        type: DataTypes.ARRAY(DataTypes.STRING),
20
      },
우지원's avatar
0716    
우지원 committed
21
22
      profileimg: {
        type: DataTypes.STRING,
23
24
25
26
27
28
29
30
31
32
33
      },
      channel: {
        type: DataTypes.ARRAY(DataTypes.JSON),
      },
    },
    { timestamps: true }
  );
  return Room;
};

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