Skip to content

Commit

Permalink
Release 8.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 authored Oct 18, 2023
2 parents d98cd7e + 76deb0e commit e5180ae
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 33 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# GameVault Backend Server Changelog

## 8.0.1

Recommended Gamevault App Version: `v1.7.0`

### Changes

- Fixed initial Database Setup not happening
- Increased stability of some migrations

## 8.0.0

Recommended Gamevault App Version: `v1.7.0`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gamevault-backend",
"version": "8.0.0",
"version": "8.0.1",
"description": "the self-hosted gaming platform for drm-free games",
"author": "Alkan Alper, Schäfer Philip GbR / Phalcode",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ export class RemoveImageDeduplication1691366400000
for (const foreignKey of gamevaultUserForeignKeysToDrop) {
try {
await queryRunner.dropForeignKey("gamevault_user", foreignKey);
} catch (error) {
// Handle the error or ignore it if the foreign key doesn't exist
console.error(`Error dropping foreign key ${foreignKey}`);
}
} catch (error) {}
}

await queryRunner.createForeignKeys("gamevault_user", [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export class ImageUploader1694211775520 implements MigrationInterface {
ALTER TABLE "progress" DROP CONSTRAINT "FK_ddcaca3a9db9d77105d51c02c24"
`);
await queryRunner.query(`
ALTER TABLE "gamevault_user" DROP CONSTRAINT "FK_4b83e27ed50c1e183a69fceef68"
ALTER TABLE "gamevault_user" DROP CONSTRAINT IF EXISTS "FK_4b83e27ed50c1e183a69fceef68"
`);
await queryRunner.query(`
ALTER TABLE "gamevault_user" DROP CONSTRAINT "FK_c1779b9b22212754248aa404bad"
ALTER TABLE "gamevault_user" DROP CONSTRAINT IF EXISTS "FK_c1779b9b22212754248aa404bad"
`);
await queryRunner.query(`
ALTER TABLE "image" DROP CONSTRAINT "FK_81cba867ad852a0b6402f0e82fb"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { Progress } from "../../../progress/progress.entity";
import { State } from "../../../progress/models/state.enum";
import { Logger } from "@nestjs/common";
export class DeleteEmptyProgresses1696967362000 implements MigrationInterface {
private readonly logger = new Logger(DeleteEmptyProgresses1696967362000.name);
name?: string;
transaction?: boolean;

public async up(queryRunner: QueryRunner): Promise<void> {
// Check for State Unplayed progresses with 0 Minutes.
const progressRepository = queryRunner.connection.getRepository(Progress);
const progressesToDelete = await progressRepository.findBy({
minutes_played: 0,
state: State.UNPLAYED,
});
progressRepository.remove(progressesToDelete);
this.logger.log(
`Database Migration deleted ${progressesToDelete.length} empty progresses from your database.`,
await queryRunner.query(
`DELETE FROM "progress" WHERE minutes_played = 0 AND state = 'UNPLAYED';`,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ export class RemoveImageDeduplication1691366400000
for (const foreignKey of gamevaultUserForeignKeysToDrop) {
try {
await queryRunner.dropForeignKey("gamevault_user", foreignKey);
} catch (error) {
// Handle the error or ignore it if the foreign key doesn't exist
console.error(`Error dropping foreign key ${foreignKey}`);
}
} catch (error) {}
}

await queryRunner.createForeignKeys("gamevault_user", [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { Progress } from "../../../progress/progress.entity";
import { State } from "../../../progress/models/state.enum";
import { Logger } from "@nestjs/common";
export class DeleteEmptyProgresses1696967362000 implements MigrationInterface {
private readonly logger = new Logger(DeleteEmptyProgresses1696967362000.name);
name?: string;
transaction?: boolean;

public async up(queryRunner: QueryRunner): Promise<void> {
// Check for State Unplayed progresses with 0 Minutes.
const progressRepository = queryRunner.connection.getRepository(Progress);
const progressesToDelete = await progressRepository.findBy({
minutes_played: 0,
state: State.UNPLAYED,
});
progressRepository.remove(progressesToDelete);
this.logger.log(
`Database Migration deleted ${progressesToDelete.length} empty progresses from your database.`,
await queryRunner.query(
`DELETE FROM "progress" WHERE minutes_played = 0 AND state = 'UNPLAYED';`,
);
}

Expand Down

0 comments on commit e5180ae

Please sign in to comment.