diff --git a/prisma/migrations/20250211230021_ensure_non_null_launch_and_setup_commands/migration.sql b/prisma/migrations/20250211230021_ensure_non_null_launch_and_setup_commands/migration.sql new file mode 100644 index 0000000..79a655d --- /dev/null +++ b/prisma/migrations/20250211230021_ensure_non_null_launch_and_setup_commands/migration.sql @@ -0,0 +1,20 @@ +/* + Warnings: + + - Made the column `launchCommand` on table `GameVersion` required. This step will fail if there are existing NULL values in that column. + - Made the column `setupCommand` on table `GameVersion` required. This step will fail if there are existing NULL values in that column. + +*/ +UPDATE "GameVersion" +SET "launchCommand" = '' +WHERE "launchCommand" is NULL; + +UPDATE "GameVersion" +SET "setupCommand" = '' +WHERE "launchCommand" is NULL; + +-- AlterTable +ALTER TABLE "GameVersion" ALTER COLUMN "launchCommand" SET NOT NULL, +ALTER COLUMN "launchCommand" SET DEFAULT '', +ALTER COLUMN "setupCommand" SET NOT NULL, +ALTER COLUMN "setupCommand" SET DEFAULT ''; diff --git a/prisma/schema/content.prisma b/prisma/schema/content.prisma index dc278a1..f64fdac 100644 --- a/prisma/schema/content.prisma +++ b/prisma/schema/content.prisma @@ -46,9 +46,9 @@ model GameVersion { platform Platform - launchCommand String? // Command to run to start. Platform-specific. Windows games on Linux will wrap this command in Proton/Wine + launchCommand String @default("") // Command to run to start. Platform-specific. Windows games on Linux will wrap this command in Proton/Wine launchArgs String[] - setupCommand String? // Command to setup game (dependencies and such) + setupCommand String @default("") // Command to setup game (dependencies and such) setupArgs String[] onlySetup Boolean @default(false)