reservation.model.js 1.12 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
            tid:{
                type: DataTypes.STRING,
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
17
18
19
20
            movieId: {
                type: DataTypes.INTEGER,
            },  
            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
27
28
            userType:{
                type: DataTypes.STRING,
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
29
30
31
32
            user:{
                type: DataTypes.INTEGER,
            },
            payment:{
Jiwon Yoon's avatar
Jiwon Yoon committed
33
                type: DataTypes.STRING,
Jiwon Yoon's avatar
Jiwon Yoon committed
34
35
36
            },
            totalFee:{
                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;