room.model.js 624 Bytes
Newer Older
1
2
3
4
5
6
7
import { DataTypes } from "sequelize";

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

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