11
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Mermaid】ER図の作成方法

Posted at

ファイルの作成

MermaidでER図を描く場合にはerDiagramで始めます。

sample.md
```mermaid
erDiagram

```

以降の記述は@startuml@endumlの間に記述します。

エンティティ

エンティティは以下のように記述します。

sample.md
```mermaid
erDiagram

  users {
    string name
    string email
    integer age
  }

```

リレーション

リレーションは以下のように記述します。

sample.md
```mermaid
erDiagram

  users ||--o{ articles: ""

  users {
    string name
    string email
    integer age
  }

  articles {
    string title
    text text
  }

```

sample.md
```mermaid
erDiagram

  e01 ||--|{ e02: "1 対 多(1以上)"
  e01 ||--o{ e03: "1 対 多(0以上)"
  e01 ||--o| e04: "1 対 0か1"

```

11
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?