mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
update migration so it updates xatab repacks
This commit is contained in:
parent
6a52c26874
commit
689fe5715e
1 changed files with 5 additions and 5 deletions
|
@ -3,7 +3,7 @@ import { Repack } from "@main/entity";
|
||||||
import { app } from "electron";
|
import { app } from "electron";
|
||||||
import { chunk } from "lodash-es";
|
import { chunk } from "lodash-es";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { MigrationInterface, QueryRunner, Table } from "typeorm";
|
import { In, MigrationInterface, QueryRunner, Table } from "typeorm";
|
||||||
|
|
||||||
export class FixRepackUploadDate1715900413313 implements MigrationInterface {
|
export class FixRepackUploadDate1715900413313 implements MigrationInterface {
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
@ -19,7 +19,7 @@ export class FixRepackUploadDate1715900413313 implements MigrationInterface {
|
||||||
);
|
);
|
||||||
|
|
||||||
await queryRunner.query(
|
await queryRunner.query(
|
||||||
`INSERT INTO repack_temp (title, old_id) SELECT title, id FROM repack WHERE repacker = 'onlinefix';`
|
`INSERT INTO repack_temp (title, old_id) SELECT title, id FROM repack WHERE repacker IN ('onlinefix', 'Xatab');`
|
||||||
);
|
);
|
||||||
|
|
||||||
await queryRunner.query(`DELETE FROM repack WHERE repacker = 'onlinefix';`);
|
await queryRunner.query(`DELETE FROM repack WHERE repacker = 'onlinefix';`);
|
||||||
|
@ -34,14 +34,14 @@ export class FixRepackUploadDate1715900413313 implements MigrationInterface {
|
||||||
|
|
||||||
const updateRepackRepository = updateDataSource.getRepository(Repack);
|
const updateRepackRepository = updateDataSource.getRepository(Repack);
|
||||||
|
|
||||||
const updatedOnlineFix = await updateRepackRepository.find({
|
const updatedRepacks = await updateRepackRepository.find({
|
||||||
where: {
|
where: {
|
||||||
repacker: "onlinefix",
|
repacker: In(["onlinefix", "Xatab"]),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const chunks = chunk(
|
const chunks = chunk(
|
||||||
updatedOnlineFix.map((repack) => {
|
updatedRepacks.map((repack) => {
|
||||||
const { id: _, ...rest } = repack;
|
const { id: _, ...rest } = repack;
|
||||||
return rest;
|
return rest;
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue