From f6200598955dd1300bd2a0abc65c1888b57117dc Mon Sep 17 00:00:00 2001 From: TORBEN HAACK Date: Fri, 19 Apr 2024 07:40:25 +0200 Subject: [PATCH] Create MYP.dbml --- docs/MYP.dbml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/MYP.dbml diff --git a/docs/MYP.dbml b/docs/MYP.dbml new file mode 100644 index 0000000..7d90590 --- /dev/null +++ b/docs/MYP.dbml @@ -0,0 +1,60 @@ + +Table "Printer" { + "id" int [unique, pk] + "name" text + "description" text + "status" int [note: '0: OPERATIONAL\n1: OUT_OF_ORDER'] + "created_at" timestamp + "updated_at" timestamp +} + +Table "PrintJob" { + "id" int [unique, pk] + "printer_id" int + "user_id" int + "start_at" timestamp + "duration_in_minutes" int + "comments" text + "aborted" bool [default: false] + "abort_reason" text [note: 'Error code displayed on printer'] + "created_at" timestamp + "updated_at" timestamp +} + + +Table "Account" { + "id" text [unique, pk] + "userId" text + "type" text + "provider" text + "providerAccountId" text + "refresh_token" text + "access_token" text + "expires_at" int + "token_type" text + "scope" text + "id_token" text + "session_state" text +} + +Table "Session" { + "id" text [unique, pk] + "sessionToken" text [unique] + "userId" text + "expires" datetime +} + +Table "User" { + "id" text [pk] + "name" text + "email" text [unique] + "role" text [note: 'ADMIN,USER,GUEST'] +} + +Ref:"PrintJob"."user_id" < "User"."id" + +Ref:"Account"."userId" < "User"."id" + +Ref:"Session"."userId" < "User"."id" + +Ref:"PrintJob"."printer_id" < "Printer"."id"