From 7b8c6f2bc534bf1bd7a98f99d4072948a52205d9 Mon Sep 17 00:00:00 2001 From: 9pfs <9pfs@amcforum.wiki> Date: Sat, 6 Jul 2024 00:26:58 +0000 Subject: [PATCH] Add prisma --- .gitignore | 5 ++- bin/prisma | 6 ++++ package-lock.json | 77 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 8 ++++- prisma/schema.prisma | 14 ++++++++ 5 files changed, 108 insertions(+), 2 deletions(-) create mode 100755 bin/prisma create mode 100644 package-lock.json create mode 100644 prisma/schema.prisma diff --git a/.gitignore b/.gitignore index 12a59c7..e3b80ed 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,7 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* -# --- End Node.gitignore from https://github.com/github/gitignore --- \ No newline at end of file +# --- End Node.gitignore from https://github.com/github/gitignore --- + +# Node.gitignore already includes .env, let's include it anyways, as it isn't just an upstream thing, but we personally use .env too! +.env \ No newline at end of file diff --git a/bin/prisma b/bin/prisma new file mode 100755 index 0000000..b287613 --- /dev/null +++ b/bin/prisma @@ -0,0 +1,6 @@ +#!/bin/sh +# This exists purely to set CHECKPOINT_DISABLE=1 and try to prevent the data collection done by prisma (and potentially improve performance by doing so ;) ) +# See https://www.prisma.io/docs/orm/tools/prisma-cli#usage-data-1 for details. +export CHECKPOINT_DISABLE=1 +# TODO: execute node_modules/prisma/build/index.js directly if the subdirectory problem can be solved. +exec npx --package=prisma prisma "$@" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..77f1b4b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,77 @@ +{ + "name": "faq-website", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "faq-website", + "version": "0.0.1", + "license": "AGPL-3.0-or-later", + "devDependencies": { + "prisma": "^5.16.1" + } + }, + "node_modules/@prisma/debug": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.16.1.tgz", + "integrity": "sha512-JsNgZAg6BD9RInLSrg7ZYzo11N7cVvYArq3fHGSD89HSgtN0VDdjV6bib7YddbcO6snzjchTiLfjeTqBjtArVQ==", + "dev": true + }, + "node_modules/@prisma/engines": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.16.1.tgz", + "integrity": "sha512-KkyF3eIUtBIyp5A/rJHCtwQO18OjpGgx18PzjyGcJDY/+vNgaVyuVd+TgwBgeq6NLdd1XMwRCI+58vinHsAdfA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@prisma/debug": "5.16.1", + "@prisma/engines-version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "@prisma/fetch-engine": "5.16.1", + "@prisma/get-platform": "5.16.1" + } + }, + "node_modules/@prisma/engines-version": { + "version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303.tgz", + "integrity": "sha512-HkT2WbfmFZ9WUPyuJHhkiADxazHg8Y4gByrTSVeb3OikP6tjQ7txtSUGu9OBOBH0C13dPKN2qqH12xKtHu/Hiw==", + "dev": true + }, + "node_modules/@prisma/fetch-engine": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.16.1.tgz", + "integrity": "sha512-oOkjaPU1lhcA/Rvr4GVfd1NLJBwExgNBE36Ueq7dr71kTMwy++a3U3oLd2ZwrV9dj9xoP6LjCcky799D9nEt4w==", + "dev": true, + "dependencies": { + "@prisma/debug": "5.16.1", + "@prisma/engines-version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "@prisma/get-platform": "5.16.1" + } + }, + "node_modules/@prisma/get-platform": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.16.1.tgz", + "integrity": "sha512-R4IKnWnMkR2nUAbU5gjrPehdQYUUd7RENFD2/D+xXTNhcqczp0N+WEGQ3ViyI3+6mtVcjjNIMdnUTNyu3GxIgA==", + "dev": true, + "dependencies": { + "@prisma/debug": "5.16.1" + } + }, + "node_modules/prisma": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.16.1.tgz", + "integrity": "sha512-Z1Uqodk44diztImxALgJJfNl2Uisl9xDRvqybMKEBYJLNKNhDfAHf+ZIJbZyYiBhLMbKU9cYGdDVG5IIXEnL2Q==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@prisma/engines": "5.16.1" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + } + } + } +} diff --git a/package.json b/package.json index 719f2b2..8508089 100644 --- a/package.json +++ b/package.json @@ -12,5 +12,11 @@ "url": "https://git.h.hackclub.app/9pfs/faq-website.git" }, "author": "h@hackclub.app", - "license": "AGPL-3.0-or-later" + "license": "AGPL-3.0-or-later", + "devDependencies": { + "prisma": "^5.16.1" + }, + "bin": { + "prisma": "bin/prisma" + } } diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..ee282c7 --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,14 @@ +// 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" +} + +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +}