From 478aab8f09fb52c51e18468b87198d6d302192d1 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Sun, 17 May 2020 21:12:29 +0200 Subject: [PATCH] Update erd-dsl.md --- doc/erd-dsl.md | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/doc/erd-dsl.md b/doc/erd-dsl.md index ef10444..79d30d0 100644 --- a/doc/erd-dsl.md +++ b/doc/erd-dsl.md @@ -7,42 +7,34 @@ ### An entity User ``` -CREATE ENTITY User ( - id UUID, - password_hash VARCHAR(250), - role VARCHAR(10), - created_at DATETIME, - updated_at DATETIME -); +ENTITY User { + id: UUID, + password_hash: VARCHAR(250), + role: VARCHAR(10), + created_at: DATETIME, + updated_at: DATETIME +} ``` ### An entity Url ``` -CREATE 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 -); +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 ``` -CREATE RELATIONSHIP ManagesLinks ( - LINK User (0, N), - LINK Url ( - HAS_ONE User, - HAS_MANY Url, - - , - , - , - , -); +RELATIONSHIP ManagesLinks { + LINK User (1, 1), + LINK Url (0, N), +}; ``` -