forked from Supositware/Haha-Yes
Add leaderboard
parent
1aba9f9a81
commit
df3c7da255
@ -0,0 +1,33 @@
|
|||||||
|
'use strict';
|
||||||
|
module.exports = {
|
||||||
|
up: (queryInterface, Sequelize) => {
|
||||||
|
return queryInterface.createTable('guessLeaderboards', {
|
||||||
|
id: {
|
||||||
|
allowNull: false,
|
||||||
|
autoIncrement: true,
|
||||||
|
primaryKey: true,
|
||||||
|
type: Sequelize.INTEGER
|
||||||
|
},
|
||||||
|
memberID: {
|
||||||
|
type: Sequelize.BIGINT
|
||||||
|
},
|
||||||
|
try: {
|
||||||
|
type: Sequelize.INTEGER
|
||||||
|
},
|
||||||
|
difficulty: {
|
||||||
|
type: Sequelize.STRING
|
||||||
|
},
|
||||||
|
createdAt: {
|
||||||
|
allowNull: false,
|
||||||
|
type: Sequelize.DATE
|
||||||
|
},
|
||||||
|
updatedAt: {
|
||||||
|
allowNull: false,
|
||||||
|
type: Sequelize.DATE
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
down: (queryInterface, Sequelize) => {
|
||||||
|
return queryInterface.dropTable('guessLeaderboards');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,12 @@
|
|||||||
|
'use strict';
|
||||||
|
module.exports = (sequelize, DataTypes) => {
|
||||||
|
const guessLeaderboard = sequelize.define('guessLeaderboard', {
|
||||||
|
memberID: DataTypes.INTEGER,
|
||||||
|
try: DataTypes.INTEGER,
|
||||||
|
difficulty: DataTypes.STRING
|
||||||
|
}, {});
|
||||||
|
guessLeaderboard.associate = function(models) {
|
||||||
|
// associations can be defined here
|
||||||
|
};
|
||||||
|
return guessLeaderboard;
|
||||||
|
};
|
Loading…
Reference in New Issue