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"