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

const { DataTypes } = Sequelize;

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

export default ReservationModel;