ytphash
Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
parent
d015f24855
commit
731626aba0
2 changed files with 45 additions and 0 deletions
33
migrations/20200513062350-create-ytp-hash.js
Normal file
33
migrations/20200513062350-create-ytp-hash.js
Normal 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
12
models/ytphash.js
Normal 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;
|
||||
};
|
Loading…
Reference in a new issue