timetable.model.js 1.28 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
21
22
23
24
25
import Sequelize from "sequelize";

const { DataTypes } = Sequelize;

const TimeTableModel = (sequelize) => {
    const TimeTable = sequelize.define(
        "timetable",
        {
            id: {
                type: DataTypes.INTEGER,
                primaryKey: true,
                autoIncrement: true,
            },
            theater: {
                type: DataTypes.INTEGER,
            },
            movieId: {
                type: DataTypes.INTEGER,
            },
            title: {
                type: DataTypes.STRING,
            },
            release_date: {
                type: DataTypes.STRING
            },
Kim, Subin's avatar
Kim, Subin committed
26
27
28
29
            date: {  
                type: DataTypes.DATE,
            },
            start_time: {
30
31
32
                type: DataTypes.DATE,
                defaultValue: new Date(0)
            },
Kim, Subin's avatar
Kim, Subin committed
33
            end_time: {
34
35
                type: DataTypes.DATE,
                defaultValue: new Date(0)
Jiwon Yoon's avatar
Jiwon Yoon committed
36
            },
Kim, Subin's avatar
Kim, Subin committed
37
38
            partTime: {
                type: DataTypes.STRING,
Jiwon Yoon's avatar
Jiwon Yoon committed
39
            },
Kim, Subin's avatar
Kim, Subin committed
40
41
42
            week: {
                type: DataTypes.STRING
            }
Jiwon Yoon's avatar
Jiwon Yoon committed
43
44
45
46
47
48
49
50
51
52
53
        },
        {
            // timestamps: true,
            freezeTableName: true,
            tableName: "timetables"
        }
    );
    return TimeTable;
};

export default TimeTableModel;