Skip to content

Commit

Permalink
change db import
Browse files Browse the repository at this point in the history
  • Loading branch information
qweliant committed May 9, 2024
1 parent 496b210 commit 87175aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
10 changes: 2 additions & 8 deletions core/prisma/exampleCommunitySeeds/croccroc.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import { faker } from "@faker-js/faker";
import { PubType } from "@prisma/client";
import { v4 as uuidv4, v4 } from "uuid";

import { logger } from "logger";

import type { CommunitiesId } from "~/kysely/types/public/Communities";
import type { PubTypesId } from "~/kysely/types/public/PubTypes";
import { registerCorePubField } from "~/actions/_lib/init";
import { corePubFields } from "~/actions/corePubFields";
// import { PrismaClient } from "@prisma/client";
import { type db as kyselyDb } from "~/kysely/database";
import { env } from "../../lib/env/env.mjs";

// import { FileUpload } from "../../lib/fields/fileUpload";
import { db } from "~/kysely/database";

export const crocCrocId = "758ba348-92c7-46ec-9612-7afda81e2d70" as CommunitiesId;

export default async function main(db: typeof kyselyDb, communityUUID: CommunitiesId) {
export default async function main(communityUUID: CommunitiesId) {
logger.info("Registering core fields");
for (const corePubField of corePubFields) {
logger.info(`Registering core field ${corePubField.slug}`);
Expand Down
7 changes: 2 additions & 5 deletions core/prisma/exampleCommunitySeeds/unjournal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { faker } from "@faker-js/faker";
import { PrismaClient, PubType } from "@prisma/client";
import { PrismaClient } from "@prisma/client";
import { v4 as uuidv4 } from "uuid";

import type { CommunitiesId } from "~/kysely/types/public/Communities";
Expand All @@ -12,10 +12,7 @@ import { FileUpload } from "../../lib/fields/fileUpload";

export const unJournalId = "03e7a5fd-bdca-4682-9221-3a69992c1f3b";

export default async function main(
prisma: PrismaClient,
communityUUID: string
) {
export default async function main(prisma: PrismaClient, communityUUID: string) {
await prisma.community.create({
data: {
id: communityUUID,
Expand Down
2 changes: 1 addition & 1 deletion core/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function main() {
];

logger.info("build crocroc");
await buildCrocCroc(db, crocCrocId);
await buildCrocCroc(crocCrocId);
logger.info("build unjournal");
await buildUnjournal(prisma, unJournalId);

Expand Down

0 comments on commit 87175aa

Please sign in to comment.