2020-05-17 19:10:41 +00:00
|
|
|
# Entity-Relationship Diagrams - Domain Specific Language
|
|
|
|
|
|
|
|
## Goals
|
|
|
|
|
2020-05-17 19:25:51 +00:00
|
|
|
* Describe all possible cases according to MERISE
|
|
|
|
* Be simple to read and write by a human user
|
|
|
|
* Be simple to parse by a machine
|
|
|
|
|
2020-05-17 19:10:41 +00:00
|
|
|
## Example
|
|
|
|
|
2020-05-18 09:21:49 +00:00
|
|
|
```yaml
|
2020-05-17 19:18:29 +00:00
|
|
|
entities:
|
|
|
|
user:
|
2020-05-17 19:34:14 +00:00
|
|
|
- name: id
|
2020-05-17 19:35:54 +00:00
|
|
|
type: integer
|
2020-05-17 19:34:14 +00:00
|
|
|
key: true
|
2020-05-17 19:36:09 +00:00
|
|
|
options: ['autoincrement']
|
2020-05-17 19:34:14 +00:00
|
|
|
- name: password_hash
|
|
|
|
type: varchar
|
|
|
|
limit: 250
|
|
|
|
- name: role
|
|
|
|
type: varchar
|
|
|
|
limit: 10
|
|
|
|
- name: created_at
|
|
|
|
type: datetime
|
|
|
|
- name: updated_at
|
|
|
|
type: datetime
|
2020-05-17 19:18:29 +00:00
|
|
|
url:
|
2020-05-17 19:34:14 +00:00
|
|
|
- name: id
|
|
|
|
type: varchar
|
|
|
|
limit: 250
|
|
|
|
key: true
|
|
|
|
- name: custom_id
|
|
|
|
type: varchar
|
|
|
|
limit: 250
|
|
|
|
- name: source_url
|
|
|
|
type: text
|
|
|
|
- name: short_url
|
|
|
|
type: varchar
|
|
|
|
limit: 250
|
|
|
|
- name: created_at
|
|
|
|
type: datetime
|
|
|
|
- name: updated_at
|
|
|
|
type: datetime
|
|
|
|
- name: expires_at
|
|
|
|
type: datetime
|
2020-05-17 19:10:41 +00:00
|
|
|
|
2020-05-17 19:18:29 +00:00
|
|
|
relationships:
|
|
|
|
manages_urls:
|
|
|
|
links:
|
2020-05-17 19:34:14 +00:00
|
|
|
- name: user:
|
|
|
|
equals: 1
|
|
|
|
- name: url:
|
|
|
|
min: 0
|
|
|
|
max: n
|
|
|
|
properties: []
|
2020-05-17 19:10:41 +00:00
|
|
|
```
|
2020-05-17 19:41:12 +00:00
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
* [Petit cours de Modélisation, Christophe DARMANGEAT](http://pise.info/modelisation/)
|