From 731626aba0f2e4895ba41ae7194813b841e2cc12 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 13 May 2020 08:47:58 +0200 Subject: [PATCH] ytphash Signed-off-by: loicbersier --- migrations/20200513062350-create-ytp-hash.js | 33 ++++++++++++++++++++ models/ytphash.js | 12 +++++++ 2 files changed, 45 insertions(+) create mode 100644 migrations/20200513062350-create-ytp-hash.js create mode 100644 models/ytphash.js diff --git a/migrations/20200513062350-create-ytp-hash.js b/migrations/20200513062350-create-ytp-hash.js new file mode 100644 index 0000000..4a21406 --- /dev/null +++ b/migrations/20200513062350-create-ytp-hash.js @@ -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'); + } +}; \ No newline at end of file diff --git a/models/ytphash.js b/models/ytphash.js new file mode 100644 index 0000000..50024b5 --- /dev/null +++ b/models/ytphash.js @@ -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; +}; \ No newline at end of file