aboutsummaryrefslogtreecommitdiffstats
path: root/backend/prisma
diff options
context:
space:
mode:
Diffstat (limited to 'backend/prisma')
-rw-r--r--backend/prisma/schema.prisma15
-rw-r--r--backend/prisma/seed.ts21
2 files changed, 21 insertions, 15 deletions
diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma
deleted file mode 100644
index aaeee1b..0000000
--- a/backend/prisma/schema.prisma
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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"
- output = "../src/generated/prisma"
-}
-
-datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
-}
diff --git a/backend/prisma/seed.ts b/backend/prisma/seed.ts
new file mode 100644
index 0000000..9f98e81
--- /dev/null
+++ b/backend/prisma/seed.ts
@@ -0,0 +1,21 @@
+import { PrismaClient } from '@prisma/client';
+
+const prisma = new PrismaClient();
+
+async function main() {
+ await prisma.games.createMany({
+ data: [
+ { gameName: 'Dancerush' },
+ ],
+ });
+ console.log('Initial seed data inserted');
+}
+
+main()
+ .catch((e) => {
+ console.error(e);
+ process.exit(1);
+ })
+ .finally(async () => {
+ await prisma.$disconnect();
+ });
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage