25 lines
537 B
JavaScript
25 lines
537 B
JavaScript
|
|
"use strict";
|
||
|
|
|
||
|
|
module.exports = function(sequelize, DataTypes) {
|
||
|
|
//The id field is auto added and made primary key.
|
||
|
|
return sequelize.define('Venue', {
|
||
|
|
id: {
|
||
|
|
type: DataTypes.INTEGER,
|
||
|
|
primaryKey: true,
|
||
|
|
allowNull: false,
|
||
|
|
autoIncrement: true
|
||
|
|
},
|
||
|
|
name: {
|
||
|
|
type: DataTypes.STRING,
|
||
|
|
allowNull: false
|
||
|
|
},
|
||
|
|
visible: {
|
||
|
|
type: DataTypes.BOOLEAN,
|
||
|
|
allowNull: false,
|
||
|
|
defaultValue: true
|
||
|
|
}
|
||
|
|
}, {
|
||
|
|
freezeTableName: true // Model tableName will be the same as the model name
|
||
|
|
});
|
||
|
|
};
|