overseer/migrations/0002_add_licenses_table.js

38 lines
955 B
JavaScript
Raw Permalink Normal View History

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('licenses', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
name: {
type: Sequelize.DataTypes.STRING,
allowNull: false,
},
key: {
type: Sequelize.DataTypes.STRING,
allowNull: false,
},
manufacturer: Sequelize.DataTypes.STRING,
seatsUsed: {
type: Sequelize.DataTypes.NUMBER,
defaultValue: 0,
},
seatsTotal: {
type: Sequelize.DataTypes.NUMBER,
defaultValue: 1,
},
purchasedFrom: Sequelize.DataTypes.STRING,
purchasedAt: Sequelize.DataTypes.DATE,
createdAt: Sequelize.DataTypes.DATE,
updatedAt: Sequelize.DataTypes.DATE,
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('licenses');
}
};