Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-05-13 08:47:58 +02:00
parent d015f24855
commit 731626aba0
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('ytpHashes', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
hash: {
type: Sequelize.STRING
},
link: {
type: Sequelize.STRING
},
messageID: {
type: Sequelize.BIGINT
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('ytpHashes');
}
};

12
models/ytphash.js Normal file
View file

@ -0,0 +1,12 @@
'use strict';
module.exports = (sequelize, DataTypes) => {
const ytpHash = sequelize.define('ytpHash', {
hash: DataTypes.STRING,
link: DataTypes.STRING,
messageID: DataTypes.BIGINT
}, {});
ytpHash.associate = function(models) {
// associations can be defined here
};
return ytpHash;
};