feat: refactor game achievement table

This commit is contained in:
Zamitto
2024-09-24 17:31:49 -03:00
parent f3a5f90bc7
commit f98432f6c6
8 changed files with 44 additions and 48 deletions

View File

@@ -1,20 +1,15 @@
import {
Column,
Entity,
JoinColumn,
OneToOne,
PrimaryGeneratedColumn,
} from "typeorm";
import type { Game } from "./game.entity";
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
@Entity("game_achievement")
export class GameAchievement {
@PrimaryGeneratedColumn()
id: number;
@OneToOne("Game", "achievements")
@JoinColumn()
game: Game;
@Column("text")
objectId: string;
@Column("text")
shop: string;
@Column("text", { nullable: true })
unlockedAchievements: string;

View File

@@ -12,7 +12,6 @@ import { Repack } from "./repack.entity";
import type { GameShop, GameStatus } from "@types";
import { Downloader } from "@shared";
import type { DownloadQueue } from "./download-queue.entity";
import { GameAchievement } from "./game-achievements.entity";
@Entity("game")
export class Game {
@@ -77,9 +76,6 @@ export class Game {
@JoinColumn()
repack: Repack;
@OneToOne("GameAchievement", "game")
achievements: GameAchievement;
@OneToOne("DownloadQueue", "game")
downloadQueue: DownloadQueue;