migrations; torr search, dl, seed, delete; files scan, delete; configs

This commit is contained in:
Jurgis Sakalauskas
2023-02-03 17:41:40 +02:00
parent 8d354027fc
commit daaeda539b
84 changed files with 5456 additions and 301 deletions
@@ -0,0 +1,51 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateTorrentsTableAndRelateToFiles1673603746273
implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`alter table files
add torrent_id INTEGER;`,
);
await queryRunner.query(
`create unique index file_torrent_id
on files (torrent_id);`,
);
await queryRunner.query(
`create table torrents
(
id INTEGER primary key,
magnet VARCHAR(512),
name VARCHAR(256),
path VARCHAR(512),
size INTEGER,
stopped TINYINT,
info_hash VARCHAR(64),
progress REAL,
transmission_id INTEGER,
info TEXT
);`,
);
await queryRunner.query(
`create unique index torrent_magnet
on torrents (magnet);`,
);
await queryRunner.query(
`create unique index torrent_transmission_id
on torrents (transmission_id);`,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`alter table files
drop column torrent_id;`,
);
await queryRunner.query(`DROP TABLE torrents`);
}
}