rakenne/doc/erd-dsl.md

67 lines
1.3 KiB
Markdown
Raw Normal View History

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-18 09:24:02 +00:00
name: "Utilisateur"
properties:
- name: id
type: integer
key: true
options: ['autoincrement']
- 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-18 09:24:02 +00:00
name: "Adresses"
properties:
- 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:
2020-05-18 09:24:02 +00:00
name: "GereAdresse"
2020-05-17 19:18:29 +00:00
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/)