lots...
This commit is contained in:
63
models/sql/migrations/20240101174644-create-torrent.js
Normal file
63
models/sql/migrations/20240101174644-create-torrent.js
Normal file
@ -0,0 +1,63 @@
|
||||
'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');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user