1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Note:
  columns:
    description: { type: string(255), notnull: true }
  relations:
    Tickets:
      class: Ticket
      refClass: TicketHasNote
      local: note_id
      foreign: ticket_id
      foreignAlias: Notes
#-----------------------------------------------------------------------------------------------------------------------
Hardware:
  columns:
    uid: { type: string(255), notnull: true, unique: true }
  relations:
    Tickets:
      class: Ticket
      refClass: TicketHasHardware
      local: hardware_id
      foreign: ticket_id
      foreignAlias: Hardwares
#-----------------------------------------------------------------------------------------------------------------------
Ticket:
  actAs:
    Timestampable: ~
  columns:
    title: { type: string(255), notnull: true }
#-----------------------------------------------------------------------------------------------------------------------
TicketHasNote:
  columns:
    note_id:    { type: integer, notnull: true, primary: true }
    ticket_id:  { type: integer, notnull: true, primary: true }
  relations:
    Note:  { onDelete: CASCADE, local: note_id, foreign: id }
    Ticket: { onDelete: CASCADE, local: ticket_id, foreign: id }
#-----------------------------------------------------------------------------------------------------------------------
TicketHasHardware:
  columns:
    hardware_id: { type: integer, notnull: true, primary: true }
    ticket_id:   { type: integer, notnull: true, primary: true }
  relations:
    Hardware: { onDelete: CASCADE, local: hardware_id, foreign: id }
    Ticket:   { onDelete: CASCADE, local: ticket_id, foreign: id }
#-----------------------------------------------------------------------------------------------------------------------