rakenne/doc/erd-dsl.md

58 lines
1.1 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-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:35:54 +00:00
option: 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
```