borgar table
This commit is contained in:
parent
a23e8f60b5
commit
fc0bd392c7
2 changed files with 45 additions and 0 deletions
33
migrations/20191008230533-create-borgar.js
Normal file
33
migrations/20191008230533-create-borgar.js
Normal 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
12
models/borgar.js
Normal 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;
|
||||
};
|
Loading…
Reference in a new issue