Company
Products
Services
Technologies
Tools
Contact Us
Blogs
Get Started
Home
Services
Products
Tools
More
Prisma to ERD Ultimate
V.2.5.1
Professional ERD Generator with AI Insights & Visual Relationships
JSON Validator
JSON to Tree
Code Minifier
Code Beautifier
SQL Formatter
XML Formatter
Regex Tester
Base64 Encoder
CSV to JSON
Cron Generator
Webhook Tester
UUID Generator
Hash Generator
JSON Validator
JSON to Tree
Code Minifier
Code Beautifier
SQL Formatter
XML Formatter
Regex Tester
Base64 Encoder
CSV to JSON
Cron Generator
Webhook Tester
UUID Generator
Hash Generator
Prisma Schema
History
Load Sample
Copy
generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } model User { id Int @id @default(autoincrement()) email String @unique name String? role Role @default(USER) posts Post[] profile Profile? comments Comment[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@index([email]) } model Profile { id Int @id @default(autoincrement()) bio String? avatar String? userId Int @unique user User @relation(fields: [userId], references: [id], onDelete: Cascade) social Social? } model Social { id Int @id @default(autoincrement()) twitter String? github String? linkedin String? profileId Int @unique profile Profile @relation(fields: [profileId], references: [id]) } model Post { id Int @id @default(autoincrement()) title String content String? published Boolean @default(false) authorId Int author User @relation(fields: [authorId], references: [id]) categories PostCategory[] comments Comment[] tags Tag[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@index([authorId]) @@index([published]) } model Comment { id Int @id @default(autoincrement()) content String postId Int post Post @relation(fields: [postId], references: [id], onDelete: Cascade) authorId Int author User @relation(fields: [authorId], references: [id]) createdAt DateTime @default(now()) } model Category { id Int @id @default(autoincrement()) name String @unique slug String @unique posts PostCategory[] } model PostCategory { postId Int categoryId Int post Post @relation(fields: [postId], references: [id], onDelete: Cascade) category Category @relation(fields: [categoryId], references: [id], onDelete: Cascade) @@id([postId, categoryId]) } model Tag { id Int @id @default(autoincrement()) name String @unique posts Post[] } enum Role { USER ADMIN MODERATOR }
Generate ERD