This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Receive the compiled app graph | |
import Image from 'next/image'; | |
export interface GraphApp { | |
getGraphAsync(): Promise<{ | |
drawMermaidPng(): Promise<{ | |
arrayBuffer(): Promise<ArrayBuffer>; | |
}>; | |
}>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PrismaClient } from '@prisma/client'; | |
import { clients, users, profiles, categories, posts } from './data'; | |
const prisma = new PrismaClient(); | |
async function seeder() { | |
// Delete all data from the database | |
await prisma.profile.deleteMany({}); | |
await prisma.post.deleteMany({}); | |
await prisma.category.deleteMany({}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Prisma } from '@prisma/client'; | |
import { createId } from '@paralleldrive/cuid2'; | |
// Create clients | |
export const clients: Prisma.ClientUncheckedCreateInput[] = [ | |
{ id: createId(), name: 'Client One', website: 'https://example1.com', status: "ACTIVE" }, | |
{ id: createId(), name: 'Client Two', website: 'https://example2.com', status: "INACTIVE" }, | |
{ id: createId(), name: 'Client Three', website: 'https://example3.com', status: "TRIAL" }, | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generator client { | |
provider = "prisma-client-js" | |
} | |
datasource db { | |
provider = "postgresql" | |
url = env("DATABASE_URL") | |
} | |
model Client { |