feat(delete games): update prisma & delete games

This commit is contained in:
DecDuck
2024-12-23 21:12:32 +11:00
parent fd4a7d1981
commit 089c3e03f6
8 changed files with 111 additions and 55 deletions

View File

@ -0,0 +1,5 @@
-- DropForeignKey
ALTER TABLE "GameVersion" DROP CONSTRAINT "GameVersion_gameId_fkey";
-- AddForeignKey
ALTER TABLE "GameVersion" ADD CONSTRAINT "GameVersion_gameId_fkey" FOREIGN KEY ("gameId") REFERENCES "Game"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE "_DeveloperToGame" ADD CONSTRAINT "_DeveloperToGame_AB_pkey" PRIMARY KEY ("A", "B");
-- DropIndex
DROP INDEX "_DeveloperToGame_AB_unique";
-- AlterTable
ALTER TABLE "_GameToPublisher" ADD CONSTRAINT "_GameToPublisher_AB_pkey" PRIMARY KEY ("A", "B");
-- DropIndex
DROP INDEX "_GameToPublisher_AB_unique";

View File

@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"

View File

@ -36,7 +36,7 @@ model Game {
// A particular set of files that relate to the version
model GameVersion {
gameId String
game Game @relation(fields: [gameId], references: [id])
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
versionName String // Sub directory for the game files
created DateTime @default(now())