theater.model.js 744 Bytes
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
4
5
6
7
8
import Sequelize from "sequelize";

const { DataTypes } = Sequelize;

const TheaterModel = (sequelize) => {
    const Theater = sequelize.define(
        "theater",
        {
Kim, Subin's avatar
theater    
Kim, Subin committed
9
            id: {
Kim, Subin's avatar
Kim, Subin committed
10
11
                type: DataTypes.INTEGER,
                primaryKey: true,
Kim, Subin's avatar
theater    
Kim, Subin committed
12
13
14
15
                autoIncrement: true,
            },
            theaterName: {
                type: DataTypes.STRING
Kim, Subin's avatar
Kim, Subin committed
16
17
            },
            rows: {
Kim, Subin's avatar
Kim, Subin committed
18
                type: DataTypes.INTEGER,
Kim, Subin's avatar
Kim, Subin committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
            },
            columns: {
                type: DataTypes.INTEGER,
            }
        },
        {
            timestamps: true,
            freezeTableName: true,
            tableName: "theaters"
        }
    );
    return Theater;
};

export default TheaterModel;