tpbproxy/models/sql/migrations/20240101174644-create-torrent.js
2024-01-05 22:06:34 -05:00

63 lines
1.3 KiB
JavaScript

'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('Torrents', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
torrent_id: {
type: Sequelize.STRING
},
hashString: {
type: Sequelize.STRING
},
magnetLink: {
type: Sequelize.STRING
},
name: {
type: Sequelize.STRING
},
status: {
type: Sequelize.NUMBER
},
isPrivate: {
type: Sequelize.BOOLEAN,
defaultValue: false,
allowNull: false,
},
percentDone: {
type: Sequelize.FLOAT
},
errorString: {
type: Sequelize.STRING,
allowNull: true
},
downloadDir: {
type: Sequelize.STRING,
allowNull: true
},
sizeWhenDone: {
type: Sequelize.NUMBER,
allowNull: true
},
added_by: {
type: Sequelize.STRING
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('Torrents');
}
};