Skip to content

Commit

Permalink
Add ERD
Browse files Browse the repository at this point in the history
  • Loading branch information
masalovd committed Oct 2, 2023
1 parent dcc19a4 commit 50a4897
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ERD](./prisma/README.md)
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"nodemon": "^3.0.1",
"prettier": "3.0.3",
"prisma": "^5.3.1",
"prisma-markdown": "^1.0.0",
"typescript": "^5.2.2"
}
}
60 changes: 60 additions & 0 deletions prisma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Messenger

> Generated by [`prisma-markdown`](https://github.com/samchon/prisma-markdown)
- [default](#default)

## default

```mermaid
erDiagram
User {
Int id PK
String username UK
String email UK
String password
DateTime createdAt
}
Message {
Int id PK
String content
Int senderId FK
Int chatId FK
DateTime createdAt
}
Chat {
Int id PK
String name "nullable"
DateTime createdAt
}
Message }|--|| User : sender
Message }|--|| Chat : chat
```

### `User`

**Properties**

- `id`:
- `username`:
- `email`:
- `password`:
- `createdAt`:

### `Message`

**Properties**

- `id`:
- `content`:
- `senderId`:
- `chatId`:
- `createdAt`:

### `Chat`

**Properties**

- `id`:
- `name`:
- `createdAt`:
6 changes: 6 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ model Chat {
messages Message[]
createdAt DateTime @default(now())
}

generator markdown {
provider = "prisma-markdown"
output = "./README.md"
title = "Messenger"
}

0 comments on commit 50a4897

Please sign in to comment.