ER図
erDiagram
COMPANY ||--o{ CONTACT : has
COMPANY ||--o{ DEAL : has
DEAL ||--o{ EVENT : has
COMPANY ||--o{ CONTRACT : has
CONTRACT }o--|| PLAN : uses
DEAL }o--|| OWNER : "営業担当"
COMPANY {
string company_id PK
string name
string domain
string segment
}
CONTACT {
string contact_id PK
string name
string email
string role
}
DEAL {
string deal_id PK
string stage
float amount
date expected_close
}
CONTRACT {
string contract_id PK
date start_date
date end_date
float mrr
string status
}
PLAN {
string plan_id PK
string name
float price
}
EVENT {
string event_id PK
date occurred_at
string type
string note
}
OWNER {
string owner_id PK
string name
}
<aside> 📝
条件を「自分」にしてしまうと、私が開いたときしか私の割当ページが表示されない(=他の人が開いたらまっさらになる)ので条件を明示的に指定しています。
</aside>