reservation.model.js 1.05 KB
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Sequelize from "sequelize";

const { DataTypes } = Sequelize;

const ReservationModel = (sequelize) => {
    const Reservation = sequelize.define(
        "reservation",
        {
            id: {
                type: DataTypes.INTEGER,
                primaryKey: true,
                autoIncrement: true,
            },
            movieId: {
                type: DataTypes.INTEGER,
Jiwon Yoon's avatar
Jiwon Yoon committed
16
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
17
            row: {
18
                type: DataTypes.INTEGER,
Jiwon Yoon's avatar
Jiwon Yoon committed
19
20
21
22
            },
            col: {
                type: DataTypes.INTEGER,
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
23
            userType: {
Jiwon Yoon's avatar
Jiwon Yoon committed
24
25
                type: DataTypes.STRING,
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
26
            user: {
Jiwon Yoon's avatar
Jiwon Yoon committed
27
28
                type: DataTypes.INTEGER,
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
29
            payment: {
Jiwon Yoon's avatar
Jiwon Yoon committed
30
                type: DataTypes.STRING,
Jiwon Yoon's avatar
Jiwon Yoon committed
31
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
32
            totalFee: {
Jiwon Yoon's avatar
Jiwon Yoon committed
33
                type: DataTypes.INTEGER,
Jiwon Yoon's avatar
Jiwon Yoon committed
34
35
36
37
38
39
40
41
42
43
44
45
            }
        },
        {
            timestamps: true,
            freezeTableName: true,
            tableName: "reservations"
        }
    );
    return Reservation;
};

export default ReservationModel;