borgar table

This commit is contained in:
loicbersier 2019-10-09 01:32:07 +02:00
parent a23e8f60b5
commit fc0bd392c7
2 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,33 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('borgars', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
userID: {
type: Sequelize.BIGINT
},
level: {
type: Sequelize.INTEGER
},
xp: {
type: Sequelize.INTEGER
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('borgars');
}
};

12
models/borgar.js Normal file
View file

@ -0,0 +1,12 @@
'use strict';
module.exports = (sequelize, DataTypes) => {
const borgar = sequelize.define('borgar', {
userID: DataTypes.BIGINT,
level: DataTypes.INTEGER,
xp: DataTypes.INTEGER
}, {});
borgar.associate = function(models) {
// associations can be defined here
};
return borgar;
};