Skip to content

Commit

Permalink
Merge pull request #984 from serenity-kit/upgrade-prisma
Browse files Browse the repository at this point in the history
upgrade prisma
  • Loading branch information
nikgraf authored Apr 25, 2024
2 parents 2d99865 + 7382585 commit cda4958
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 38 deletions.
4 changes: 3 additions & 1 deletion apps/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM node:18-alpine
FROM node:20-alpine

# Create app directory
WORKDIR /usr/src/app

COPY . .

EXPOSE $PORT
# necessary for small machines on fly.io to avoid crashing during npm install
ENV NODE_OPTIONS=--max_old_space_size=4096
CMD ["npm", "run", "start:prod" ]
2 changes: 2 additions & 0 deletions apps/backend/fly.production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

app = "serenity-api-production"
primary_region = "ams"
# necessary for small machines on fly.io to avoid running out of memory
swap_size_mb = 2048

[build]

Expand Down
2 changes: 2 additions & 0 deletions apps/backend/fly.staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

app = "serenity-api-staging"
primary_region = "ams"
# necessary for small machines on fly.io to avoid running out of memory
swap_size_mb = 2048

[build]

Expand Down
6 changes: 3 additions & 3 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:copy-externals": "mkdir node_modules/@serenity-kit && cp -r ../../node_modules/@serenity-kit/opaque ./node_modules/@serenity-kit/opaque",
"build": "yarn && yarn clean && yarn prisma:prod:generate && yarn ncc build ./src/index.ts -o build --external @serenity-kit/opaque && yarn build:copy-externals",
"deploy": "yarn build && fly launch",
"prisma:prod:migrate": "yarn global add prisma@4 && DATABASE_URL=$DATABASE_URL prisma migrate deploy",
"prisma:prod:migrate": "yarn global add prisma@5 && DATABASE_URL=$DATABASE_URL prisma migrate deploy",
"prisma:prod:generate": "DATABASE_URL=$DATABASE_URL prisma generate",
"prisma:prod:studio": "DATABASE_URL=$DATABASE_URL prisma studio",
"prisma:test:studio": "DATABASE_URL=postgres://prisma:prisma@localhost:5432/serenity_test prisma studio",
Expand All @@ -26,7 +26,7 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.477.0",
"@aws-sdk/s3-request-presigner": "^3.477.0",
"@prisma/client": "^4.8.0",
"@prisma/client": "^5.13.0",
"@serenity-kit/opaque": "^0.8.0",
"@serenity-tools/common": "*",
"@serenity-tools/secsync": "*",
Expand All @@ -51,7 +51,7 @@
"eslint": "^8.24.0",
"graphql-request": "^6.1.0",
"jest": "^29.1.1",
"prisma": "^4.8.0",
"prisma": "^5.13.0",
"ts-node": "10.9.2",
"ts-node-dev": "^2.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ForbiddenError, UserInputError } from "apollo-server-express";
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/database/device/getDevices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isDeviceWithUserId } from "../../utils/device/isDeviceWithUserId";
import { prisma } from "../prisma";

type Cursor = {
signingPublicKey?: string;
signingPublicKey: string;
};

type Params = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Prisma } from "../../../prisma/generated/output";
import { prisma } from "../prisma";

type Cursor = {
token?: string;
token: string;
};

type Params = {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/database/document/getDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Prisma } from "../../../prisma/generated/output";
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/database/folder/getSubfolders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Prisma } from "../../../prisma/generated/output";
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/database/folder/getWorkspaceFolders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Prisma } from "../../../prisma/generated/output";
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { WorkspaceInvitation } from "../../types/workspace";
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as workspaceMemberDevicesProofUtil from "@serenity-kit/workspace-member
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/database/workspace/getWorkspaceMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { formatWorkspaceMember } from "../../types/workspace";
import { prisma } from "../prisma";

type Cursor = {
userId?: string;
userId: string;
};

type Params = {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/database/workspace/getWorkspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { formatWorkspace } from "../../types/workspace";
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { prisma } from "../prisma";

type Cursor = {
id?: string;
id: string;
};

type Params = {
Expand Down
73 changes: 51 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4080,22 +4080,46 @@
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.2.tgz#830beaec4b4091a9e9398ac50f865ddea52186b9"
integrity sha512-92FRmppjjqz29VMJ2dn+xdyXZBrMlE42AV6Kq6BwjWV7CNUW1hs2FtxSNLQE+gJhaZ6AAmYuO9y8dshhcBl7vA==

"@prisma/client@^4.8.0":
version "4.8.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.8.0.tgz#6ec7adaca6a2e233d7e41dbe7cc6d0fa6143a407"
integrity sha512-Y1riB0p2W52kh3zgssP/YAhln3RjBFcJy3uwEiyjmU+TQYh6QTZDRFBo3JtBWuq2FyMOl1Rye8jxzUP+n0l5Cg==
dependencies:
"@prisma/engines-version" "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe"

"@prisma/engines-version@4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe":
version "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe.tgz#30401aba1029e7d32e3cb717e705a7c92ccc211e"
integrity sha512-MHSOSexomRMom8QN4t7bu87wPPD+pa+hW9+71JnVcF3DqyyO/ycCLhRL1we3EojRpZxKvuyGho2REQsMCvxcJw==

"@prisma/engines@4.8.0":
version "4.8.0"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-4.8.0.tgz#5123c67dc0d2caa008268fc63081ca2d68b2ed7e"
integrity sha512-A1Asn2rxZMlLAj1HTyfaCv0VQrLUv034jVay05QlqZg1qiHPeA3/pGTfNMijbsMYCsGVxfWEJuaZZuNxXGMCrA==
"@prisma/client@^5.13.0":
version "5.13.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.13.0.tgz#b9f1d0983d714e982675201d8222a9ecb4bdad4a"
integrity sha512-uYdfpPncbZ/syJyiYBwGZS8Gt1PTNoErNYMuqHDa2r30rNSFtgTA/LXsSk55R7pdRTMi5pHkeP9B14K6nHmwkg==

"@prisma/debug@5.13.0":
version "5.13.0"
resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-5.13.0.tgz#d88b0f6fafa0c216e20e284ed9fc30f1cbe45786"
integrity sha512-699iqlEvzyCj9ETrXhs8o8wQc/eVW+FigSsHpiskSFydhjVuwTJEfj/nIYqTaWFYuxiWQRfm3r01meuW97SZaQ==

"@prisma/engines-version@5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b":
version "5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b.tgz#a72a4fb83ba1fd01ad45f795aa55168f60d34723"
integrity sha512-AyUuhahTINGn8auyqYdmxsN+qn0mw3eg+uhkp8zwknXYIqoT3bChG4RqNY/nfDkPvzWAPBa9mrDyBeOnWSgO6A==

"@prisma/engines@5.13.0":
version "5.13.0"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.13.0.tgz#8994ebf7b4e35aee7746a8465ec22738379bcab6"
integrity sha512-hIFLm4H1boj6CBZx55P4xKby9jgDTeDG0Jj3iXtwaaHmlD5JmiDkZhh8+DYWkTGchu+rRF36AVROLnk0oaqhHw==
dependencies:
"@prisma/debug" "5.13.0"
"@prisma/engines-version" "5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b"
"@prisma/fetch-engine" "5.13.0"
"@prisma/get-platform" "5.13.0"

"@prisma/fetch-engine@5.13.0":
version "5.13.0"
resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-5.13.0.tgz#9b6945c7b38bb59e840f8905b20ea7a3d059ca55"
integrity sha512-Yh4W+t6YKyqgcSEB3odBXt7QyVSm0OQlBSldQF2SNXtmOgMX8D7PF/fvH6E6qBCpjB/yeJLy/FfwfFijoHI6sA==
dependencies:
"@prisma/debug" "5.13.0"
"@prisma/engines-version" "5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b"
"@prisma/get-platform" "5.13.0"

"@prisma/get-platform@5.13.0":
version "5.13.0"
resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-5.13.0.tgz#99ef909a52b9d79b64d72d2d3d8210c4892b6572"
integrity sha512-B/WrQwYTzwr7qCLifQzYOmQhZcFmIFhR81xC45gweInSUn2hTEbfKUPd2keAog+y5WI5xLAFNJ3wkXplvSVkSw==
dependencies:
"@prisma/debug" "5.13.0"

"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
Expand Down Expand Up @@ -11067,7 +11091,12 @@ graphql-ws@^5.14.0:
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.2.tgz#7db6f6138717a544d9480f0213f65f2841ed1c52"
integrity sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w==

graphql@15.8.0, graphql@^16.6.0, graphql@^16.8.1:
graphql@15.8.0:
version "15.8.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38"
integrity sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==

graphql@^16.8.1:
version "16.8.1"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07"
integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==
Expand Down Expand Up @@ -15035,12 +15064,12 @@ pretty-format@^29.0.0, pretty-format@^29.7.0:
ansi-styles "^5.0.0"
react-is "^18.0.0"

prisma@^4.8.0:
version "4.8.0"
resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.8.0.tgz#634dbbdc9d3f76c61604880251673d08ccb6f02b"
integrity sha512-DWIhxvxt8f4h6MDd35mz7BJff+fu7HItW3WPDIEpCR3RzcOWyiHBbLQW5/DOgmf+pRLTjwXQob7kuTZVYUAw5w==
prisma@^5.13.0:
version "5.13.0"
resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.13.0.tgz#1f06e20ccfb6038ad68869e6eacd3b346f9d0851"
integrity sha512-kGtcJaElNRAdAGsCNykFSZ7dBKpL14Cbs+VaQ8cECxQlRPDjBlMHNFYeYt0SKovAVy2Y65JXQwB3A5+zIQwnTg==
dependencies:
"@prisma/engines" "4.8.0"
"@prisma/engines" "5.13.0"

process-nextick-args@~2.0.0:
version "2.0.1"
Expand Down

0 comments on commit cda4958

Please sign in to comment.