mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Fix running seed via script
This commit is contained in:
parent
83135e214a
commit
fb89f5111b
|
|
@ -67,6 +67,6 @@
|
|||
},
|
||||
"sideEffects": false,
|
||||
"prisma": {
|
||||
"seed": "node --experimental-specifier-resolution=node --loader ts-node/esm prisma/seed.ts"
|
||||
"seed": "node --experimental-specifier-resolution=node --loader ts-node/esm prisma/seed"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
prisma/seed/index.ts
Normal file
12
prisma/seed/index.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { PrismaClient } from "@prisma/client";
|
||||
const prisma = new PrismaClient();
|
||||
import { seed } from "./script";
|
||||
|
||||
seed()
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
await prisma.$disconnect();
|
||||
});
|
||||
|
|
@ -4,7 +4,7 @@ import {
|
|||
ADMIN_TEST_DISCORD_ID,
|
||||
ADMIN_TEST_UUID,
|
||||
stages as stagesList,
|
||||
} from "../app/constants";
|
||||
} from "../../app/constants";
|
||||
import { readFile } from "fs/promises";
|
||||
import path from "path";
|
||||
import crypto from "crypto";
|
||||
|
|
@ -4,7 +4,7 @@ import compression from "compression";
|
|||
import morgan from "morgan";
|
||||
import { createRequestHandler } from "@remix-run/express";
|
||||
import { setUpAuth } from "./auth";
|
||||
import { seed } from "../prisma/seed";
|
||||
import { seed } from "../prisma/seed/script";
|
||||
|
||||
const MODE = process.env.NODE_ENV;
|
||||
const BUILD_DIR = path.join(process.cwd(), "server/build");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user