Update erd-dsl.md

This commit is contained in:
Glenn Y. Rolland 2020-05-17 21:18:29 +02:00 committed by GitHub
parent 478aab8f09
commit 36bafc11ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,37 +4,27 @@
## Example
### An entity User
```
ENTITY User {
id: UUID,
password_hash: VARCHAR(250),
role: VARCHAR(10),
created_at: DATETIME,
entities:
user:
id: UUID
password_hash: VARCHAR(250)
role: VARCHAR(10)
created_at: DATETIME
updated_at: DATETIME
url:
id: VARCHAR(250)
custom_id: VARCHAR(250)
source_url: TEXT
short_url: VARCHAR(250)
created_at: DATETIME
updated_at: DATETIME
}
```
### An entity Url
```
ENTITY Url {
id: VARCHAR(250),
custom_id: VARCHAR(250),
source_url: TEXT,
short_url: VARCHAR(250),
created_at: DATETIME,
updated_at: DATETIME,
expires_at: DATETIME
};
```
### An relationship ManageLinks
```
RELATIONSHIP ManagesLinks {
LINK User (1, 1),
LINK Url (0, N),
};
relationships:
manages_urls:
links:
- user: [1, 1]
- url: [0, n]
properties: {}
```