Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #193

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@

- TODO: Removed Deprecated Utility APIs

## 5.0.2

Recommended Gamevault App Version: `v1.5.0`

### Changes

- Fixed Broken Database Migrations

### Thanks

- @Kudjo

## 5.0.1

Recommended Gamevault App Version: `v1.5.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": "5.0.1",
"version": "5.0.2",
"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 @@ -15,25 +15,6 @@ export class ImageUploader1694211775520 implements MigrationInterface {
ADD "uploader_id" integer
`);

await queryRunner.query(
`ALTER TABLE "image" DROP CONSTRAINT IF EXISTS "UQ_e0626148aee5829fd312447001a"`,
);

// CLEAR ALL DUPES
await queryRunner.query(
`DELETE FROM image
WHERE id NOT IN (
SELECT MAX(id)
FROM image
GROUP BY source
);`,
);

await queryRunner.query(`
ALTER TABLE "image"
ADD CONSTRAINT "UQ_e0626148aee5829fd312447001a" UNIQUE ("source")
`);

await queryRunner.query(`
ALTER TABLE "progress" DROP CONSTRAINT IF EXISTS "FK_ddcaca3a9db9d77105d51c02c24"
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class NonUniqueImageSources1694219897048 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "image" DROP CONSTRAINT "UQ_e0626148aee5829fd312447001a"
ALTER TABLE "image" DROP CONSTRAINT IF EXISTS "UQ_e0626148aee5829fd312447001a"
`);
await queryRunner.query(`
ALTER TABLE "progress" DROP CONSTRAINT "FK_ddcaca3a9db9d77105d51c02c24"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ export class RemoveNotNullConstraints1693526400000
"source" varchar,
"path" varchar,
"media_type" varchar,
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path"),
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source")
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path")
)
`);
await queryRunner.query(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class ImageUploader1694211731607 implements MigrationInterface {
"path" varchar,
"media_type" varchar,
"uploader_id" integer,
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path")
)
`);
Expand Down Expand Up @@ -138,7 +137,6 @@ export class ImageUploader1694211731607 implements MigrationInterface {
"path" varchar,
"media_type" varchar,
"uploader_id" integer,
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path"),
CONSTRAINT "FK_81cba867ad852a0b6402f0e82fb" FOREIGN KEY ("uploader_id") REFERENCES "gamevault_user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
)
Expand Down Expand Up @@ -203,7 +201,6 @@ export class ImageUploader1694211731607 implements MigrationInterface {
"path" varchar,
"media_type" varchar,
"uploader_id" integer,
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path")
)
`);
Expand Down Expand Up @@ -321,7 +318,6 @@ export class ImageUploader1694211731607 implements MigrationInterface {
"source" varchar,
"path" varchar,
"media_type" varchar,
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path")
)
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export class NonUniqueImageSources1694219968449 implements MigrationInterface {
"media_type" varchar,
"uploader_id" integer,
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path"),
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "FK_81cba867ad852a0b6402f0e82fb" FOREIGN KEY ("uploader_id") REFERENCES "gamevault_user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
)
`);
Expand Down Expand Up @@ -80,7 +79,6 @@ export class NonUniqueImageSources1694219968449 implements MigrationInterface {
"media_type" varchar,
"uploader_id" integer,
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path"),
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "FK_81cba867ad852a0b6402f0e82fb" FOREIGN KEY ("uploader_id") REFERENCES "gamevault_user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
)
`);
Expand Down Expand Up @@ -269,7 +267,6 @@ export class NonUniqueImageSources1694219968449 implements MigrationInterface {
"media_type" varchar,
"uploader_id" integer,
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path"),
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "FK_81cba867ad852a0b6402f0e82fb" FOREIGN KEY ("uploader_id") REFERENCES "gamevault_user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
)
`);
Expand Down Expand Up @@ -327,7 +324,6 @@ export class NonUniqueImageSources1694219968449 implements MigrationInterface {
"media_type" varchar,
"uploader_id" integer,
CONSTRAINT "UQ_f03b89f33671086e6733828e79c" UNIQUE ("path"),
CONSTRAINT "UQ_d8bab01646004e7af66bf8439dd" UNIQUE ("source"),
CONSTRAINT "FK_81cba867ad852a0b6402f0e82fb" FOREIGN KEY ("uploader_id") REFERENCES "gamevault_user" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
)
`);
Expand Down