migrate to prisma v7 (#345)
* migrate to prisma v7 * fix prisma type imports * update prisma version in docker * fix prisma cli breaking things
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ ENV NUXT_TELEMETRY_DISABLED=1
|
|||||||
|
|
||||||
# RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn add --network-timeout 1000000 --no-lockfile --ignore-scripts prisma@6.11.1
|
# RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn add --network-timeout 1000000 --no-lockfile --ignore-scripts prisma@6.11.1
|
||||||
RUN apk add --no-cache pnpm 7zip nginx
|
RUN apk add --no-cache pnpm 7zip nginx
|
||||||
RUN pnpm install prisma@6.11.1
|
RUN pnpm install prisma@7.3.0
|
||||||
# init prisma to download all required files
|
# init prisma to download all required files
|
||||||
RUN pnpm prisma init
|
RUN pnpm prisma init
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -29,7 +29,8 @@
|
|||||||
"@nuxt/image": "^1.10.0",
|
"@nuxt/image": "^1.10.0",
|
||||||
"@nuxt/kit": "^3.20.1",
|
"@nuxt/kit": "^3.20.1",
|
||||||
"@nuxtjs/i18n": "^9.5.5",
|
"@nuxtjs/i18n": "^9.5.5",
|
||||||
"@prisma/client": "^6.11.1",
|
"@prisma/adapter-pg": "^7.3.0",
|
||||||
|
"@prisma/client": "^7.3.0",
|
||||||
"@simplewebauthn/browser": "^13.2.2",
|
"@simplewebauthn/browser": "^13.2.2",
|
||||||
"@simplewebauthn/server": "^13.2.2",
|
"@simplewebauthn/server": "^13.2.2",
|
||||||
"@tailwindcss/vite": "^4.0.6",
|
"@tailwindcss/vite": "^4.0.6",
|
||||||
@@ -56,7 +57,7 @@
|
|||||||
"parse-cosekey": "^1.0.2",
|
"parse-cosekey": "^1.0.2",
|
||||||
"pino": "^9.7.0",
|
"pino": "^9.7.0",
|
||||||
"pino-pretty": "^13.0.0",
|
"pino-pretty": "^13.0.0",
|
||||||
"prisma": "6.11.1",
|
"prisma": "7.3.0",
|
||||||
"sanitize-filename": "^1.6.3",
|
"sanitize-filename": "^1.6.3",
|
||||||
"semver": "^7.7.1",
|
"semver": "^7.7.1",
|
||||||
"shescape": "^2.1.8",
|
"shescape": "^2.1.8",
|
||||||
|
|||||||
Generated
+655
-109
File diff suppressed because it is too large
Load Diff
+11
-4
@@ -1,10 +1,17 @@
|
|||||||
import { config } from "dotenv";
|
import { config } from "dotenv";
|
||||||
import type { PrismaConfig } from "prisma";
|
import { defineConfig } from "prisma/config";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
|
// load .env variables
|
||||||
config();
|
config();
|
||||||
|
|
||||||
export default {
|
// need to use built in env access as prisma's env function throws when DATABASE_URL is undefined
|
||||||
|
// this is acceptable as prisma throws already it actually needs the URL
|
||||||
|
const databaseURL = process.env.DATABASE_URL;
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
schema: path.join("prisma"),
|
schema: path.join("prisma"),
|
||||||
earlyAccess: true,
|
datasource: {
|
||||||
} satisfies PrismaConfig;
|
url: databaseURL,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// TLDR: vite removes it during bundling it or something like that
|
// TLDR: vite removes it during bundling it or something like that
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client"
|
provider = "prisma-client"
|
||||||
output = "client"
|
output = "./client"
|
||||||
previewFeatures = ["fullTextSearchPostgres", "relationJoins"]
|
previewFeatures = ["fullTextSearchPostgres", "relationJoins"]
|
||||||
binaryTargets = ["native", "debian-openssl-3.0.x"]
|
binaryTargets = ["native", "debian-openssl-3.0.x"]
|
||||||
}
|
}
|
||||||
@@ -21,5 +21,4 @@ generator client {
|
|||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "postgresql"
|
||||||
url = env("DATABASE_URL")
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AuthMec } from "~/prisma/client/enums";
|
import { AuthMec } from "~/prisma/client/enums";
|
||||||
import type { JsonArray } from "@prisma/client/runtime/library";
|
import type { JsonArray } from "@prisma/client/runtime/client";
|
||||||
import { type } from "arktype";
|
import { type } from "arktype";
|
||||||
import prisma from "~/server/internal/db/database";
|
import prisma from "~/server/internal/db/database";
|
||||||
import sessionHandler from "~/server/internal/session";
|
import sessionHandler from "~/server/internal/session";
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { PrismaClient } from "~/prisma/client/client";
|
import { PrismaClient } from "~/prisma/client/client";
|
||||||
// import { PrismaPg } from "@prisma/adapter-pg";
|
import { PrismaPg } from "@prisma/adapter-pg";
|
||||||
|
|
||||||
const prismaClientSingleton = () => {
|
const prismaClientSingleton = () => {
|
||||||
// const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });
|
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });
|
||||||
// const prisma = new PrismaClient({ adapter });
|
const prisma = new PrismaClient({ adapter });
|
||||||
const prisma = new PrismaClient();
|
|
||||||
return prisma;
|
return prisma;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { JsonValue } from "@prisma/client/runtime/library";
|
import type { JsonValue } from "@prisma/client/runtime/client";
|
||||||
|
|
||||||
export type DropletManifest = V2Manifest;
|
export type DropletManifest = V2Manifest;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import prisma from "../db/database";
|
|||||||
import type { SessionProvider, SessionWithToken } from "./types";
|
import type { SessionProvider, SessionWithToken } from "./types";
|
||||||
import cacheHandler from "../cache";
|
import cacheHandler from "../cache";
|
||||||
import type { SessionWhereInput, JsonFilter } from "~/prisma/client/models";
|
import type { SessionWhereInput, JsonFilter } from "~/prisma/client/models";
|
||||||
import type { InputJsonValue } from "@prisma/client/runtime/library";
|
import type { InputJsonValue } from "@prisma/client/runtime/client";
|
||||||
|
|
||||||
export default function createDBSessionHandler(): SessionProvider {
|
export default function createDBSessionHandler(): SessionProvider {
|
||||||
const cache = cacheHandler.createCache<SessionWithToken>("DBSession");
|
const cache = cacheHandler.createCache<SessionWithToken>("DBSession");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { LibraryBackend } from "~/prisma/client/enums";
|
import type { LibraryBackend } from "~/prisma/client/enums";
|
||||||
import prisma from "../internal/db/database";
|
import prisma from "../internal/db/database";
|
||||||
import type { JsonValue } from "@prisma/client/runtime/library";
|
import type { JsonValue } from "@prisma/client/runtime/client";
|
||||||
import type { LibraryProvider } from "../internal/library/provider";
|
import type { LibraryProvider } from "../internal/library/provider";
|
||||||
import { FilesystemProvider } from "../internal/library/providers/filesystem";
|
import { FilesystemProvider } from "../internal/library/providers/filesystem";
|
||||||
import libraryManager from "../internal/library";
|
import libraryManager from "../internal/library";
|
||||||
|
|||||||
Reference in New Issue
Block a user