Files
PetitTeton/migrations/20160602030147-Category.js

40 lines
702 B
JavaScript

'use strict';
module.exports = {
up: function (query, Sequelize) {
var DataTypes = Sequelize; //Allow for more cut and paste :)
return query.createTable('Category', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
allowNull: false,
autoIncrement: true
},
name: {
type: DataTypes.STRING,
allowNull: false
},
visible: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
},
createdAt: {
type: DataTypes.DATE,
allowNull: false
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false
}
}, {
charset: 'utf8'
});
},
down: function (query, Sequelize) {
return query.dropTable('Category');
}
};