|
2 | 2 | // Docs: https://dbml.dbdiagram.io/docs
|
3 | 3 |
|
4 | 4 | Table refactor_platform.organizations {
|
5 |
| - id integer [primary key, unique, not null, increment] |
| 5 | + id uuid [primary key, unique, not null] |
6 | 6 | name varchar [note: 'The name of the organization that the coach <--> coachee belong to']
|
7 | 7 | logo varchar [note: 'A URI pointing to the organization\'s logo icon file']
|
8 |
| - created_at timestamp |
| 8 | + created_at timestamp |
| 9 | + updated_at timestamp [note: 'The last date and time fields were changed'] |
9 | 10 | }
|
10 | 11 |
|
11 | 12 | // Coaching relationship type belonging to the refactor_platform schema
|
12 | 13 | // from the perspective of the coach
|
13 |
| -enum refactor_platform.coaching_relationship { |
14 |
| - client |
15 |
| - direct_report |
16 |
| -} |
17 |
| - |
18 |
| -// Declares a coach <--> coachee coaching relationship |
19 |
| -// E.g. Manager <--> Software Engineer direct report |
20 |
| -// E.g. Independent coach <--> Software Engineer client |
21 |
| -Table refactor_platform.coaches_coachees { |
22 |
| - id integer [primary key, unique, not null, increment] |
23 |
| - organization_id integer [note: 'The organization associated with this coaching relationship'] |
24 |
| - coach_id integer [note: 'The coach associated with this coaching relationship'] |
25 |
| - coachee_id integer [note: 'The coachee associated with this coaching relationship'] |
26 |
| - relationship coaching_relationship |
| 14 | +Table refactor_platform.coaching_relationships { |
| 15 | + id uuid [primary key, unique, not null] |
| 16 | + organization_id uuid [not null, note: 'The organization associated with this coaching relationship'] |
| 17 | + coach_id uuid [not null, note: 'The coach associated with this coaching relationship'] |
| 18 | + coachee_id uuid [not null, note: 'The coachee associated with this coaching relationship'] |
| 19 | + created_at timestamp |
| 20 | + updated_at timestamp [note: 'The last date and time fields were changed'] |
27 | 21 | }
|
28 | 22 |
|
29 | 23 | Table refactor_platform.users {
|
30 |
| - id integer [primary key, unique, not null, increment] |
| 24 | + id uuid [primary key, unique, not null] |
31 | 25 | email varchar
|
32 | 26 | first_name varchar
|
33 | 27 | last_name varchar
|
34 | 28 | display_name varchar [note: 'If a user wants to go by something other than first & last names']
|
35 | 29 | password varchar
|
36 |
| - timezone timezone |
| 30 | + timezone varchar |
37 | 31 | github_username varchar // Specifically GH for now, can generalize later
|
38 | 32 | github_profile_url varchar
|
39 | 33 | created_at timestamp
|
40 |
| -} |
41 |
| - |
42 |
| -Table refactor_platform.coachees { |
43 |
| - id integer [primary key, unique, not null, increment] |
44 |
| - user_id integer |
45 |
| - organization_id integer |
46 |
| -} |
47 |
| - |
48 |
| -Table refactor_platform.coaches { |
49 |
| - id integer [primary key, unique, not null, increment] |
50 |
| - user_id integer |
51 |
| - organization_id integer |
| 34 | + updated_at timestamp [note: 'The last date and time fields were changed'] |
52 | 35 | }
|
53 | 36 |
|
54 | 37 | Table refactor_platform.coaching_sessions {
|
55 |
| - id integer [primary key, unique, not null, increment] |
56 |
| - coaches_coachees_id integer [note: 'The coaching relationship (i.e. what coach & coachee under what organization) associated with this coaching session'] |
| 38 | + id uuid [primary key, unique, not null] |
| 39 | + coaching_relationship_id uuid [not null, note: 'The coaching relationship (i.e. what coach & coachee under what organization) associated with this coaching session'] |
57 | 40 | date timestamp [note: 'The date and time of a session']
|
58 |
| - timezone timezone [note: 'The baseline timezone used for the `date` field'] |
| 41 | + timezone varchar [note: 'The baseline timezone used for the `date` field'] |
59 | 42 | created_at timestamp
|
| 43 | + updated_at timestamp [note: 'The last date and time fields were changed'] |
60 | 44 | }
|
61 | 45 |
|
62 | 46 | Table refactor_platform.overarching_goals {
|
63 |
| - id integer [primary key, unique, not null, increment] |
64 |
| - coaching_session_id integer [note: 'The coaching session that an overarching goal is associated with'] |
| 47 | + id uuid [primary key, unique, not null] |
| 48 | + coaching_session_id uuid [note: 'The coaching session that an overarching goal is associated with'] |
65 | 49 | title varchar [note: 'A short description of an overarching goal']
|
66 | 50 | details varchar [note: 'A long description of an overarching goal']
|
67 |
| - completed boolean // May be unnecessary if there's a valid completed_at timestamp |
68 | 51 | completed_at timestamp [note: 'The date and time an overarching goal was completed']
|
69 |
| - completed_by_id integer [note: 'The user that successfully completed an overarching goal'] |
70 | 52 | created_at timestamp
|
71 |
| - updated_at timestamp [note: 'The last date and time an overarching goal\'s fields were changed'] |
| 53 | + updated_at timestamp [note: 'The last date and time fields were changed'] |
72 | 54 | }
|
73 | 55 |
|
74 | 56 | Table refactor_platform.notes {
|
75 |
| - id integer [primary key, unique, not null, increment] |
76 |
| - coaching_session_id integer |
| 57 | + id uuid [primary key, unique, not null] |
| 58 | + coaching_session_id uuid [not null] |
77 | 59 | body varchar [note: 'Main text of the note supporting Markdown']
|
| 60 | + user_id uuid [not null, note: 'User that created (owns) the note'] |
78 | 61 | created_at timestamp
|
79 | 62 | updated_at timestamp [note: 'The last date and time an overarching note\'s fields were changed']
|
80 | 63 | }
|
81 | 64 |
|
82 | 65 | Table refactor_platform.agreements {
|
83 |
| - id integer [primary key, unique, not null, increment] |
84 |
| - coaching_session_id integer |
| 66 | + id uuid [primary key, unique, not null] |
| 67 | + coaching_session_id uuid [not null] |
85 | 68 | details varchar [note: 'Either a short or long description of an agreement reached between coach and coachee in a coaching session']
|
| 69 | + user_id uuid [not null, note: 'User that created (owns) the agreement'] |
86 | 70 | created_at timestamp
|
87 | 71 | updated_at timestamp [note: 'The last date and time an overarching agreement\'s fields were changed']
|
88 | 72 | }
|
89 | 73 |
|
90 | 74 | Table refactor_platform.actions {
|
91 |
| - id integer [primary key, unique, not null, increment] |
| 75 | + id uuid [primary key, unique, not null] |
92 | 76 | // The first session where this action was created
|
93 | 77 | // It will carry forward to every future session until
|
94 | 78 | // its due_by is passed or it was completed by the coachee
|
95 |
| - coaching_session_id integer |
| 79 | + coaching_session_id uuid [not null] |
96 | 80 | due_by timestamp
|
97 | 81 | completed boolean // May be unnecessary if there's a valid completed_at timestamp
|
98 | 82 | completed_at timestamp
|
99 | 83 | created_at timestamp
|
100 | 84 | updated_at timestamp
|
101 | 85 | }
|
102 | 86 |
|
103 |
| -// coaches_coachees relationships |
104 |
| -Ref: refactor_platform.coaches_coachees.organization_id - refactor_platform.organizations.id |
105 |
| -Ref: refactor_platform.coaches_coachees.coachee_id - refactor_platform.coachees.id |
106 |
| -Ref: refactor_platform.coaches_coachees.coach_id - refactor_platform.coaches.id |
107 |
| - |
108 |
| -// coachees relationships |
109 |
| -Ref: refactor_platform.coachees.user_id - refactor_platform.users.id |
110 |
| -Ref: refactor_platform.coachees.organization_id > refactor_platform.organizations.id |
| 87 | +// coaching_relationships relationships |
| 88 | +Ref: refactor_platform.coaching_relationships.organization_id > refactor_platform.organizations.id |
| 89 | +Ref: refactor_platform.coaching_relationships.coachee_id > refactor_platform.users.id |
| 90 | +Ref: refactor_platform.coaching_relationships.coach_id > refactor_platform.users.id |
111 | 91 |
|
112 |
| -// coaches relationships |
113 |
| -Ref: refactor_platform.coaches.user_id - refactor_platform.users.id |
114 |
| -Ref: refactor_platform.coaches.organization_id > refactor_platform.organizations.id |
| 92 | +// coaching_sessions relationships |
| 93 | +Ref: refactor_platform.coaching_sessions.coaching_relationship_id > refactor_platform.coaching_relationships.id |
115 | 94 |
|
116 | 95 | // overarching_goals relationships
|
117 |
| -Ref: refactor_platform.overarching_goals.coaching_session_id - refactor_platform.coaching_sessions.id |
118 |
| -Ref: refactor_platform.overarching_goals.completed_by_id - refactor_platform.users.id |
| 96 | +Ref: refactor_platform.overarching_goals.coaching_session_id > refactor_platform.coaching_sessions.id |
119 | 97 |
|
120 | 98 | // notes relationships
|
121 |
| -Ref: refactor_platform.notes.coaching_session_id - refactor_platform.coaching_sessions.id |
122 |
| - |
123 |
| -// coaching_sessions relationships |
124 |
| -Ref: refactor_platform.coaching_sessions.coaches_coachees_id > refactor_platform.coaches_coachees.id |
| 99 | +Ref: refactor_platform.notes.coaching_session_id > refactor_platform.coaching_sessions.id |
| 100 | +Ref: refactor_platform.notes.user_id > refactor_platform.users.id |
125 | 101 |
|
126 | 102 | // agreements relationships
|
127 | 103 | Ref: refactor_platform.agreements.coaching_session_id > refactor_platform.coaching_sessions.id
|
| 104 | +Ref: refactor_platform.agreements.user_id > refactor_platform.users.id |
128 | 105 |
|
129 | 106 | // actions relationships
|
130 | 107 | Ref: refactor_platform.actions.coaching_session_id > refactor_platform.coaching_sessions.id
|
0 commit comments