reservation.model.js 1.13 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
16
17
18
19
20
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,
            },  
            theater: {
                type: DataTypes.INTEGER,
            },
            row: {
21
                type: DataTypes.INTEGER,
Jiwon Yoon's avatar
Jiwon Yoon committed
22
23
24
25
26
27
28
            },
            col: {
                type: DataTypes.INTEGER,
            },
            timetable:{
                type: DataTypes.INTEGER,
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
29
30
31
            userType:{
                type: DataTypes.STRING,
            },
Jiwon Yoon's avatar
Jiwon Yoon committed
32
33
34
35
            user:{
                type: DataTypes.INTEGER,
            },
            payment:{
Jiwon Yoon's avatar
Jiwon Yoon committed
36
                type: DataTypes.STRING,
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;