From 0a270b267c68495fcacd1348756c5dc0142fea7b Mon Sep 17 00:00:00 2001 From: DecDuck Date: Sun, 20 Apr 2025 18:12:29 +1000 Subject: [PATCH] fix: prisma migrations in docker i hate prisma so so so so so much --- Dockerfile | 4 +- build/launch.sh | 2 + package.json | 6 +- prisma/{schema => }/app.prisma | 0 prisma/{schema => }/auth.prisma | 0 prisma/{schema => }/client.prisma | 0 prisma/{schema => }/collection.prisma | 0 prisma/{schema => }/content.prisma | 0 prisma/{schema => }/news.prisma | 0 prisma/{schema => }/schema.prisma | 3 - prisma/{schema => }/user.prisma | 0 yarn.lock | 84 +++++++++++++-------------- 12 files changed, 49 insertions(+), 50 deletions(-) rename prisma/{schema => }/app.prisma (100%) rename prisma/{schema => }/auth.prisma (100%) rename prisma/{schema => }/client.prisma (100%) rename prisma/{schema => }/collection.prisma (100%) rename prisma/{schema => }/content.prisma (100%) rename prisma/{schema => }/news.prisma (100%) rename prisma/{schema => }/schema.prisma (66%) rename prisma/{schema => }/user.prisma (100%) diff --git a/Dockerfile b/Dockerfile index a4ea2be..affddb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,11 +21,11 @@ WORKDIR /app COPY --from=build-system /build/.output ./app COPY --from=build-system /build/prisma ./prisma -COPY --from=build-system /build/package.json . +COPY --from=build-system /build/package.json ./ COPY --from=build-system /build/build ./startup # OpenSSL as a dependency for Drop (TODO: seperate build environment) RUN apt-get update -y && apt-get install -y openssl -RUN yarn global add prisma +RUN yarn global add prisma@6.6.0 CMD ["/app/startup/launch.sh"] \ No newline at end of file diff --git a/build/launch.sh b/build/launch.sh index 2a7166d..0925938 100755 --- a/build/launch.sh +++ b/build/launch.sh @@ -1,6 +1,8 @@ #!/bin/bash # This file starts up the Drop server by running migrations and then starting the executable +echo "[Drop] performing migrations..." +ls ./prisma/migrations/ prisma migrate deploy # Actually start the application diff --git a/package.json b/package.json index ebe80db..43e321f 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@heroicons/vue": "^2.1.5", "@nuxt/fonts": "^0.11.0", "@nuxt/image": "^1.10.0", - "@prisma/client": "^6.5.0", + "@prisma/client": "^6.6.0", "@tailwindcss/vite": "^4.0.6", "argon2": "^0.41.1", "arktype": "^2.1.10", @@ -36,7 +36,7 @@ "micromark": "^4.0.1", "nuxt": "^3.16.2", "nuxt-security": "2.2.0", - "prisma": "^6.5.0", + "prisma": "^6.6.0", "sharp": "^0.33.5", "stream-mime-type": "^2.0.0", "turndown": "^7.2.0", @@ -72,6 +72,6 @@ } }, "prisma": { - "schema": "./prisma/schema" + "schema": "./prisma" } } diff --git a/prisma/schema/app.prisma b/prisma/app.prisma similarity index 100% rename from prisma/schema/app.prisma rename to prisma/app.prisma diff --git a/prisma/schema/auth.prisma b/prisma/auth.prisma similarity index 100% rename from prisma/schema/auth.prisma rename to prisma/auth.prisma diff --git a/prisma/schema/client.prisma b/prisma/client.prisma similarity index 100% rename from prisma/schema/client.prisma rename to prisma/client.prisma diff --git a/prisma/schema/collection.prisma b/prisma/collection.prisma similarity index 100% rename from prisma/schema/collection.prisma rename to prisma/collection.prisma diff --git a/prisma/schema/content.prisma b/prisma/content.prisma similarity index 100% rename from prisma/schema/content.prisma rename to prisma/content.prisma diff --git a/prisma/schema/news.prisma b/prisma/news.prisma similarity index 100% rename from prisma/schema/news.prisma rename to prisma/news.prisma diff --git a/prisma/schema/schema.prisma b/prisma/schema.prisma similarity index 66% rename from prisma/schema/schema.prisma rename to prisma/schema.prisma index 3d004c4..814bed4 100644 --- a/prisma/schema/schema.prisma +++ b/prisma/schema.prisma @@ -1,9 +1,6 @@ // This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema -// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? -// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init - generator client { provider = "prisma-client-js" previewFeatures = ["prismaSchemaFolder", "omitApi", "fullTextSearchPostgres"] diff --git a/prisma/schema/user.prisma b/prisma/user.prisma similarity index 100% rename from prisma/schema/user.prisma rename to prisma/user.prisma diff --git a/yarn.lock b/yarn.lock index 7306926..a0f7d4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1485,54 +1485,54 @@ resolved "https://registry.yarnpkg.com/@poppinss/exception/-/exception-1.2.1.tgz#8a5f2120fabb64a99772166d537d8a97490209ff" integrity sha512-aQypoot0HPSJa6gDPEPTntc1GT6QINrSbgRlRhadGW2WaYqUK3tK4Bw9SBMZXhmxd3GeAlZjVcODHgiu+THY7A== -"@prisma/client@^6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-6.5.0.tgz#b5f4aa3820ff523734ef4e8dffe364ac9888369e" - integrity sha512-M6w1Ql/BeiGoZmhMdAZUXHu5sz5HubyVcKukbLs3l0ELcQb8hTUJxtGEChhv4SVJ0QJlwtLnwOLgIRQhpsm9dw== +"@prisma/client@^6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-6.6.0.tgz#21e8cf507091b6cffc8453970f782cb6adef0004" + integrity sha512-vfp73YT/BHsWWOAuthKQ/1lBgESSqYqAWZEYyTdGXyFAHpmewwWL2Iz6ErIzkj4aHbuc6/cGSsE6ZY+pBO04Cg== -"@prisma/config@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@prisma/config/-/config-6.5.0.tgz#6a9f42143d5cab2ab304517d8205e6ce5fd2f3e2" - integrity sha512-sOH/2Go9Zer67DNFLZk6pYOHj+rumSb0VILgltkoxOjYnlLqUpHPAN826vnx8HigqnOCxj9LRhT6U7uLiIIWgw== +"@prisma/config@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@prisma/config/-/config-6.6.0.tgz#ad945b707f613d0abe3164cf2341a6b14eebf93e" + integrity sha512-d8FlXRHsx72RbN8nA2QCRORNv5AcUnPXgtPvwhXmYkQSMF/j9cKaJg+9VcUzBRXGy9QBckNzEQDEJZdEOZ+ubA== dependencies: esbuild ">=0.12 <1" esbuild-register "3.6.0" -"@prisma/debug@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-6.5.0.tgz#8820c801676a42c3cf1a2c39426e3a13c382d00b" - integrity sha512-fc/nusYBlJMzDmDepdUtH9aBsJrda2JNErP9AzuHbgUEQY0/9zQYZdNlXmKoIWENtio+qarPNe/+DQtrX5kMcQ== +"@prisma/debug@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-6.6.0.tgz#150bbbda5e9f665c08eed6c4c394cda38bb70cce" + integrity sha512-DL6n4IKlW5k2LEXzpN60SQ1kP/F6fqaCgU/McgaYsxSf43GZ8lwtmXLke9efS+L1uGmrhtBUP4npV/QKF8s2ZQ== -"@prisma/engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60": - version "6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60.tgz#9543d547eab2e083f5b47bf4f123806e372e89c5" - integrity sha512-iK3EmiVGFDCmXjSpdsKGNqy9hOdLnvYBrJB61far/oP03hlIxrb04OWmDjNTwtmZ3UZdA5MCvI+f+3k2jPTflQ== +"@prisma/engines-version@6.6.0-53.f676762280b54cd07c770017ed3711ddde35f37a": + version "6.6.0-53.f676762280b54cd07c770017ed3711ddde35f37a" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-6.6.0-53.f676762280b54cd07c770017ed3711ddde35f37a.tgz#2fd4327901d9496ffacbaecd9c53bad7c41cadda" + integrity sha512-JzRaQ5Em1fuEcbR3nUsMNYaIYrOT1iMheenjCvzZblJcjv/3JIuxXN7RCNT5i6lRkLodW5ojCGhR7n5yvnNKrw== -"@prisma/engines@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-6.5.0.tgz#bba14cfdf2e9f9e04ee4a0196fca9a1255473e9b" - integrity sha512-FVPQYHgOllJklN9DUyujXvh3hFJCY0NX86sDmBErLvoZjy2OXGiZ5FNf3J/C4/RZZmCypZBYpBKEhx7b7rEsdw== +"@prisma/engines@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-6.6.0.tgz#ef4ae4a9ba0cdf72878a60114d173fc463787bc8" + integrity sha512-nC0IV4NHh7500cozD1fBoTwTD1ydJERndreIjpZr/S3mno3P6tm8qnXmIND5SwUkibNeSJMpgl4gAnlqJ/gVlg== dependencies: - "@prisma/debug" "6.5.0" - "@prisma/engines-version" "6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60" - "@prisma/fetch-engine" "6.5.0" - "@prisma/get-platform" "6.5.0" + "@prisma/debug" "6.6.0" + "@prisma/engines-version" "6.6.0-53.f676762280b54cd07c770017ed3711ddde35f37a" + "@prisma/fetch-engine" "6.6.0" + "@prisma/get-platform" "6.6.0" -"@prisma/fetch-engine@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-6.5.0.tgz#4deb5db133908651de873fc915e80f522e5f0295" - integrity sha512-3LhYA+FXP6pqY8FLHCjewyE8pGXXJ7BxZw2rhPq+CZAhvflVzq4K8Qly3OrmOkn6wGlz79nyLQdknyCG2HBTuA== +"@prisma/fetch-engine@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-6.6.0.tgz#1b947add9a950b479bb275bf987ef596ad4f94ca" + integrity sha512-Ohfo8gKp05LFLZaBlPUApM0M7k43a0jmo86YY35u1/4t+vuQH9mRGU7jGwVzGFY3v+9edeb/cowb1oG4buM1yw== dependencies: - "@prisma/debug" "6.5.0" - "@prisma/engines-version" "6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60" - "@prisma/get-platform" "6.5.0" + "@prisma/debug" "6.6.0" + "@prisma/engines-version" "6.6.0-53.f676762280b54cd07c770017ed3711ddde35f37a" + "@prisma/get-platform" "6.6.0" -"@prisma/get-platform@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-6.5.0.tgz#254f09b3dc702c98f4f13ea9f1d6bb0731aca199" - integrity sha512-xYcvyJwNMg2eDptBYFqFLUCfgi+wZLcj6HDMsj0Qw0irvauG4IKmkbywnqwok0B+k+W+p+jThM2DKTSmoPCkzw== +"@prisma/get-platform@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-6.6.0.tgz#ebe905a3f0a5e8b3a43dcf08206fd73034af5f0b" + integrity sha512-3qCwmnT4Jh5WCGUrkWcc6VZaw0JY7eWN175/pcb5Z6FiLZZ3ygY93UX0WuV41bG51a6JN/oBH0uywJ90Y+V5eA== dependencies: - "@prisma/debug" "6.5.0" + "@prisma/debug" "6.6.0" "@rollup/plugin-alias@^5.1.1": version "5.1.1" @@ -6141,13 +6141,13 @@ pretty-bytes@^6.1.1: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-6.1.1.tgz#38cd6bb46f47afbf667c202cfc754bffd2016a3b" integrity sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ== -prisma@^6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/prisma/-/prisma-6.5.0.tgz#0a02859bb59edb8821db4e63257c7f8de2d461a1" - integrity sha512-yUGXmWqv5F4PByMSNbYFxke/WbnyTLjnJ5bKr8fLkcnY7U5rU9rUTh/+Fja+gOrRxEgtCbCtca94IeITj4j/pg== +prisma@^6.6.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/prisma/-/prisma-6.6.0.tgz#5443374b5a6968f37468d0d501ca1babb7aa8fcd" + integrity sha512-SYCUykz+1cnl6Ugd8VUvtTQq5+j1Q7C0CtzKPjQ8JyA2ALh0EEJkMCS+KgdnvKW1lrxjtjCyJSHOOT236mENYg== dependencies: - "@prisma/config" "6.5.0" - "@prisma/engines" "6.5.0" + "@prisma/config" "6.6.0" + "@prisma/engines" "6.6.0" optionalDependencies: fsevents "2.3.3"