🚑 hotfix: seeding system
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { generateUUIDv7 } from "../../src/helpers/databases/uuidv7";
|
||||
import { createFile } from "../../src/helpers/files/createFile";
|
||||
import { prisma } from "../../src/utils/databases/prisma/connection";
|
||||
|
||||
export const userSystemSeed = async () => {
|
||||
@ -12,10 +13,20 @@ export const userSystemSeed = async () => {
|
||||
"$2a$12$ynOrzVCvRdejGp/7KJW4lOAwRzFYhSHDE.Dp3Fqh3sXAq1BIwfwc6",
|
||||
};
|
||||
|
||||
return await prisma.user.upsert({
|
||||
const insertedUserSystem = await prisma.user.upsert({
|
||||
where: { username: payload.username },
|
||||
update: {},
|
||||
create: payload,
|
||||
select: { id: true },
|
||||
});
|
||||
await createFile(
|
||||
`export const SystemAccountId = "${insertedUserSystem.id}";`,
|
||||
{
|
||||
fileName: "system.ts",
|
||||
targetDir: "src/config/account",
|
||||
overwriteIfExists: true,
|
||||
},
|
||||
);
|
||||
|
||||
return insertedUserSystem;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user