@sentry/junior 0.267.0 → 0.269.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +2 -9
  2. package/dist/{actor-DZSokpwj.js → actor-CP9K2Idu.js} +2 -1
  3. package/dist/{adapter-BybMEezj.js → adapter-2-CG25be.js} +3 -51
  4. package/dist/{admin-DOs1_EiW.js → admin-DSs8S5Uy.js} +1 -1
  5. package/dist/{agent-invocations-CxKldAeB.js → agent-invocations-C1RNOCs8.js} +2 -0
  6. package/dist/{agent-runner-DgNATN4D.js → agent-runner-CrDrPUtY.js} +3411 -1640
  7. package/dist/api/schema.d.ts +2 -5630
  8. package/dist/api/schema.js +7 -7
  9. package/dist/api.d.ts +3 -1
  10. package/dist/api.js +268 -287
  11. package/dist/{app-DAB3fzyp.d.ts → app-BrMMzjYm.d.ts} +10 -3
  12. package/dist/app.d.ts +1 -1
  13. package/dist/app.js +371 -223
  14. package/dist/{automation-CmeFBSEh.js → automation-p87hg_AV.js} +74 -74
  15. package/dist/{briefs-CWKjka7v.js → briefs-PtODdLNu.js} +4 -4
  16. package/dist/{catalog-runtime-cMlAI5LY.js → catalog-runtime-BsoSmTM0.js} +1 -1
  17. package/dist/cli/chat.js +16 -26
  18. package/dist/cli/check.js +3 -3
  19. package/dist/cli/main.js +5 -3
  20. package/dist/cli/plugins.js +4 -4
  21. package/dist/cli/snapshot-create.js +4 -4
  22. package/dist/cli/upgrade.d.ts +1 -1
  23. package/dist/cli/upgrade.js +3 -3
  24. package/dist/{client-BjgbMawj.js → client-Cqf4TboL.js} +20 -15
  25. package/dist/{config-CdB6yJj5.js → config-CPsE4T5L.js} +2 -2
  26. package/dist/{connections-RE_65jzK.js → connections-upFXLmhG.js} +10 -11
  27. package/dist/{conversation-DSo310Ps.js → conversation-CTpD_PGk.js} +7 -84
  28. package/dist/{conversation-privacy-BzgJC5k0.js → conversation-privacy-D6zJc8ff.js} +1 -1
  29. package/dist/{credential-sync-DhEGEpgq.js → credential-sync-CS_6IC-f.js} +30 -34
  30. package/dist/{credentialed-CIGwoLU2.js → credentialed-BU-OW7HP.js} +577 -74
  31. package/dist/{store-B8CABbmR.d.ts → db-BzOCzVb1.d.ts} +17 -7
  32. package/dist/{executor-VYrx_K4w.js → executor-CNS7ONt-.js} +78 -4
  33. package/dist/instrumentation.js +2 -2
  34. package/dist/{assistant-reply-CT7VcXQe.js → interruption-marker-g6Xup3Fk.js} +8 -2
  35. package/dist/{job-queue-C0BZSa7r.js → job-queue-DI-k-Bbk.js} +2 -2
  36. package/dist/{list-1XQP-o6K.js → list-CGoQdXTp.js} +429 -1401
  37. package/dist/locks-D-0h111u.js +48 -0
  38. package/dist/{logging-DuZ1A4ab.js → logging-n7knse-O.js} +1 -1
  39. package/dist/{history-C84mlAwO.js → media-85PDJxO_.js} +83 -1
  40. package/dist/{message-NKSbbnA6.js → message-BpaWd8TT.js} +4 -4
  41. package/dist/nitro.d.ts +1 -1
  42. package/dist/nitro.js +3 -3
  43. package/dist/{oauth-callback-server-qAHLPtml.js → oauth-callback-server-CpGmEw_i.js} +2 -2
  44. package/dist/{prompt-BW9jFsqZ.js → prompt-BlQB0QQt.js} +1 -1
  45. package/dist/{registry-FQutO926.js → registry-By36_xsm.js} +2 -2
  46. package/dist/reporting-schema-CZREhYc-.js +104 -0
  47. package/dist/reporting-window-CVarfId9.js +255 -0
  48. package/dist/{resolve-Bk4yeuHy.js → resolve-CUIBcdPd.js} +3 -3
  49. package/dist/{result-B9e9ATOU.js → result-BemsOMOO.js} +31 -12
  50. package/dist/{runner-C3S2ObH-.js → runner-BVok7PAA.js} +12 -11
  51. package/dist/{sandbox-egress-signals-DqpGzzMB.js → sandbox-egress-signals-BSUWQI95.js} +1 -1
  52. package/dist/{schema-X7Fj4fv1.js → schema-ChnFo5f2.js} +98 -6
  53. package/dist/schema-jK4-1u_H.d.ts +5927 -0
  54. package/dist/{service-account-Do30HUNv.js → service-account-DHvlLnZw.js} +4 -3
  55. package/dist/{service-account-BQasl-qq.js → service-account-hMmESDcr.js} +3 -3
  56. package/dist/{session-stop-DkOjt46_.js → session-stop-BQW_iFcd.js} +499 -23
  57. package/dist/{skills-CQHrwfOa.js → skills-DmJJIuLF.js} +2 -2
  58. package/dist/{spawn-BHuqN14f.js → spawn-ChCm46i-.js} +2 -2
  59. package/dist/{store-6EetVP-m.js → store-1DVhoKOL.js} +4 -4
  60. package/dist/{store-DvNZIsCr.js → store-DCo2n5iJ.js} +3 -3
  61. package/dist/{task-queue-B0DLgd2P.js → task-queue-HMC4QjFm.js} +3 -3
  62. package/dist/task-runner-cA6yjn_E.js +269 -0
  63. package/dist/{thread-state-DRmdJ2QN.js → thread-state-CHy8LS0C.js} +8 -18
  64. package/dist/{turn-failure-response-G11cs2gE.js → turn-failure-response-Dr7erLWs.js} +11 -16
  65. package/dist/{turn-lifecycle-OzLIwvi1.js → turn-lifecycle-bf2fIYi_.js} +1 -1
  66. package/dist/{tasks-0ilmuCux.js → turn-session-routing-BqO0qXLk.js} +959 -44
  67. package/dist/{validation-CxEmt1id.js → validation-DHR1ivfh.js} +1 -1
  68. package/dist/{version-Bapedn4A.js → version-CXCHLgWm.js} +1 -1
  69. package/dist/version.js +1 -1
  70. package/dist/{viewer-DrN3oC2X.js → viewer-DSbD6DF6.js} +503 -241
  71. package/dist/{work-DUQoNcqP.js → work-BE_qTYGi.js} +17 -36
  72. package/dist/{worker-D1l4Ugk0.js → worker-Cm9_sWXg.js} +15 -7
  73. package/migrations/0065_user_customization.sql +1 -0
  74. package/migrations/0066_review_items.sql +53 -0
  75. package/migrations/0067_review_item_dedupe_tenant.sql +2 -0
  76. package/migrations/0068_review_item_slack_cards.sql +10 -0
  77. package/migrations/0069_system_identity.sql +25 -0
  78. package/migrations/0070_review_item_foreign_keys.sql +5 -0
  79. package/migrations/AGENTS.md +17 -0
  80. package/migrations/meta/0065_snapshot.json +3511 -0
  81. package/migrations/meta/0066_snapshot.json +4099 -0
  82. package/migrations/meta/0067_snapshot.json +3921 -0
  83. package/migrations/meta/0068_snapshot.json +4176 -0
  84. package/migrations/meta/0069_snapshot.json +3979 -0
  85. package/migrations/meta/0070_snapshot.json +3997 -0
  86. package/migrations/meta/_journal.json +42 -0
  87. package/package.json +5 -5
  88. package/dist/db-Bg-zC3r5.d.ts +0 -5
  89. package/dist/history-BgI33Kie.d.ts +0 -78
  90. package/dist/images-CecjXAAz.js +0 -64
  91. package/dist/task-runner-B-PD_JOj.js +0 -1074
  92. package/dist/turn-session-routing-Dyut9l7Y.js +0 -76
  93. package/dist/user-input-request-BDFBdF8r.js +0 -116
  94. package/dist/web-message-id-CJSUiksE.js +0 -236
  95. package/migrations/README.md +0 -30
@@ -0,0 +1,4176 @@
1
+ {
2
+ "id": "23edc95b-dfa5-495f-8ea5-cffc997c069d",
3
+ "prevId": "d814ccc1-bdb1-4766-a8b3-2f9ecb6dd89e",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.junior_agent_bindings": {
8
+ "name": "junior_agent_bindings",
9
+ "schema": "",
10
+ "columns": {
11
+ "parent_conversation_id": {
12
+ "name": "parent_conversation_id",
13
+ "type": "text",
14
+ "primaryKey": false,
15
+ "notNull": true
16
+ },
17
+ "name": {
18
+ "name": "name",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "child_conversation_id": {
24
+ "name": "child_conversation_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ }
29
+ },
30
+ "indexes": {
31
+ "junior_agent_bindings_child_idx": {
32
+ "name": "junior_agent_bindings_child_idx",
33
+ "columns": [
34
+ {
35
+ "expression": "child_conversation_id",
36
+ "isExpression": false,
37
+ "asc": true,
38
+ "nulls": "last"
39
+ }
40
+ ],
41
+ "isUnique": true,
42
+ "concurrently": false,
43
+ "method": "btree",
44
+ "with": {}
45
+ }
46
+ },
47
+ "foreignKeys": {
48
+ "junior_agent_bindings_parent_conversation_id_junior_conversations_conversation_id_fk": {
49
+ "name": "junior_agent_bindings_parent_conversation_id_junior_conversations_conversation_id_fk",
50
+ "tableFrom": "junior_agent_bindings",
51
+ "tableTo": "junior_conversations",
52
+ "columnsFrom": [
53
+ "parent_conversation_id"
54
+ ],
55
+ "columnsTo": [
56
+ "conversation_id"
57
+ ],
58
+ "onDelete": "no action",
59
+ "onUpdate": "no action"
60
+ },
61
+ "junior_agent_bindings_child_conversation_id_junior_conversations_conversation_id_fk": {
62
+ "name": "junior_agent_bindings_child_conversation_id_junior_conversations_conversation_id_fk",
63
+ "tableFrom": "junior_agent_bindings",
64
+ "tableTo": "junior_conversations",
65
+ "columnsFrom": [
66
+ "child_conversation_id"
67
+ ],
68
+ "columnsTo": [
69
+ "conversation_id"
70
+ ],
71
+ "onDelete": "no action",
72
+ "onUpdate": "no action"
73
+ }
74
+ },
75
+ "compositePrimaryKeys": {
76
+ "junior_agent_bindings_parent_conversation_id_name_pk": {
77
+ "name": "junior_agent_bindings_parent_conversation_id_name_pk",
78
+ "columns": [
79
+ "parent_conversation_id",
80
+ "name"
81
+ ]
82
+ }
83
+ },
84
+ "uniqueConstraints": {},
85
+ "policies": {},
86
+ "checkConstraints": {},
87
+ "isRLSEnabled": false
88
+ },
89
+ "public.junior_agent_invocations": {
90
+ "name": "junior_agent_invocations",
91
+ "schema": "",
92
+ "columns": {
93
+ "invocation_id": {
94
+ "name": "invocation_id",
95
+ "type": "text",
96
+ "primaryKey": true,
97
+ "notNull": true
98
+ },
99
+ "parent_conversation_id": {
100
+ "name": "parent_conversation_id",
101
+ "type": "text",
102
+ "primaryKey": false,
103
+ "notNull": true
104
+ },
105
+ "child_conversation_id": {
106
+ "name": "child_conversation_id",
107
+ "type": "text",
108
+ "primaryKey": false,
109
+ "notNull": true
110
+ },
111
+ "agent_name": {
112
+ "name": "agent_name",
113
+ "type": "text",
114
+ "primaryKey": false,
115
+ "notNull": false
116
+ },
117
+ "input": {
118
+ "name": "input",
119
+ "type": "text",
120
+ "primaryKey": false,
121
+ "notNull": true
122
+ },
123
+ "title": {
124
+ "name": "title",
125
+ "type": "text",
126
+ "primaryKey": false,
127
+ "notNull": false
128
+ },
129
+ "actor_json": {
130
+ "name": "actor_json",
131
+ "type": "jsonb",
132
+ "primaryKey": false,
133
+ "notNull": true
134
+ },
135
+ "credential_context_json": {
136
+ "name": "credential_context_json",
137
+ "type": "jsonb",
138
+ "primaryKey": false,
139
+ "notNull": false
140
+ },
141
+ "source_json": {
142
+ "name": "source_json",
143
+ "type": "jsonb",
144
+ "primaryKey": false,
145
+ "notNull": true
146
+ },
147
+ "destination_json": {
148
+ "name": "destination_json",
149
+ "type": "jsonb",
150
+ "primaryKey": false,
151
+ "notNull": true
152
+ },
153
+ "destination_visibility": {
154
+ "name": "destination_visibility",
155
+ "type": "text",
156
+ "primaryKey": false,
157
+ "notNull": false
158
+ },
159
+ "agent_type": {
160
+ "name": "agent_type",
161
+ "type": "text",
162
+ "primaryKey": false,
163
+ "notNull": false
164
+ },
165
+ "model_profile": {
166
+ "name": "model_profile",
167
+ "type": "text",
168
+ "primaryKey": false,
169
+ "notNull": false
170
+ },
171
+ "reasoning_level": {
172
+ "name": "reasoning_level",
173
+ "type": "text",
174
+ "primaryKey": false,
175
+ "notNull": false
176
+ },
177
+ "parent_tool_call_id": {
178
+ "name": "parent_tool_call_id",
179
+ "type": "text",
180
+ "primaryKey": false,
181
+ "notNull": false
182
+ },
183
+ "status": {
184
+ "name": "status",
185
+ "type": "text",
186
+ "primaryKey": false,
187
+ "notNull": true
188
+ },
189
+ "mailbox_status": {
190
+ "name": "mailbox_status",
191
+ "type": "text",
192
+ "primaryKey": false,
193
+ "notNull": true
194
+ },
195
+ "parent_mailbox_status": {
196
+ "name": "parent_mailbox_status",
197
+ "type": "text",
198
+ "primaryKey": false,
199
+ "notNull": false
200
+ },
201
+ "result": {
202
+ "name": "result",
203
+ "type": "text",
204
+ "primaryKey": false,
205
+ "notNull": false
206
+ },
207
+ "error_message": {
208
+ "name": "error_message",
209
+ "type": "text",
210
+ "primaryKey": false,
211
+ "notNull": false
212
+ },
213
+ "created_at": {
214
+ "name": "created_at",
215
+ "type": "timestamp with time zone",
216
+ "primaryKey": false,
217
+ "notNull": true
218
+ },
219
+ "updated_at": {
220
+ "name": "updated_at",
221
+ "type": "timestamp with time zone",
222
+ "primaryKey": false,
223
+ "notNull": true
224
+ },
225
+ "terminal_at": {
226
+ "name": "terminal_at",
227
+ "type": "timestamp with time zone",
228
+ "primaryKey": false,
229
+ "notNull": false
230
+ }
231
+ },
232
+ "indexes": {
233
+ "junior_agent_invocations_child_idx": {
234
+ "name": "junior_agent_invocations_child_idx",
235
+ "columns": [
236
+ {
237
+ "expression": "child_conversation_id",
238
+ "isExpression": false,
239
+ "asc": true,
240
+ "nulls": "last"
241
+ }
242
+ ],
243
+ "isUnique": false,
244
+ "concurrently": false,
245
+ "method": "btree",
246
+ "with": {}
247
+ },
248
+ "junior_agent_invocations_mailbox_idx": {
249
+ "name": "junior_agent_invocations_mailbox_idx",
250
+ "columns": [
251
+ {
252
+ "expression": "mailbox_status",
253
+ "isExpression": false,
254
+ "asc": true,
255
+ "nulls": "last"
256
+ },
257
+ {
258
+ "expression": "created_at",
259
+ "isExpression": false,
260
+ "asc": true,
261
+ "nulls": "last"
262
+ }
263
+ ],
264
+ "isUnique": false,
265
+ "concurrently": false,
266
+ "method": "btree",
267
+ "with": {}
268
+ },
269
+ "junior_agent_invocations_parent_mailbox_idx": {
270
+ "name": "junior_agent_invocations_parent_mailbox_idx",
271
+ "columns": [
272
+ {
273
+ "expression": "parent_mailbox_status",
274
+ "isExpression": false,
275
+ "asc": true,
276
+ "nulls": "last"
277
+ },
278
+ {
279
+ "expression": "terminal_at",
280
+ "isExpression": false,
281
+ "asc": true,
282
+ "nulls": "last"
283
+ }
284
+ ],
285
+ "isUnique": false,
286
+ "concurrently": false,
287
+ "method": "btree",
288
+ "with": {}
289
+ }
290
+ },
291
+ "foreignKeys": {
292
+ "junior_agent_invocations_parent_conversation_id_junior_conversations_conversation_id_fk": {
293
+ "name": "junior_agent_invocations_parent_conversation_id_junior_conversations_conversation_id_fk",
294
+ "tableFrom": "junior_agent_invocations",
295
+ "tableTo": "junior_conversations",
296
+ "columnsFrom": [
297
+ "parent_conversation_id"
298
+ ],
299
+ "columnsTo": [
300
+ "conversation_id"
301
+ ],
302
+ "onDelete": "no action",
303
+ "onUpdate": "no action"
304
+ },
305
+ "junior_agent_invocations_child_conversation_id_junior_conversations_conversation_id_fk": {
306
+ "name": "junior_agent_invocations_child_conversation_id_junior_conversations_conversation_id_fk",
307
+ "tableFrom": "junior_agent_invocations",
308
+ "tableTo": "junior_conversations",
309
+ "columnsFrom": [
310
+ "child_conversation_id"
311
+ ],
312
+ "columnsTo": [
313
+ "conversation_id"
314
+ ],
315
+ "onDelete": "no action",
316
+ "onUpdate": "no action"
317
+ }
318
+ },
319
+ "compositePrimaryKeys": {},
320
+ "uniqueConstraints": {},
321
+ "policies": {},
322
+ "checkConstraints": {},
323
+ "isRLSEnabled": false
324
+ },
325
+ "public.junior_api_tokens": {
326
+ "name": "junior_api_tokens",
327
+ "schema": "",
328
+ "columns": {
329
+ "id": {
330
+ "name": "id",
331
+ "type": "text",
332
+ "primaryKey": true,
333
+ "notNull": true
334
+ },
335
+ "owner_email_normalized": {
336
+ "name": "owner_email_normalized",
337
+ "type": "text",
338
+ "primaryKey": false,
339
+ "notNull": true
340
+ },
341
+ "name": {
342
+ "name": "name",
343
+ "type": "text",
344
+ "primaryKey": false,
345
+ "notNull": true
346
+ },
347
+ "token_hash": {
348
+ "name": "token_hash",
349
+ "type": "text",
350
+ "primaryKey": false,
351
+ "notNull": true
352
+ },
353
+ "token_suffix": {
354
+ "name": "token_suffix",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": true
358
+ },
359
+ "created_at": {
360
+ "name": "created_at",
361
+ "type": "timestamp with time zone",
362
+ "primaryKey": false,
363
+ "notNull": true
364
+ },
365
+ "expires_at": {
366
+ "name": "expires_at",
367
+ "type": "timestamp with time zone",
368
+ "primaryKey": false,
369
+ "notNull": true
370
+ },
371
+ "last_used_at": {
372
+ "name": "last_used_at",
373
+ "type": "timestamp with time zone",
374
+ "primaryKey": false,
375
+ "notNull": false
376
+ },
377
+ "revoked_at": {
378
+ "name": "revoked_at",
379
+ "type": "timestamp with time zone",
380
+ "primaryKey": false,
381
+ "notNull": false
382
+ }
383
+ },
384
+ "indexes": {
385
+ "junior_api_tokens_token_hash_uidx": {
386
+ "name": "junior_api_tokens_token_hash_uidx",
387
+ "columns": [
388
+ {
389
+ "expression": "token_hash",
390
+ "isExpression": false,
391
+ "asc": true,
392
+ "nulls": "last"
393
+ }
394
+ ],
395
+ "isUnique": true,
396
+ "concurrently": false,
397
+ "method": "btree",
398
+ "with": {}
399
+ },
400
+ "junior_api_tokens_owner_email_idx": {
401
+ "name": "junior_api_tokens_owner_email_idx",
402
+ "columns": [
403
+ {
404
+ "expression": "owner_email_normalized",
405
+ "isExpression": false,
406
+ "asc": true,
407
+ "nulls": "last"
408
+ }
409
+ ],
410
+ "isUnique": false,
411
+ "concurrently": false,
412
+ "method": "btree",
413
+ "with": {}
414
+ }
415
+ },
416
+ "foreignKeys": {},
417
+ "compositePrimaryKeys": {},
418
+ "uniqueConstraints": {},
419
+ "policies": {},
420
+ "checkConstraints": {},
421
+ "isRLSEnabled": false
422
+ },
423
+ "public.junior_artifacts": {
424
+ "name": "junior_artifacts",
425
+ "schema": "",
426
+ "columns": {
427
+ "id": {
428
+ "name": "id",
429
+ "type": "text",
430
+ "primaryKey": true,
431
+ "notNull": true
432
+ },
433
+ "conversation_id": {
434
+ "name": "conversation_id",
435
+ "type": "text",
436
+ "primaryKey": false,
437
+ "notNull": true
438
+ },
439
+ "sha256": {
440
+ "name": "sha256",
441
+ "type": "text",
442
+ "primaryKey": false,
443
+ "notNull": true
444
+ },
445
+ "ext": {
446
+ "name": "ext",
447
+ "type": "text",
448
+ "primaryKey": false,
449
+ "notNull": true
450
+ },
451
+ "storage_key": {
452
+ "name": "storage_key",
453
+ "type": "text",
454
+ "primaryKey": false,
455
+ "notNull": true
456
+ },
457
+ "content_type": {
458
+ "name": "content_type",
459
+ "type": "text",
460
+ "primaryKey": false,
461
+ "notNull": true
462
+ },
463
+ "bytes": {
464
+ "name": "bytes",
465
+ "type": "integer",
466
+ "primaryKey": false,
467
+ "notNull": true
468
+ },
469
+ "public": {
470
+ "name": "public",
471
+ "type": "boolean",
472
+ "primaryKey": false,
473
+ "notNull": true
474
+ },
475
+ "created_at": {
476
+ "name": "created_at",
477
+ "type": "timestamp with time zone",
478
+ "primaryKey": false,
479
+ "notNull": true
480
+ },
481
+ "delete_requested_at": {
482
+ "name": "delete_requested_at",
483
+ "type": "timestamp with time zone",
484
+ "primaryKey": false,
485
+ "notNull": false
486
+ }
487
+ },
488
+ "indexes": {
489
+ "junior_artifacts_conversation_sha_uidx": {
490
+ "name": "junior_artifacts_conversation_sha_uidx",
491
+ "columns": [
492
+ {
493
+ "expression": "conversation_id",
494
+ "isExpression": false,
495
+ "asc": true,
496
+ "nulls": "last"
497
+ },
498
+ {
499
+ "expression": "sha256",
500
+ "isExpression": false,
501
+ "asc": true,
502
+ "nulls": "last"
503
+ }
504
+ ],
505
+ "isUnique": true,
506
+ "concurrently": false,
507
+ "method": "btree",
508
+ "with": {}
509
+ },
510
+ "junior_artifacts_gc_idx": {
511
+ "name": "junior_artifacts_gc_idx",
512
+ "columns": [
513
+ {
514
+ "expression": "delete_requested_at",
515
+ "isExpression": false,
516
+ "asc": true,
517
+ "nulls": "last"
518
+ },
519
+ {
520
+ "expression": "created_at",
521
+ "isExpression": false,
522
+ "asc": true,
523
+ "nulls": "last"
524
+ }
525
+ ],
526
+ "isUnique": false,
527
+ "concurrently": false,
528
+ "method": "btree",
529
+ "with": {}
530
+ },
531
+ "junior_artifacts_conversation_idx": {
532
+ "name": "junior_artifacts_conversation_idx",
533
+ "columns": [
534
+ {
535
+ "expression": "conversation_id",
536
+ "isExpression": false,
537
+ "asc": true,
538
+ "nulls": "last"
539
+ }
540
+ ],
541
+ "isUnique": false,
542
+ "concurrently": false,
543
+ "method": "btree",
544
+ "with": {}
545
+ }
546
+ },
547
+ "foreignKeys": {},
548
+ "compositePrimaryKeys": {},
549
+ "uniqueConstraints": {},
550
+ "policies": {},
551
+ "checkConstraints": {},
552
+ "isRLSEnabled": false
553
+ },
554
+ "public.junior_attachments": {
555
+ "name": "junior_attachments",
556
+ "schema": "",
557
+ "columns": {
558
+ "id": {
559
+ "name": "id",
560
+ "type": "text",
561
+ "primaryKey": true,
562
+ "notNull": true
563
+ },
564
+ "conversation_id": {
565
+ "name": "conversation_id",
566
+ "type": "text",
567
+ "primaryKey": false,
568
+ "notNull": true
569
+ },
570
+ "storage_provider": {
571
+ "name": "storage_provider",
572
+ "type": "text",
573
+ "primaryKey": false,
574
+ "notNull": true
575
+ },
576
+ "storage_key": {
577
+ "name": "storage_key",
578
+ "type": "text",
579
+ "primaryKey": false,
580
+ "notNull": true
581
+ },
582
+ "provider": {
583
+ "name": "provider",
584
+ "type": "text",
585
+ "primaryKey": false,
586
+ "notNull": false
587
+ },
588
+ "provider_id": {
589
+ "name": "provider_id",
590
+ "type": "text",
591
+ "primaryKey": false,
592
+ "notNull": false
593
+ },
594
+ "filename": {
595
+ "name": "filename",
596
+ "type": "text",
597
+ "primaryKey": false,
598
+ "notNull": true
599
+ },
600
+ "content_type": {
601
+ "name": "content_type",
602
+ "type": "text",
603
+ "primaryKey": false,
604
+ "notNull": true
605
+ },
606
+ "bytes": {
607
+ "name": "bytes",
608
+ "type": "integer",
609
+ "primaryKey": false,
610
+ "notNull": true
611
+ },
612
+ "sha256": {
613
+ "name": "sha256",
614
+ "type": "text",
615
+ "primaryKey": false,
616
+ "notNull": true
617
+ },
618
+ "vision_summary": {
619
+ "name": "vision_summary",
620
+ "type": "text",
621
+ "primaryKey": false,
622
+ "notNull": false
623
+ },
624
+ "created_at": {
625
+ "name": "created_at",
626
+ "type": "timestamp with time zone",
627
+ "primaryKey": false,
628
+ "notNull": true
629
+ },
630
+ "delete_requested_at": {
631
+ "name": "delete_requested_at",
632
+ "type": "timestamp with time zone",
633
+ "primaryKey": false,
634
+ "notNull": false
635
+ }
636
+ },
637
+ "indexes": {
638
+ "junior_attachments_conversation_idx": {
639
+ "name": "junior_attachments_conversation_idx",
640
+ "columns": [
641
+ {
642
+ "expression": "conversation_id",
643
+ "isExpression": false,
644
+ "asc": true,
645
+ "nulls": "last"
646
+ }
647
+ ],
648
+ "isUnique": false,
649
+ "concurrently": false,
650
+ "method": "btree",
651
+ "with": {}
652
+ },
653
+ "junior_attachments_provider_idx": {
654
+ "name": "junior_attachments_provider_idx",
655
+ "columns": [
656
+ {
657
+ "expression": "conversation_id",
658
+ "isExpression": false,
659
+ "asc": true,
660
+ "nulls": "last"
661
+ },
662
+ {
663
+ "expression": "provider",
664
+ "isExpression": false,
665
+ "asc": true,
666
+ "nulls": "last"
667
+ },
668
+ {
669
+ "expression": "provider_id",
670
+ "isExpression": false,
671
+ "asc": true,
672
+ "nulls": "last"
673
+ }
674
+ ],
675
+ "isUnique": false,
676
+ "concurrently": false,
677
+ "method": "btree",
678
+ "with": {}
679
+ },
680
+ "junior_attachments_gc_idx": {
681
+ "name": "junior_attachments_gc_idx",
682
+ "columns": [
683
+ {
684
+ "expression": "storage_provider",
685
+ "isExpression": false,
686
+ "asc": true,
687
+ "nulls": "last"
688
+ },
689
+ {
690
+ "expression": "delete_requested_at",
691
+ "isExpression": false,
692
+ "asc": true,
693
+ "nulls": "last"
694
+ },
695
+ {
696
+ "expression": "created_at",
697
+ "isExpression": false,
698
+ "asc": true,
699
+ "nulls": "last"
700
+ }
701
+ ],
702
+ "isUnique": false,
703
+ "concurrently": false,
704
+ "method": "btree",
705
+ "with": {}
706
+ }
707
+ },
708
+ "foreignKeys": {
709
+ "junior_attachments_conversation_id_junior_conversations_conversation_id_fk": {
710
+ "name": "junior_attachments_conversation_id_junior_conversations_conversation_id_fk",
711
+ "tableFrom": "junior_attachments",
712
+ "tableTo": "junior_conversations",
713
+ "columnsFrom": [
714
+ "conversation_id"
715
+ ],
716
+ "columnsTo": [
717
+ "conversation_id"
718
+ ],
719
+ "onDelete": "cascade",
720
+ "onUpdate": "no action"
721
+ }
722
+ },
723
+ "compositePrimaryKeys": {},
724
+ "uniqueConstraints": {},
725
+ "policies": {},
726
+ "checkConstraints": {},
727
+ "isRLSEnabled": false
728
+ },
729
+ "public.junior_automation_runs": {
730
+ "name": "junior_automation_runs",
731
+ "schema": "",
732
+ "columns": {
733
+ "id": {
734
+ "name": "id",
735
+ "type": "text",
736
+ "primaryKey": true,
737
+ "notNull": true
738
+ },
739
+ "automation_id": {
740
+ "name": "automation_id",
741
+ "type": "text",
742
+ "primaryKey": false,
743
+ "notNull": true
744
+ },
745
+ "conversation_id": {
746
+ "name": "conversation_id",
747
+ "type": "text",
748
+ "primaryKey": false,
749
+ "notNull": false
750
+ },
751
+ "status": {
752
+ "name": "status",
753
+ "type": "text",
754
+ "primaryKey": false,
755
+ "notNull": true
756
+ },
757
+ "automation_version": {
758
+ "name": "automation_version",
759
+ "type": "integer",
760
+ "primaryKey": false,
761
+ "notNull": false
762
+ },
763
+ "scheduled_for_ms": {
764
+ "name": "scheduled_for_ms",
765
+ "type": "bigint",
766
+ "primaryKey": false,
767
+ "notNull": false
768
+ },
769
+ "attempt": {
770
+ "name": "attempt",
771
+ "type": "integer",
772
+ "primaryKey": false,
773
+ "notNull": false
774
+ },
775
+ "claimed_at_ms": {
776
+ "name": "claimed_at_ms",
777
+ "type": "bigint",
778
+ "primaryKey": false,
779
+ "notNull": false
780
+ },
781
+ "dispatch_id": {
782
+ "name": "dispatch_id",
783
+ "type": "text",
784
+ "primaryKey": false,
785
+ "notNull": false
786
+ },
787
+ "started_at_ms": {
788
+ "name": "started_at_ms",
789
+ "type": "bigint",
790
+ "primaryKey": false,
791
+ "notNull": false
792
+ },
793
+ "completed_at_ms": {
794
+ "name": "completed_at_ms",
795
+ "type": "bigint",
796
+ "primaryKey": false,
797
+ "notNull": false
798
+ },
799
+ "error_message": {
800
+ "name": "error_message",
801
+ "type": "text",
802
+ "primaryKey": false,
803
+ "notNull": false
804
+ },
805
+ "result_message_ts": {
806
+ "name": "result_message_ts",
807
+ "type": "text",
808
+ "primaryKey": false,
809
+ "notNull": false
810
+ }
811
+ },
812
+ "indexes": {
813
+ "junior_automation_runs_automation_idx": {
814
+ "name": "junior_automation_runs_automation_idx",
815
+ "columns": [
816
+ {
817
+ "expression": "automation_id",
818
+ "isExpression": false,
819
+ "asc": true,
820
+ "nulls": "last"
821
+ },
822
+ {
823
+ "expression": "completed_at_ms",
824
+ "isExpression": false,
825
+ "asc": true,
826
+ "nulls": "last"
827
+ }
828
+ ],
829
+ "isUnique": false,
830
+ "concurrently": false,
831
+ "method": "btree",
832
+ "with": {}
833
+ },
834
+ "junior_automation_runs_completed_idx": {
835
+ "name": "junior_automation_runs_completed_idx",
836
+ "columns": [
837
+ {
838
+ "expression": "completed_at_ms",
839
+ "isExpression": false,
840
+ "asc": true,
841
+ "nulls": "last"
842
+ }
843
+ ],
844
+ "isUnique": false,
845
+ "concurrently": false,
846
+ "method": "btree",
847
+ "with": {}
848
+ },
849
+ "junior_automation_runs_incomplete_idx": {
850
+ "name": "junior_automation_runs_incomplete_idx",
851
+ "columns": [
852
+ {
853
+ "expression": "automation_id",
854
+ "isExpression": false,
855
+ "asc": true,
856
+ "nulls": "last"
857
+ },
858
+ {
859
+ "expression": "scheduled_for_ms",
860
+ "isExpression": false,
861
+ "asc": true,
862
+ "nulls": "last"
863
+ }
864
+ ],
865
+ "isUnique": false,
866
+ "where": "\"junior_automation_runs\".\"status\" in ('pending', 'running')",
867
+ "concurrently": false,
868
+ "method": "btree",
869
+ "with": {}
870
+ }
871
+ },
872
+ "foreignKeys": {
873
+ "junior_automation_runs_automation_id_junior_automations_id_fk": {
874
+ "name": "junior_automation_runs_automation_id_junior_automations_id_fk",
875
+ "tableFrom": "junior_automation_runs",
876
+ "tableTo": "junior_automations",
877
+ "columnsFrom": [
878
+ "automation_id"
879
+ ],
880
+ "columnsTo": [
881
+ "id"
882
+ ],
883
+ "onDelete": "cascade",
884
+ "onUpdate": "no action"
885
+ },
886
+ "junior_automation_runs_conversation_id_junior_conversations_conversation_id_fk": {
887
+ "name": "junior_automation_runs_conversation_id_junior_conversations_conversation_id_fk",
888
+ "tableFrom": "junior_automation_runs",
889
+ "tableTo": "junior_conversations",
890
+ "columnsFrom": [
891
+ "conversation_id"
892
+ ],
893
+ "columnsTo": [
894
+ "conversation_id"
895
+ ],
896
+ "onDelete": "no action",
897
+ "onUpdate": "no action"
898
+ },
899
+ "junior_automation_runs_automation_version_fk": {
900
+ "name": "junior_automation_runs_automation_version_fk",
901
+ "tableFrom": "junior_automation_runs",
902
+ "tableTo": "junior_automation_versions",
903
+ "columnsFrom": [
904
+ "automation_id",
905
+ "automation_version"
906
+ ],
907
+ "columnsTo": [
908
+ "automation_id",
909
+ "version"
910
+ ],
911
+ "onDelete": "no action",
912
+ "onUpdate": "no action"
913
+ }
914
+ },
915
+ "compositePrimaryKeys": {},
916
+ "uniqueConstraints": {
917
+ "junior_automation_runs_conversation_id_unique": {
918
+ "name": "junior_automation_runs_conversation_id_unique",
919
+ "nullsNotDistinct": false,
920
+ "columns": [
921
+ "conversation_id"
922
+ ]
923
+ }
924
+ },
925
+ "policies": {},
926
+ "checkConstraints": {
927
+ "junior_automation_runs_status_check": {
928
+ "name": "junior_automation_runs_status_check",
929
+ "value": "\"junior_automation_runs\".\"status\" in ('pending', 'running', 'completed', 'failed', 'blocked', 'skipped')"
930
+ }
931
+ },
932
+ "isRLSEnabled": false
933
+ },
934
+ "public.junior_automation_versions": {
935
+ "name": "junior_automation_versions",
936
+ "schema": "",
937
+ "columns": {
938
+ "automation_id": {
939
+ "name": "automation_id",
940
+ "type": "text",
941
+ "primaryKey": false,
942
+ "notNull": true
943
+ },
944
+ "version": {
945
+ "name": "version",
946
+ "type": "integer",
947
+ "primaryKey": false,
948
+ "notNull": true
949
+ },
950
+ "created_at_ms": {
951
+ "name": "created_at_ms",
952
+ "type": "bigint",
953
+ "primaryKey": false,
954
+ "notNull": true
955
+ },
956
+ "edited_by": {
957
+ "name": "edited_by",
958
+ "type": "jsonb",
959
+ "primaryKey": false,
960
+ "notNull": false
961
+ },
962
+ "definition": {
963
+ "name": "definition",
964
+ "type": "jsonb",
965
+ "primaryKey": false,
966
+ "notNull": true
967
+ }
968
+ },
969
+ "indexes": {},
970
+ "foreignKeys": {
971
+ "junior_automation_versions_automation_id_fk": {
972
+ "name": "junior_automation_versions_automation_id_fk",
973
+ "tableFrom": "junior_automation_versions",
974
+ "tableTo": "junior_automations",
975
+ "columnsFrom": [
976
+ "automation_id"
977
+ ],
978
+ "columnsTo": [
979
+ "id"
980
+ ],
981
+ "onDelete": "cascade",
982
+ "onUpdate": "no action"
983
+ }
984
+ },
985
+ "compositePrimaryKeys": {
986
+ "junior_automation_versions_pk": {
987
+ "name": "junior_automation_versions_pk",
988
+ "columns": [
989
+ "automation_id",
990
+ "version"
991
+ ]
992
+ }
993
+ },
994
+ "uniqueConstraints": {},
995
+ "policies": {},
996
+ "checkConstraints": {},
997
+ "isRLSEnabled": false
998
+ },
999
+ "public.junior_automations": {
1000
+ "name": "junior_automations",
1001
+ "schema": "",
1002
+ "columns": {
1003
+ "id": {
1004
+ "name": "id",
1005
+ "type": "text",
1006
+ "primaryKey": true,
1007
+ "notNull": true
1008
+ },
1009
+ "kind": {
1010
+ "name": "kind",
1011
+ "type": "text",
1012
+ "primaryKey": false,
1013
+ "notNull": true
1014
+ },
1015
+ "team_id": {
1016
+ "name": "team_id",
1017
+ "type": "text",
1018
+ "primaryKey": false,
1019
+ "notNull": true
1020
+ },
1021
+ "channel_id": {
1022
+ "name": "channel_id",
1023
+ "type": "text",
1024
+ "primaryKey": false,
1025
+ "notNull": true
1026
+ },
1027
+ "creator_slack_user_id": {
1028
+ "name": "creator_slack_user_id",
1029
+ "type": "text",
1030
+ "primaryKey": false,
1031
+ "notNull": true
1032
+ },
1033
+ "creator_identity_id": {
1034
+ "name": "creator_identity_id",
1035
+ "type": "text",
1036
+ "primaryKey": false,
1037
+ "notNull": true
1038
+ },
1039
+ "status": {
1040
+ "name": "status",
1041
+ "type": "text",
1042
+ "primaryKey": false,
1043
+ "notNull": true
1044
+ },
1045
+ "status_reason": {
1046
+ "name": "status_reason",
1047
+ "type": "text",
1048
+ "primaryKey": false,
1049
+ "notNull": false
1050
+ },
1051
+ "title": {
1052
+ "name": "title",
1053
+ "type": "text",
1054
+ "primaryKey": false,
1055
+ "notNull": false
1056
+ },
1057
+ "instruction": {
1058
+ "name": "instruction",
1059
+ "type": "text",
1060
+ "primaryKey": false,
1061
+ "notNull": true
1062
+ },
1063
+ "created_at_ms": {
1064
+ "name": "created_at_ms",
1065
+ "type": "bigint",
1066
+ "primaryKey": false,
1067
+ "notNull": true
1068
+ },
1069
+ "next_run_at_ms": {
1070
+ "name": "next_run_at_ms",
1071
+ "type": "bigint",
1072
+ "primaryKey": false,
1073
+ "notNull": false
1074
+ },
1075
+ "run_now_at_ms": {
1076
+ "name": "run_now_at_ms",
1077
+ "type": "bigint",
1078
+ "primaryKey": false,
1079
+ "notNull": false
1080
+ },
1081
+ "namespace": {
1082
+ "name": "namespace",
1083
+ "type": "text",
1084
+ "primaryKey": false,
1085
+ "notNull": false
1086
+ },
1087
+ "identifier": {
1088
+ "name": "identifier",
1089
+ "type": "text",
1090
+ "primaryKey": false,
1091
+ "notNull": false
1092
+ },
1093
+ "record": {
1094
+ "name": "record",
1095
+ "type": "jsonb",
1096
+ "primaryKey": false,
1097
+ "notNull": true
1098
+ }
1099
+ },
1100
+ "indexes": {
1101
+ "junior_automations_team_idx": {
1102
+ "name": "junior_automations_team_idx",
1103
+ "columns": [
1104
+ {
1105
+ "expression": "team_id",
1106
+ "isExpression": false,
1107
+ "asc": true,
1108
+ "nulls": "last"
1109
+ },
1110
+ {
1111
+ "expression": "created_at_ms",
1112
+ "isExpression": false,
1113
+ "asc": true,
1114
+ "nulls": "last"
1115
+ },
1116
+ {
1117
+ "expression": "id",
1118
+ "isExpression": false,
1119
+ "asc": true,
1120
+ "nulls": "last"
1121
+ }
1122
+ ],
1123
+ "isUnique": false,
1124
+ "where": "\"junior_automations\".\"status\" <> 'deleted'",
1125
+ "concurrently": false,
1126
+ "method": "btree",
1127
+ "with": {}
1128
+ },
1129
+ "junior_automations_creator_identity_idx": {
1130
+ "name": "junior_automations_creator_identity_idx",
1131
+ "columns": [
1132
+ {
1133
+ "expression": "creator_identity_id",
1134
+ "isExpression": false,
1135
+ "asc": true,
1136
+ "nulls": "last"
1137
+ },
1138
+ {
1139
+ "expression": "created_at_ms",
1140
+ "isExpression": false,
1141
+ "asc": true,
1142
+ "nulls": "last"
1143
+ },
1144
+ {
1145
+ "expression": "id",
1146
+ "isExpression": false,
1147
+ "asc": true,
1148
+ "nulls": "last"
1149
+ }
1150
+ ],
1151
+ "isUnique": false,
1152
+ "concurrently": false,
1153
+ "method": "btree",
1154
+ "with": {}
1155
+ },
1156
+ "junior_automations_run_now_due_idx": {
1157
+ "name": "junior_automations_run_now_due_idx",
1158
+ "columns": [
1159
+ {
1160
+ "expression": "run_now_at_ms",
1161
+ "isExpression": false,
1162
+ "asc": true,
1163
+ "nulls": "last"
1164
+ },
1165
+ {
1166
+ "expression": "created_at_ms",
1167
+ "isExpression": false,
1168
+ "asc": true,
1169
+ "nulls": "last"
1170
+ },
1171
+ {
1172
+ "expression": "id",
1173
+ "isExpression": false,
1174
+ "asc": true,
1175
+ "nulls": "last"
1176
+ }
1177
+ ],
1178
+ "isUnique": false,
1179
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"run_now_at_ms\" IS NOT NULL",
1180
+ "concurrently": false,
1181
+ "method": "btree",
1182
+ "with": {}
1183
+ },
1184
+ "junior_automations_next_run_due_idx": {
1185
+ "name": "junior_automations_next_run_due_idx",
1186
+ "columns": [
1187
+ {
1188
+ "expression": "next_run_at_ms",
1189
+ "isExpression": false,
1190
+ "asc": true,
1191
+ "nulls": "last"
1192
+ },
1193
+ {
1194
+ "expression": "created_at_ms",
1195
+ "isExpression": false,
1196
+ "asc": true,
1197
+ "nulls": "last"
1198
+ },
1199
+ {
1200
+ "expression": "id",
1201
+ "isExpression": false,
1202
+ "asc": true,
1203
+ "nulls": "last"
1204
+ }
1205
+ ],
1206
+ "isUnique": false,
1207
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"next_run_at_ms\" IS NOT NULL",
1208
+ "concurrently": false,
1209
+ "method": "btree",
1210
+ "with": {}
1211
+ },
1212
+ "junior_automations_match_idx": {
1213
+ "name": "junior_automations_match_idx",
1214
+ "columns": [
1215
+ {
1216
+ "expression": "namespace",
1217
+ "isExpression": false,
1218
+ "asc": true,
1219
+ "nulls": "last"
1220
+ },
1221
+ {
1222
+ "expression": "identifier",
1223
+ "isExpression": false,
1224
+ "asc": true,
1225
+ "nulls": "last"
1226
+ },
1227
+ {
1228
+ "expression": "created_at_ms",
1229
+ "isExpression": false,
1230
+ "asc": true,
1231
+ "nulls": "last"
1232
+ },
1233
+ {
1234
+ "expression": "id",
1235
+ "isExpression": false,
1236
+ "asc": true,
1237
+ "nulls": "last"
1238
+ }
1239
+ ],
1240
+ "isUnique": false,
1241
+ "where": "\"junior_automations\".\"status\" <> 'deleted'",
1242
+ "concurrently": false,
1243
+ "method": "btree",
1244
+ "with": {}
1245
+ }
1246
+ },
1247
+ "foreignKeys": {
1248
+ "junior_automations_creator_identity_id_junior_identities_id_fk": {
1249
+ "name": "junior_automations_creator_identity_id_junior_identities_id_fk",
1250
+ "tableFrom": "junior_automations",
1251
+ "tableTo": "junior_identities",
1252
+ "columnsFrom": [
1253
+ "creator_identity_id"
1254
+ ],
1255
+ "columnsTo": [
1256
+ "id"
1257
+ ],
1258
+ "onDelete": "no action",
1259
+ "onUpdate": "no action"
1260
+ }
1261
+ },
1262
+ "compositePrimaryKeys": {},
1263
+ "uniqueConstraints": {},
1264
+ "policies": {},
1265
+ "checkConstraints": {
1266
+ "junior_automations_kind_check": {
1267
+ "name": "junior_automations_kind_check",
1268
+ "value": "\"junior_automations\".\"kind\" in ('scheduled', 'event')"
1269
+ },
1270
+ "junior_automations_status_check": {
1271
+ "name": "junior_automations_status_check",
1272
+ "value": "\"junior_automations\".\"status\" in ('active', 'blocked', 'paused', 'completed', 'deleted')"
1273
+ },
1274
+ "junior_automations_record_check": {
1275
+ "name": "junior_automations_record_check",
1276
+ "value": "jsonb_typeof(\"junior_automations\".\"record\") = 'object'"
1277
+ },
1278
+ "junior_automations_trigger_check": {
1279
+ "name": "junior_automations_trigger_check",
1280
+ "value": "(\"junior_automations\".\"kind\" = 'scheduled' and \"junior_automations\".\"namespace\" is null and \"junior_automations\".\"identifier\" is null) or (\"junior_automations\".\"kind\" = 'event' and \"junior_automations\".\"namespace\" is not null and \"junior_automations\".\"next_run_at_ms\" is null and \"junior_automations\".\"run_now_at_ms\" is null and \"junior_automations\".\"status\" <> 'completed')"
1281
+ }
1282
+ },
1283
+ "isRLSEnabled": false
1284
+ },
1285
+ "public.junior_code_changes": {
1286
+ "name": "junior_code_changes",
1287
+ "schema": "",
1288
+ "columns": {
1289
+ "id": {
1290
+ "name": "id",
1291
+ "type": "uuid",
1292
+ "primaryKey": true,
1293
+ "notNull": true
1294
+ },
1295
+ "closed_at": {
1296
+ "name": "closed_at",
1297
+ "type": "timestamp with time zone",
1298
+ "primaryKey": false,
1299
+ "notNull": false
1300
+ },
1301
+ "conversation_ids": {
1302
+ "name": "conversation_ids",
1303
+ "type": "text[]",
1304
+ "primaryKey": false,
1305
+ "notNull": true,
1306
+ "default": "ARRAY[]::text[]"
1307
+ },
1308
+ "merged_at": {
1309
+ "name": "merged_at",
1310
+ "type": "timestamp with time zone",
1311
+ "primaryKey": false,
1312
+ "notNull": false
1313
+ },
1314
+ "number": {
1315
+ "name": "number",
1316
+ "type": "integer",
1317
+ "primaryKey": false,
1318
+ "notNull": true
1319
+ },
1320
+ "opened_at": {
1321
+ "name": "opened_at",
1322
+ "type": "timestamp with time zone",
1323
+ "primaryKey": false,
1324
+ "notNull": true
1325
+ },
1326
+ "provider": {
1327
+ "name": "provider",
1328
+ "type": "text",
1329
+ "primaryKey": false,
1330
+ "notNull": true
1331
+ },
1332
+ "provider_id": {
1333
+ "name": "provider_id",
1334
+ "type": "text",
1335
+ "primaryKey": false,
1336
+ "notNull": true
1337
+ },
1338
+ "repository_id": {
1339
+ "name": "repository_id",
1340
+ "type": "uuid",
1341
+ "primaryKey": false,
1342
+ "notNull": true
1343
+ },
1344
+ "state": {
1345
+ "name": "state",
1346
+ "type": "text",
1347
+ "primaryKey": false,
1348
+ "notNull": true
1349
+ },
1350
+ "title": {
1351
+ "name": "title",
1352
+ "type": "text",
1353
+ "primaryKey": false,
1354
+ "notNull": false
1355
+ },
1356
+ "updated_at": {
1357
+ "name": "updated_at",
1358
+ "type": "timestamp with time zone",
1359
+ "primaryKey": false,
1360
+ "notNull": true
1361
+ },
1362
+ "url": {
1363
+ "name": "url",
1364
+ "type": "text",
1365
+ "primaryKey": false,
1366
+ "notNull": false
1367
+ }
1368
+ },
1369
+ "indexes": {
1370
+ "junior_code_changes_provider_id_idx": {
1371
+ "name": "junior_code_changes_provider_id_idx",
1372
+ "columns": [
1373
+ {
1374
+ "expression": "provider",
1375
+ "isExpression": false,
1376
+ "asc": true,
1377
+ "nulls": "last"
1378
+ },
1379
+ {
1380
+ "expression": "provider_id",
1381
+ "isExpression": false,
1382
+ "asc": true,
1383
+ "nulls": "last"
1384
+ }
1385
+ ],
1386
+ "isUnique": true,
1387
+ "concurrently": false,
1388
+ "method": "btree",
1389
+ "with": {}
1390
+ },
1391
+ "junior_code_changes_opened_at_idx": {
1392
+ "name": "junior_code_changes_opened_at_idx",
1393
+ "columns": [
1394
+ {
1395
+ "expression": "opened_at",
1396
+ "isExpression": false,
1397
+ "asc": true,
1398
+ "nulls": "last"
1399
+ }
1400
+ ],
1401
+ "isUnique": false,
1402
+ "concurrently": false,
1403
+ "method": "btree",
1404
+ "with": {}
1405
+ },
1406
+ "junior_code_changes_merged_at_idx": {
1407
+ "name": "junior_code_changes_merged_at_idx",
1408
+ "columns": [
1409
+ {
1410
+ "expression": "merged_at",
1411
+ "isExpression": false,
1412
+ "asc": true,
1413
+ "nulls": "last"
1414
+ }
1415
+ ],
1416
+ "isUnique": false,
1417
+ "concurrently": false,
1418
+ "method": "btree",
1419
+ "with": {}
1420
+ },
1421
+ "junior_code_changes_closed_at_idx": {
1422
+ "name": "junior_code_changes_closed_at_idx",
1423
+ "columns": [
1424
+ {
1425
+ "expression": "closed_at",
1426
+ "isExpression": false,
1427
+ "asc": true,
1428
+ "nulls": "last"
1429
+ }
1430
+ ],
1431
+ "isUnique": false,
1432
+ "concurrently": false,
1433
+ "method": "btree",
1434
+ "with": {}
1435
+ },
1436
+ "junior_code_changes_open_idx": {
1437
+ "name": "junior_code_changes_open_idx",
1438
+ "columns": [
1439
+ {
1440
+ "expression": "id",
1441
+ "isExpression": false,
1442
+ "asc": true,
1443
+ "nulls": "last"
1444
+ }
1445
+ ],
1446
+ "isUnique": false,
1447
+ "where": "\"junior_code_changes\".\"state\" = 'open'",
1448
+ "concurrently": false,
1449
+ "method": "btree",
1450
+ "with": {}
1451
+ }
1452
+ },
1453
+ "foreignKeys": {
1454
+ "junior_code_changes_repository_id_junior_code_repositories_id_fk": {
1455
+ "name": "junior_code_changes_repository_id_junior_code_repositories_id_fk",
1456
+ "tableFrom": "junior_code_changes",
1457
+ "tableTo": "junior_code_repositories",
1458
+ "columnsFrom": [
1459
+ "repository_id"
1460
+ ],
1461
+ "columnsTo": [
1462
+ "id"
1463
+ ],
1464
+ "onDelete": "cascade",
1465
+ "onUpdate": "no action"
1466
+ }
1467
+ },
1468
+ "compositePrimaryKeys": {},
1469
+ "uniqueConstraints": {},
1470
+ "policies": {},
1471
+ "checkConstraints": {},
1472
+ "isRLSEnabled": false
1473
+ },
1474
+ "public.junior_code_repositories": {
1475
+ "name": "junior_code_repositories",
1476
+ "schema": "",
1477
+ "columns": {
1478
+ "id": {
1479
+ "name": "id",
1480
+ "type": "uuid",
1481
+ "primaryKey": true,
1482
+ "notNull": true
1483
+ },
1484
+ "name": {
1485
+ "name": "name",
1486
+ "type": "text",
1487
+ "primaryKey": false,
1488
+ "notNull": true
1489
+ },
1490
+ "provider": {
1491
+ "name": "provider",
1492
+ "type": "text",
1493
+ "primaryKey": false,
1494
+ "notNull": true
1495
+ },
1496
+ "provider_id": {
1497
+ "name": "provider_id",
1498
+ "type": "text",
1499
+ "primaryKey": false,
1500
+ "notNull": true
1501
+ },
1502
+ "url": {
1503
+ "name": "url",
1504
+ "type": "text",
1505
+ "primaryKey": false,
1506
+ "notNull": false
1507
+ },
1508
+ "updated_at": {
1509
+ "name": "updated_at",
1510
+ "type": "timestamp with time zone",
1511
+ "primaryKey": false,
1512
+ "notNull": true
1513
+ }
1514
+ },
1515
+ "indexes": {
1516
+ "junior_code_repositories_provider_id_idx": {
1517
+ "name": "junior_code_repositories_provider_id_idx",
1518
+ "columns": [
1519
+ {
1520
+ "expression": "provider",
1521
+ "isExpression": false,
1522
+ "asc": true,
1523
+ "nulls": "last"
1524
+ },
1525
+ {
1526
+ "expression": "provider_id",
1527
+ "isExpression": false,
1528
+ "asc": true,
1529
+ "nulls": "last"
1530
+ }
1531
+ ],
1532
+ "isUnique": true,
1533
+ "concurrently": false,
1534
+ "method": "btree",
1535
+ "with": {}
1536
+ }
1537
+ },
1538
+ "foreignKeys": {},
1539
+ "compositePrimaryKeys": {},
1540
+ "uniqueConstraints": {},
1541
+ "policies": {},
1542
+ "checkConstraints": {},
1543
+ "isRLSEnabled": false
1544
+ },
1545
+ "public.junior_conversation_annotations": {
1546
+ "name": "junior_conversation_annotations",
1547
+ "schema": "",
1548
+ "columns": {
1549
+ "conversation_id": {
1550
+ "name": "conversation_id",
1551
+ "type": "text",
1552
+ "primaryKey": false,
1553
+ "notNull": true
1554
+ },
1555
+ "plugin": {
1556
+ "name": "plugin",
1557
+ "type": "text",
1558
+ "primaryKey": false,
1559
+ "notNull": true
1560
+ },
1561
+ "kind": {
1562
+ "name": "kind",
1563
+ "type": "text",
1564
+ "primaryKey": false,
1565
+ "notNull": true
1566
+ },
1567
+ "key": {
1568
+ "name": "key",
1569
+ "type": "text",
1570
+ "primaryKey": false,
1571
+ "notNull": true
1572
+ },
1573
+ "annotation_json": {
1574
+ "name": "annotation_json",
1575
+ "type": "jsonb",
1576
+ "primaryKey": false,
1577
+ "notNull": true
1578
+ },
1579
+ "created_at": {
1580
+ "name": "created_at",
1581
+ "type": "timestamp with time zone",
1582
+ "primaryKey": false,
1583
+ "notNull": true
1584
+ },
1585
+ "updated_at": {
1586
+ "name": "updated_at",
1587
+ "type": "timestamp with time zone",
1588
+ "primaryKey": false,
1589
+ "notNull": true
1590
+ }
1591
+ },
1592
+ "indexes": {},
1593
+ "foreignKeys": {
1594
+ "junior_conversation_annotations_conversation_id_fk": {
1595
+ "name": "junior_conversation_annotations_conversation_id_fk",
1596
+ "tableFrom": "junior_conversation_annotations",
1597
+ "tableTo": "junior_conversations",
1598
+ "columnsFrom": [
1599
+ "conversation_id"
1600
+ ],
1601
+ "columnsTo": [
1602
+ "conversation_id"
1603
+ ],
1604
+ "onDelete": "cascade",
1605
+ "onUpdate": "no action"
1606
+ }
1607
+ },
1608
+ "compositePrimaryKeys": {
1609
+ "junior_conversation_annotations_pk": {
1610
+ "name": "junior_conversation_annotations_pk",
1611
+ "columns": [
1612
+ "conversation_id",
1613
+ "plugin",
1614
+ "kind",
1615
+ "key"
1616
+ ]
1617
+ }
1618
+ },
1619
+ "uniqueConstraints": {},
1620
+ "policies": {},
1621
+ "checkConstraints": {},
1622
+ "isRLSEnabled": false
1623
+ },
1624
+ "public.junior_conversation_bindings": {
1625
+ "name": "junior_conversation_bindings",
1626
+ "schema": "",
1627
+ "columns": {
1628
+ "conversation_id": {
1629
+ "name": "conversation_id",
1630
+ "type": "text",
1631
+ "primaryKey": false,
1632
+ "notNull": true
1633
+ },
1634
+ "provider": {
1635
+ "name": "provider",
1636
+ "type": "text",
1637
+ "primaryKey": false,
1638
+ "notNull": true
1639
+ },
1640
+ "provider_tenant_id": {
1641
+ "name": "provider_tenant_id",
1642
+ "type": "text",
1643
+ "primaryKey": false,
1644
+ "notNull": true,
1645
+ "default": "''"
1646
+ },
1647
+ "provider_destination_id": {
1648
+ "name": "provider_destination_id",
1649
+ "type": "text",
1650
+ "primaryKey": false,
1651
+ "notNull": true
1652
+ },
1653
+ "provider_conversation_id": {
1654
+ "name": "provider_conversation_id",
1655
+ "type": "text",
1656
+ "primaryKey": false,
1657
+ "notNull": true
1658
+ },
1659
+ "created_at": {
1660
+ "name": "created_at",
1661
+ "type": "timestamp with time zone",
1662
+ "primaryKey": false,
1663
+ "notNull": true
1664
+ }
1665
+ },
1666
+ "indexes": {
1667
+ "junior_conversation_bindings_conversation_idx": {
1668
+ "name": "junior_conversation_bindings_conversation_idx",
1669
+ "columns": [
1670
+ {
1671
+ "expression": "conversation_id",
1672
+ "isExpression": false,
1673
+ "asc": true,
1674
+ "nulls": "last"
1675
+ }
1676
+ ],
1677
+ "isUnique": false,
1678
+ "concurrently": false,
1679
+ "method": "btree",
1680
+ "with": {}
1681
+ }
1682
+ },
1683
+ "foreignKeys": {
1684
+ "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk": {
1685
+ "name": "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk",
1686
+ "tableFrom": "junior_conversation_bindings",
1687
+ "tableTo": "junior_conversations",
1688
+ "columnsFrom": [
1689
+ "conversation_id"
1690
+ ],
1691
+ "columnsTo": [
1692
+ "conversation_id"
1693
+ ],
1694
+ "onDelete": "no action",
1695
+ "onUpdate": "no action"
1696
+ }
1697
+ },
1698
+ "compositePrimaryKeys": {
1699
+ "junior_conversation_bindings_provider_conversation_pk": {
1700
+ "name": "junior_conversation_bindings_provider_conversation_pk",
1701
+ "columns": [
1702
+ "provider",
1703
+ "provider_tenant_id",
1704
+ "provider_destination_id",
1705
+ "provider_conversation_id"
1706
+ ]
1707
+ }
1708
+ },
1709
+ "uniqueConstraints": {},
1710
+ "policies": {},
1711
+ "checkConstraints": {},
1712
+ "isRLSEnabled": false
1713
+ },
1714
+ "public.junior_conversation_briefs": {
1715
+ "name": "junior_conversation_briefs",
1716
+ "schema": "",
1717
+ "columns": {
1718
+ "conversation_id": {
1719
+ "name": "conversation_id",
1720
+ "type": "text",
1721
+ "primaryKey": false,
1722
+ "notNull": true
1723
+ },
1724
+ "version": {
1725
+ "name": "version",
1726
+ "type": "integer",
1727
+ "primaryKey": false,
1728
+ "notNull": true
1729
+ },
1730
+ "turn_id": {
1731
+ "name": "turn_id",
1732
+ "type": "text",
1733
+ "primaryKey": false,
1734
+ "notNull": true
1735
+ },
1736
+ "through_seq": {
1737
+ "name": "through_seq",
1738
+ "type": "integer",
1739
+ "primaryKey": false,
1740
+ "notNull": true
1741
+ },
1742
+ "content": {
1743
+ "name": "content",
1744
+ "type": "jsonb",
1745
+ "primaryKey": false,
1746
+ "notNull": true
1747
+ },
1748
+ "search_text": {
1749
+ "name": "search_text",
1750
+ "type": "text",
1751
+ "primaryKey": false,
1752
+ "notNull": true
1753
+ },
1754
+ "model_id": {
1755
+ "name": "model_id",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": true
1759
+ },
1760
+ "cost_usd": {
1761
+ "name": "cost_usd",
1762
+ "type": "double precision",
1763
+ "primaryKey": false,
1764
+ "notNull": false
1765
+ },
1766
+ "created_at": {
1767
+ "name": "created_at",
1768
+ "type": "timestamp with time zone",
1769
+ "primaryKey": false,
1770
+ "notNull": true,
1771
+ "default": "now()"
1772
+ }
1773
+ },
1774
+ "indexes": {
1775
+ "junior_conversation_briefs_conversation_turn_idx": {
1776
+ "name": "junior_conversation_briefs_conversation_turn_idx",
1777
+ "columns": [
1778
+ {
1779
+ "expression": "conversation_id",
1780
+ "isExpression": false,
1781
+ "asc": true,
1782
+ "nulls": "last"
1783
+ },
1784
+ {
1785
+ "expression": "turn_id",
1786
+ "isExpression": false,
1787
+ "asc": true,
1788
+ "nulls": "last"
1789
+ }
1790
+ ],
1791
+ "isUnique": true,
1792
+ "concurrently": false,
1793
+ "method": "btree",
1794
+ "with": {}
1795
+ },
1796
+ "junior_conversation_briefs_conversation_version_idx": {
1797
+ "name": "junior_conversation_briefs_conversation_version_idx",
1798
+ "columns": [
1799
+ {
1800
+ "expression": "conversation_id",
1801
+ "isExpression": false,
1802
+ "asc": true,
1803
+ "nulls": "last"
1804
+ },
1805
+ {
1806
+ "expression": "version",
1807
+ "isExpression": false,
1808
+ "asc": false,
1809
+ "nulls": "last"
1810
+ }
1811
+ ],
1812
+ "isUnique": false,
1813
+ "concurrently": false,
1814
+ "method": "btree",
1815
+ "with": {}
1816
+ },
1817
+ "junior_conversation_briefs_search_idx": {
1818
+ "name": "junior_conversation_briefs_search_idx",
1819
+ "columns": [
1820
+ {
1821
+ "expression": "to_tsvector('english', \"search_text\")",
1822
+ "asc": true,
1823
+ "isExpression": true,
1824
+ "nulls": "last"
1825
+ }
1826
+ ],
1827
+ "isUnique": false,
1828
+ "concurrently": false,
1829
+ "method": "gin",
1830
+ "with": {}
1831
+ }
1832
+ },
1833
+ "foreignKeys": {
1834
+ "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk": {
1835
+ "name": "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk",
1836
+ "tableFrom": "junior_conversation_briefs",
1837
+ "tableTo": "junior_conversations",
1838
+ "columnsFrom": [
1839
+ "conversation_id"
1840
+ ],
1841
+ "columnsTo": [
1842
+ "conversation_id"
1843
+ ],
1844
+ "onDelete": "cascade",
1845
+ "onUpdate": "no action"
1846
+ }
1847
+ },
1848
+ "compositePrimaryKeys": {
1849
+ "junior_conversation_briefs_conversation_id_version_pk": {
1850
+ "name": "junior_conversation_briefs_conversation_id_version_pk",
1851
+ "columns": [
1852
+ "conversation_id",
1853
+ "version"
1854
+ ]
1855
+ }
1856
+ },
1857
+ "uniqueConstraints": {},
1858
+ "policies": {},
1859
+ "checkConstraints": {},
1860
+ "isRLSEnabled": false
1861
+ },
1862
+ "public.junior_conversation_events": {
1863
+ "name": "junior_conversation_events",
1864
+ "schema": "",
1865
+ "columns": {
1866
+ "conversation_id": {
1867
+ "name": "conversation_id",
1868
+ "type": "text",
1869
+ "primaryKey": false,
1870
+ "notNull": true
1871
+ },
1872
+ "seq": {
1873
+ "name": "seq",
1874
+ "type": "integer",
1875
+ "primaryKey": false,
1876
+ "notNull": true
1877
+ },
1878
+ "history_version": {
1879
+ "name": "history_version",
1880
+ "type": "integer",
1881
+ "primaryKey": false,
1882
+ "notNull": true
1883
+ },
1884
+ "schema_version": {
1885
+ "name": "schema_version",
1886
+ "type": "integer",
1887
+ "primaryKey": false,
1888
+ "notNull": true,
1889
+ "default": 1
1890
+ },
1891
+ "idempotency_key": {
1892
+ "name": "idempotency_key",
1893
+ "type": "text",
1894
+ "primaryKey": false,
1895
+ "notNull": false
1896
+ },
1897
+ "type": {
1898
+ "name": "type",
1899
+ "type": "text",
1900
+ "primaryKey": false,
1901
+ "notNull": true
1902
+ },
1903
+ "payload": {
1904
+ "name": "payload",
1905
+ "type": "jsonb",
1906
+ "primaryKey": false,
1907
+ "notNull": true
1908
+ },
1909
+ "actor_identity_id": {
1910
+ "name": "actor_identity_id",
1911
+ "type": "text",
1912
+ "primaryKey": false,
1913
+ "notNull": false
1914
+ },
1915
+ "created_at": {
1916
+ "name": "created_at",
1917
+ "type": "timestamp with time zone",
1918
+ "primaryKey": false,
1919
+ "notNull": true
1920
+ }
1921
+ },
1922
+ "indexes": {
1923
+ "junior_conversation_events_history_version_idx": {
1924
+ "name": "junior_conversation_events_history_version_idx",
1925
+ "columns": [
1926
+ {
1927
+ "expression": "conversation_id",
1928
+ "isExpression": false,
1929
+ "asc": true,
1930
+ "nulls": "last"
1931
+ },
1932
+ {
1933
+ "expression": "history_version",
1934
+ "isExpression": false,
1935
+ "asc": true,
1936
+ "nulls": "last"
1937
+ },
1938
+ {
1939
+ "expression": "seq",
1940
+ "isExpression": false,
1941
+ "asc": true,
1942
+ "nulls": "last"
1943
+ }
1944
+ ],
1945
+ "isUnique": false,
1946
+ "concurrently": false,
1947
+ "method": "btree",
1948
+ "with": {}
1949
+ },
1950
+ "junior_conversation_events_type_idx": {
1951
+ "name": "junior_conversation_events_type_idx",
1952
+ "columns": [
1953
+ {
1954
+ "expression": "conversation_id",
1955
+ "isExpression": false,
1956
+ "asc": true,
1957
+ "nulls": "last"
1958
+ },
1959
+ {
1960
+ "expression": "type",
1961
+ "isExpression": false,
1962
+ "asc": true,
1963
+ "nulls": "last"
1964
+ },
1965
+ {
1966
+ "expression": "seq",
1967
+ "isExpression": false,
1968
+ "asc": true,
1969
+ "nulls": "last"
1970
+ }
1971
+ ],
1972
+ "isUnique": false,
1973
+ "concurrently": false,
1974
+ "method": "btree",
1975
+ "with": {}
1976
+ },
1977
+ "junior_conversation_events_plugin_report_idx": {
1978
+ "name": "junior_conversation_events_plugin_report_idx",
1979
+ "columns": [
1980
+ {
1981
+ "expression": "(\"payload\"->>'namespace')",
1982
+ "asc": true,
1983
+ "isExpression": true,
1984
+ "nulls": "last"
1985
+ },
1986
+ {
1987
+ "expression": "(\"payload\"->>'name')",
1988
+ "asc": true,
1989
+ "isExpression": true,
1990
+ "nulls": "last"
1991
+ },
1992
+ {
1993
+ "expression": "created_at",
1994
+ "isExpression": false,
1995
+ "asc": true,
1996
+ "nulls": "last"
1997
+ }
1998
+ ],
1999
+ "isUnique": false,
2000
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
2001
+ "concurrently": false,
2002
+ "method": "btree",
2003
+ "with": {}
2004
+ },
2005
+ "junior_conversation_events_actor_identity_idx": {
2006
+ "name": "junior_conversation_events_actor_identity_idx",
2007
+ "columns": [
2008
+ {
2009
+ "expression": "actor_identity_id",
2010
+ "isExpression": false,
2011
+ "asc": true,
2012
+ "nulls": "last"
2013
+ },
2014
+ {
2015
+ "expression": "conversation_id",
2016
+ "isExpression": false,
2017
+ "asc": true,
2018
+ "nulls": "last"
2019
+ },
2020
+ {
2021
+ "expression": "seq",
2022
+ "isExpression": false,
2023
+ "asc": true,
2024
+ "nulls": "last"
2025
+ }
2026
+ ],
2027
+ "isUnique": false,
2028
+ "concurrently": false,
2029
+ "method": "btree",
2030
+ "with": {}
2031
+ },
2032
+ "junior_conversation_events_message_search_idx": {
2033
+ "name": "junior_conversation_events_message_search_idx",
2034
+ "columns": [
2035
+ {
2036
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
2037
+ "asc": true,
2038
+ "isExpression": true,
2039
+ "nulls": "last"
2040
+ }
2041
+ ],
2042
+ "isUnique": false,
2043
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2044
+ "concurrently": false,
2045
+ "method": "gin",
2046
+ "with": {}
2047
+ },
2048
+ "junior_conversation_events_idempotency_idx": {
2049
+ "name": "junior_conversation_events_idempotency_idx",
2050
+ "columns": [
2051
+ {
2052
+ "expression": "conversation_id",
2053
+ "isExpression": false,
2054
+ "asc": true,
2055
+ "nulls": "last"
2056
+ },
2057
+ {
2058
+ "expression": "idempotency_key",
2059
+ "isExpression": false,
2060
+ "asc": true,
2061
+ "nulls": "last"
2062
+ }
2063
+ ],
2064
+ "isUnique": true,
2065
+ "concurrently": false,
2066
+ "method": "btree",
2067
+ "with": {}
2068
+ }
2069
+ },
2070
+ "foreignKeys": {
2071
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
2072
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
2073
+ "tableFrom": "junior_conversation_events",
2074
+ "tableTo": "junior_identities",
2075
+ "columnsFrom": [
2076
+ "actor_identity_id"
2077
+ ],
2078
+ "columnsTo": [
2079
+ "id"
2080
+ ],
2081
+ "onDelete": "no action",
2082
+ "onUpdate": "no action"
2083
+ },
2084
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
2085
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
2086
+ "tableFrom": "junior_conversation_events",
2087
+ "tableTo": "junior_conversations",
2088
+ "columnsFrom": [
2089
+ "conversation_id"
2090
+ ],
2091
+ "columnsTo": [
2092
+ "conversation_id"
2093
+ ],
2094
+ "onDelete": "no action",
2095
+ "onUpdate": "no action"
2096
+ }
2097
+ },
2098
+ "compositePrimaryKeys": {
2099
+ "junior_conversation_events_conversation_id_seq_pk": {
2100
+ "name": "junior_conversation_events_conversation_id_seq_pk",
2101
+ "columns": [
2102
+ "conversation_id",
2103
+ "seq"
2104
+ ]
2105
+ }
2106
+ },
2107
+ "uniqueConstraints": {},
2108
+ "policies": {},
2109
+ "checkConstraints": {},
2110
+ "isRLSEnabled": false
2111
+ },
2112
+ "public.junior_conversation_metrics": {
2113
+ "name": "junior_conversation_metrics",
2114
+ "schema": "",
2115
+ "columns": {
2116
+ "conversation_id": {
2117
+ "name": "conversation_id",
2118
+ "type": "text",
2119
+ "primaryKey": false,
2120
+ "notNull": true
2121
+ },
2122
+ "run_id": {
2123
+ "name": "run_id",
2124
+ "type": "text",
2125
+ "primaryKey": false,
2126
+ "notNull": true
2127
+ },
2128
+ "metric": {
2129
+ "name": "metric",
2130
+ "type": "text",
2131
+ "primaryKey": false,
2132
+ "notNull": true
2133
+ },
2134
+ "value": {
2135
+ "name": "value",
2136
+ "type": "double precision",
2137
+ "primaryKey": false,
2138
+ "notNull": true
2139
+ },
2140
+ "occurred_at": {
2141
+ "name": "occurred_at",
2142
+ "type": "timestamp with time zone",
2143
+ "primaryKey": false,
2144
+ "notNull": true
2145
+ },
2146
+ "updated_at": {
2147
+ "name": "updated_at",
2148
+ "type": "timestamp with time zone",
2149
+ "primaryKey": false,
2150
+ "notNull": true
2151
+ }
2152
+ },
2153
+ "indexes": {
2154
+ "junior_conversation_metrics_occurred_at_metric_idx": {
2155
+ "name": "junior_conversation_metrics_occurred_at_metric_idx",
2156
+ "columns": [
2157
+ {
2158
+ "expression": "occurred_at",
2159
+ "isExpression": false,
2160
+ "asc": true,
2161
+ "nulls": "last"
2162
+ },
2163
+ {
2164
+ "expression": "metric",
2165
+ "isExpression": false,
2166
+ "asc": true,
2167
+ "nulls": "last"
2168
+ }
2169
+ ],
2170
+ "isUnique": false,
2171
+ "concurrently": false,
2172
+ "method": "btree",
2173
+ "with": {}
2174
+ }
2175
+ },
2176
+ "foreignKeys": {
2177
+ "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk": {
2178
+ "name": "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
2179
+ "tableFrom": "junior_conversation_metrics",
2180
+ "tableTo": "junior_conversations",
2181
+ "columnsFrom": [
2182
+ "conversation_id"
2183
+ ],
2184
+ "columnsTo": [
2185
+ "conversation_id"
2186
+ ],
2187
+ "onDelete": "no action",
2188
+ "onUpdate": "no action"
2189
+ }
2190
+ },
2191
+ "compositePrimaryKeys": {
2192
+ "junior_conversation_metrics_conversation_id_run_id_metric_pk": {
2193
+ "name": "junior_conversation_metrics_conversation_id_run_id_metric_pk",
2194
+ "columns": [
2195
+ "conversation_id",
2196
+ "run_id",
2197
+ "metric"
2198
+ ]
2199
+ }
2200
+ },
2201
+ "uniqueConstraints": {},
2202
+ "policies": {},
2203
+ "checkConstraints": {},
2204
+ "isRLSEnabled": false
2205
+ },
2206
+ "public.junior_conversation_participants": {
2207
+ "name": "junior_conversation_participants",
2208
+ "schema": "",
2209
+ "columns": {
2210
+ "user_id": {
2211
+ "name": "user_id",
2212
+ "type": "text",
2213
+ "primaryKey": false,
2214
+ "notNull": true
2215
+ },
2216
+ "root_conversation_id": {
2217
+ "name": "root_conversation_id",
2218
+ "type": "text",
2219
+ "primaryKey": false,
2220
+ "notNull": true
2221
+ },
2222
+ "last_message_at": {
2223
+ "name": "last_message_at",
2224
+ "type": "timestamp with time zone",
2225
+ "primaryKey": false,
2226
+ "notNull": true
2227
+ },
2228
+ "archived_at": {
2229
+ "name": "archived_at",
2230
+ "type": "timestamp with time zone",
2231
+ "primaryKey": false,
2232
+ "notNull": false
2233
+ }
2234
+ },
2235
+ "indexes": {
2236
+ "junior_conversation_participants_user_activity_idx": {
2237
+ "name": "junior_conversation_participants_user_activity_idx",
2238
+ "columns": [
2239
+ {
2240
+ "expression": "user_id",
2241
+ "isExpression": false,
2242
+ "asc": true,
2243
+ "nulls": "last"
2244
+ },
2245
+ {
2246
+ "expression": "last_message_at",
2247
+ "isExpression": false,
2248
+ "asc": false,
2249
+ "nulls": "last"
2250
+ }
2251
+ ],
2252
+ "isUnique": false,
2253
+ "concurrently": false,
2254
+ "method": "btree",
2255
+ "with": {}
2256
+ },
2257
+ "junior_conversation_participants_root_idx": {
2258
+ "name": "junior_conversation_participants_root_idx",
2259
+ "columns": [
2260
+ {
2261
+ "expression": "root_conversation_id",
2262
+ "isExpression": false,
2263
+ "asc": true,
2264
+ "nulls": "last"
2265
+ }
2266
+ ],
2267
+ "isUnique": false,
2268
+ "concurrently": false,
2269
+ "method": "btree",
2270
+ "with": {}
2271
+ }
2272
+ },
2273
+ "foreignKeys": {
2274
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
2275
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
2276
+ "tableFrom": "junior_conversation_participants",
2277
+ "tableTo": "junior_users",
2278
+ "columnsFrom": [
2279
+ "user_id"
2280
+ ],
2281
+ "columnsTo": [
2282
+ "id"
2283
+ ],
2284
+ "onDelete": "no action",
2285
+ "onUpdate": "no action"
2286
+ },
2287
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
2288
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
2289
+ "tableFrom": "junior_conversation_participants",
2290
+ "tableTo": "junior_conversations",
2291
+ "columnsFrom": [
2292
+ "root_conversation_id"
2293
+ ],
2294
+ "columnsTo": [
2295
+ "conversation_id"
2296
+ ],
2297
+ "onDelete": "no action",
2298
+ "onUpdate": "no action"
2299
+ }
2300
+ },
2301
+ "compositePrimaryKeys": {
2302
+ "junior_conversation_participants_user_root_pk": {
2303
+ "name": "junior_conversation_participants_user_root_pk",
2304
+ "columns": [
2305
+ "user_id",
2306
+ "root_conversation_id"
2307
+ ]
2308
+ }
2309
+ },
2310
+ "uniqueConstraints": {},
2311
+ "policies": {},
2312
+ "checkConstraints": {},
2313
+ "isRLSEnabled": false
2314
+ },
2315
+ "public.junior_conversations": {
2316
+ "name": "junior_conversations",
2317
+ "schema": "",
2318
+ "columns": {
2319
+ "conversation_id": {
2320
+ "name": "conversation_id",
2321
+ "type": "text",
2322
+ "primaryKey": true,
2323
+ "notNull": true
2324
+ },
2325
+ "schema_version": {
2326
+ "name": "schema_version",
2327
+ "type": "integer",
2328
+ "primaryKey": false,
2329
+ "notNull": true,
2330
+ "default": 1
2331
+ },
2332
+ "source": {
2333
+ "name": "source",
2334
+ "type": "text",
2335
+ "primaryKey": false,
2336
+ "notNull": false
2337
+ },
2338
+ "source_json": {
2339
+ "name": "source_json",
2340
+ "type": "jsonb",
2341
+ "primaryKey": false,
2342
+ "notNull": false
2343
+ },
2344
+ "location_json": {
2345
+ "name": "location_json",
2346
+ "type": "jsonb",
2347
+ "primaryKey": false,
2348
+ "notNull": false
2349
+ },
2350
+ "destination_id": {
2351
+ "name": "destination_id",
2352
+ "type": "text",
2353
+ "primaryKey": false,
2354
+ "notNull": false
2355
+ },
2356
+ "destination_json": {
2357
+ "name": "destination_json",
2358
+ "type": "jsonb",
2359
+ "primaryKey": false,
2360
+ "notNull": false
2361
+ },
2362
+ "actor_identity_id": {
2363
+ "name": "actor_identity_id",
2364
+ "type": "text",
2365
+ "primaryKey": false,
2366
+ "notNull": false
2367
+ },
2368
+ "creator_identity_id": {
2369
+ "name": "creator_identity_id",
2370
+ "type": "text",
2371
+ "primaryKey": false,
2372
+ "notNull": false
2373
+ },
2374
+ "credential_subject_identity_id": {
2375
+ "name": "credential_subject_identity_id",
2376
+ "type": "text",
2377
+ "primaryKey": false,
2378
+ "notNull": false
2379
+ },
2380
+ "actor_json": {
2381
+ "name": "actor_json",
2382
+ "type": "jsonb",
2383
+ "primaryKey": false,
2384
+ "notNull": false
2385
+ },
2386
+ "channel_name": {
2387
+ "name": "channel_name",
2388
+ "type": "text",
2389
+ "primaryKey": false,
2390
+ "notNull": false
2391
+ },
2392
+ "title": {
2393
+ "name": "title",
2394
+ "type": "text",
2395
+ "primaryKey": false,
2396
+ "notNull": false
2397
+ },
2398
+ "created_at": {
2399
+ "name": "created_at",
2400
+ "type": "timestamp with time zone",
2401
+ "primaryKey": false,
2402
+ "notNull": true
2403
+ },
2404
+ "last_activity_at": {
2405
+ "name": "last_activity_at",
2406
+ "type": "timestamp with time zone",
2407
+ "primaryKey": false,
2408
+ "notNull": true
2409
+ },
2410
+ "updated_at": {
2411
+ "name": "updated_at",
2412
+ "type": "timestamp with time zone",
2413
+ "primaryKey": false,
2414
+ "notNull": true
2415
+ },
2416
+ "execution_updated_at": {
2417
+ "name": "execution_updated_at",
2418
+ "type": "timestamp with time zone",
2419
+ "primaryKey": false,
2420
+ "notNull": false
2421
+ },
2422
+ "execution_status": {
2423
+ "name": "execution_status",
2424
+ "type": "text",
2425
+ "primaryKey": false,
2426
+ "notNull": true
2427
+ },
2428
+ "run_id": {
2429
+ "name": "run_id",
2430
+ "type": "text",
2431
+ "primaryKey": false,
2432
+ "notNull": false
2433
+ },
2434
+ "last_checkpoint_at": {
2435
+ "name": "last_checkpoint_at",
2436
+ "type": "timestamp with time zone",
2437
+ "primaryKey": false,
2438
+ "notNull": false
2439
+ },
2440
+ "last_enqueued_at": {
2441
+ "name": "last_enqueued_at",
2442
+ "type": "timestamp with time zone",
2443
+ "primaryKey": false,
2444
+ "notNull": false
2445
+ },
2446
+ "parent_conversation_id": {
2447
+ "name": "parent_conversation_id",
2448
+ "type": "text",
2449
+ "primaryKey": false,
2450
+ "notNull": false
2451
+ },
2452
+ "forked_from_conversation_id": {
2453
+ "name": "forked_from_conversation_id",
2454
+ "type": "text",
2455
+ "primaryKey": false,
2456
+ "notNull": false
2457
+ },
2458
+ "root_conversation_id": {
2459
+ "name": "root_conversation_id",
2460
+ "type": "text",
2461
+ "primaryKey": false,
2462
+ "notNull": false
2463
+ },
2464
+ "transcript_purged_at": {
2465
+ "name": "transcript_purged_at",
2466
+ "type": "timestamp with time zone",
2467
+ "primaryKey": false,
2468
+ "notNull": false
2469
+ },
2470
+ "stopped_at": {
2471
+ "name": "stopped_at",
2472
+ "type": "timestamp with time zone",
2473
+ "primaryKey": false,
2474
+ "notNull": false
2475
+ },
2476
+ "duration_ms": {
2477
+ "name": "duration_ms",
2478
+ "type": "integer",
2479
+ "primaryKey": false,
2480
+ "notNull": true,
2481
+ "default": 0
2482
+ },
2483
+ "usage_json": {
2484
+ "name": "usage_json",
2485
+ "type": "jsonb",
2486
+ "primaryKey": false,
2487
+ "notNull": false
2488
+ },
2489
+ "execution_duration_ms": {
2490
+ "name": "execution_duration_ms",
2491
+ "type": "integer",
2492
+ "primaryKey": false,
2493
+ "notNull": true,
2494
+ "default": 0
2495
+ },
2496
+ "execution_usage_json": {
2497
+ "name": "execution_usage_json",
2498
+ "type": "jsonb",
2499
+ "primaryKey": false,
2500
+ "notNull": false
2501
+ },
2502
+ "metric_run_id": {
2503
+ "name": "metric_run_id",
2504
+ "type": "text",
2505
+ "primaryKey": false,
2506
+ "notNull": false
2507
+ },
2508
+ "archived_at": {
2509
+ "name": "archived_at",
2510
+ "type": "timestamp with time zone",
2511
+ "primaryKey": false,
2512
+ "notNull": false
2513
+ }
2514
+ },
2515
+ "indexes": {
2516
+ "junior_conversations_last_activity_idx": {
2517
+ "name": "junior_conversations_last_activity_idx",
2518
+ "columns": [
2519
+ {
2520
+ "expression": "last_activity_at",
2521
+ "isExpression": false,
2522
+ "asc": false,
2523
+ "nulls": "last"
2524
+ },
2525
+ {
2526
+ "expression": "conversation_id",
2527
+ "isExpression": false,
2528
+ "asc": true,
2529
+ "nulls": "last"
2530
+ }
2531
+ ],
2532
+ "isUnique": false,
2533
+ "concurrently": false,
2534
+ "method": "btree",
2535
+ "with": {}
2536
+ },
2537
+ "junior_conversations_active_idx": {
2538
+ "name": "junior_conversations_active_idx",
2539
+ "columns": [
2540
+ {
2541
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
2542
+ "asc": true,
2543
+ "isExpression": true,
2544
+ "nulls": "last"
2545
+ },
2546
+ {
2547
+ "expression": "conversation_id",
2548
+ "isExpression": false,
2549
+ "asc": true,
2550
+ "nulls": "last"
2551
+ }
2552
+ ],
2553
+ "isUnique": false,
2554
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
2555
+ "concurrently": false,
2556
+ "method": "btree",
2557
+ "with": {}
2558
+ },
2559
+ "junior_conversations_destination_activity_idx": {
2560
+ "name": "junior_conversations_destination_activity_idx",
2561
+ "columns": [
2562
+ {
2563
+ "expression": "destination_id",
2564
+ "isExpression": false,
2565
+ "asc": true,
2566
+ "nulls": "last"
2567
+ },
2568
+ {
2569
+ "expression": "last_activity_at",
2570
+ "isExpression": false,
2571
+ "asc": false,
2572
+ "nulls": "last"
2573
+ }
2574
+ ],
2575
+ "isUnique": false,
2576
+ "concurrently": false,
2577
+ "method": "btree",
2578
+ "with": {}
2579
+ },
2580
+ "junior_conversations_actor_activity_idx": {
2581
+ "name": "junior_conversations_actor_activity_idx",
2582
+ "columns": [
2583
+ {
2584
+ "expression": "actor_identity_id",
2585
+ "isExpression": false,
2586
+ "asc": true,
2587
+ "nulls": "last"
2588
+ },
2589
+ {
2590
+ "expression": "last_activity_at",
2591
+ "isExpression": false,
2592
+ "asc": false,
2593
+ "nulls": "last"
2594
+ }
2595
+ ],
2596
+ "isUnique": false,
2597
+ "concurrently": false,
2598
+ "method": "btree",
2599
+ "with": {}
2600
+ },
2601
+ "junior_conversations_parent_idx": {
2602
+ "name": "junior_conversations_parent_idx",
2603
+ "columns": [
2604
+ {
2605
+ "expression": "parent_conversation_id",
2606
+ "isExpression": false,
2607
+ "asc": true,
2608
+ "nulls": "last"
2609
+ }
2610
+ ],
2611
+ "isUnique": false,
2612
+ "concurrently": false,
2613
+ "method": "btree",
2614
+ "with": {}
2615
+ },
2616
+ "junior_conversations_forked_from_idx": {
2617
+ "name": "junior_conversations_forked_from_idx",
2618
+ "columns": [
2619
+ {
2620
+ "expression": "forked_from_conversation_id",
2621
+ "isExpression": false,
2622
+ "asc": true,
2623
+ "nulls": "last"
2624
+ }
2625
+ ],
2626
+ "isUnique": false,
2627
+ "concurrently": false,
2628
+ "method": "btree",
2629
+ "with": {}
2630
+ },
2631
+ "junior_conversations_root_idx": {
2632
+ "name": "junior_conversations_root_idx",
2633
+ "columns": [
2634
+ {
2635
+ "expression": "root_conversation_id",
2636
+ "isExpression": false,
2637
+ "asc": true,
2638
+ "nulls": "last"
2639
+ }
2640
+ ],
2641
+ "isUnique": false,
2642
+ "concurrently": false,
2643
+ "method": "btree",
2644
+ "with": {}
2645
+ }
2646
+ },
2647
+ "foreignKeys": {
2648
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
2649
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
2650
+ "tableFrom": "junior_conversations",
2651
+ "tableTo": "junior_destinations",
2652
+ "columnsFrom": [
2653
+ "destination_id"
2654
+ ],
2655
+ "columnsTo": [
2656
+ "id"
2657
+ ],
2658
+ "onDelete": "no action",
2659
+ "onUpdate": "no action"
2660
+ },
2661
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
2662
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
2663
+ "tableFrom": "junior_conversations",
2664
+ "tableTo": "junior_identities",
2665
+ "columnsFrom": [
2666
+ "actor_identity_id"
2667
+ ],
2668
+ "columnsTo": [
2669
+ "id"
2670
+ ],
2671
+ "onDelete": "no action",
2672
+ "onUpdate": "no action"
2673
+ },
2674
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
2675
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
2676
+ "tableFrom": "junior_conversations",
2677
+ "tableTo": "junior_identities",
2678
+ "columnsFrom": [
2679
+ "creator_identity_id"
2680
+ ],
2681
+ "columnsTo": [
2682
+ "id"
2683
+ ],
2684
+ "onDelete": "no action",
2685
+ "onUpdate": "no action"
2686
+ },
2687
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
2688
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
2689
+ "tableFrom": "junior_conversations",
2690
+ "tableTo": "junior_identities",
2691
+ "columnsFrom": [
2692
+ "credential_subject_identity_id"
2693
+ ],
2694
+ "columnsTo": [
2695
+ "id"
2696
+ ],
2697
+ "onDelete": "no action",
2698
+ "onUpdate": "no action"
2699
+ },
2700
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
2701
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
2702
+ "tableFrom": "junior_conversations",
2703
+ "tableTo": "junior_conversations",
2704
+ "columnsFrom": [
2705
+ "parent_conversation_id"
2706
+ ],
2707
+ "columnsTo": [
2708
+ "conversation_id"
2709
+ ],
2710
+ "onDelete": "no action",
2711
+ "onUpdate": "no action"
2712
+ },
2713
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
2714
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
2715
+ "tableFrom": "junior_conversations",
2716
+ "tableTo": "junior_conversations",
2717
+ "columnsFrom": [
2718
+ "forked_from_conversation_id"
2719
+ ],
2720
+ "columnsTo": [
2721
+ "conversation_id"
2722
+ ],
2723
+ "onDelete": "set null",
2724
+ "onUpdate": "no action"
2725
+ },
2726
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
2727
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
2728
+ "tableFrom": "junior_conversations",
2729
+ "tableTo": "junior_conversations",
2730
+ "columnsFrom": [
2731
+ "root_conversation_id"
2732
+ ],
2733
+ "columnsTo": [
2734
+ "conversation_id"
2735
+ ],
2736
+ "onDelete": "no action",
2737
+ "onUpdate": "no action"
2738
+ }
2739
+ },
2740
+ "compositePrimaryKeys": {},
2741
+ "uniqueConstraints": {},
2742
+ "policies": {},
2743
+ "checkConstraints": {},
2744
+ "isRLSEnabled": false
2745
+ },
2746
+ "public.junior_destinations": {
2747
+ "name": "junior_destinations",
2748
+ "schema": "",
2749
+ "columns": {
2750
+ "id": {
2751
+ "name": "id",
2752
+ "type": "text",
2753
+ "primaryKey": true,
2754
+ "notNull": true
2755
+ },
2756
+ "provider": {
2757
+ "name": "provider",
2758
+ "type": "text",
2759
+ "primaryKey": false,
2760
+ "notNull": true
2761
+ },
2762
+ "provider_tenant_id": {
2763
+ "name": "provider_tenant_id",
2764
+ "type": "text",
2765
+ "primaryKey": false,
2766
+ "notNull": true,
2767
+ "default": "''"
2768
+ },
2769
+ "provider_destination_id": {
2770
+ "name": "provider_destination_id",
2771
+ "type": "text",
2772
+ "primaryKey": false,
2773
+ "notNull": true
2774
+ },
2775
+ "kind": {
2776
+ "name": "kind",
2777
+ "type": "text",
2778
+ "primaryKey": false,
2779
+ "notNull": true
2780
+ },
2781
+ "parent_destination_id": {
2782
+ "name": "parent_destination_id",
2783
+ "type": "text",
2784
+ "primaryKey": false,
2785
+ "notNull": false
2786
+ },
2787
+ "display_name": {
2788
+ "name": "display_name",
2789
+ "type": "text",
2790
+ "primaryKey": false,
2791
+ "notNull": false
2792
+ },
2793
+ "visibility": {
2794
+ "name": "visibility",
2795
+ "type": "text",
2796
+ "primaryKey": false,
2797
+ "notNull": true,
2798
+ "default": "'unknown'"
2799
+ },
2800
+ "metadata_json": {
2801
+ "name": "metadata_json",
2802
+ "type": "jsonb",
2803
+ "primaryKey": false,
2804
+ "notNull": false
2805
+ },
2806
+ "created_at": {
2807
+ "name": "created_at",
2808
+ "type": "timestamp with time zone",
2809
+ "primaryKey": false,
2810
+ "notNull": true
2811
+ },
2812
+ "updated_at": {
2813
+ "name": "updated_at",
2814
+ "type": "timestamp with time zone",
2815
+ "primaryKey": false,
2816
+ "notNull": true
2817
+ }
2818
+ },
2819
+ "indexes": {
2820
+ "junior_destinations_provider_destination_uidx": {
2821
+ "name": "junior_destinations_provider_destination_uidx",
2822
+ "columns": [
2823
+ {
2824
+ "expression": "provider",
2825
+ "isExpression": false,
2826
+ "asc": true,
2827
+ "nulls": "last"
2828
+ },
2829
+ {
2830
+ "expression": "provider_tenant_id",
2831
+ "isExpression": false,
2832
+ "asc": true,
2833
+ "nulls": "last"
2834
+ },
2835
+ {
2836
+ "expression": "provider_destination_id",
2837
+ "isExpression": false,
2838
+ "asc": true,
2839
+ "nulls": "last"
2840
+ }
2841
+ ],
2842
+ "isUnique": true,
2843
+ "concurrently": false,
2844
+ "method": "btree",
2845
+ "with": {}
2846
+ },
2847
+ "junior_destinations_provider_kind_idx": {
2848
+ "name": "junior_destinations_provider_kind_idx",
2849
+ "columns": [
2850
+ {
2851
+ "expression": "provider",
2852
+ "isExpression": false,
2853
+ "asc": true,
2854
+ "nulls": "last"
2855
+ },
2856
+ {
2857
+ "expression": "kind",
2858
+ "isExpression": false,
2859
+ "asc": true,
2860
+ "nulls": "last"
2861
+ }
2862
+ ],
2863
+ "isUnique": false,
2864
+ "concurrently": false,
2865
+ "method": "btree",
2866
+ "with": {}
2867
+ }
2868
+ },
2869
+ "foreignKeys": {},
2870
+ "compositePrimaryKeys": {},
2871
+ "uniqueConstraints": {},
2872
+ "policies": {},
2873
+ "checkConstraints": {},
2874
+ "isRLSEnabled": false
2875
+ },
2876
+ "public.junior_identities": {
2877
+ "name": "junior_identities",
2878
+ "schema": "",
2879
+ "columns": {
2880
+ "id": {
2881
+ "name": "id",
2882
+ "type": "text",
2883
+ "primaryKey": true,
2884
+ "notNull": true
2885
+ },
2886
+ "kind": {
2887
+ "name": "kind",
2888
+ "type": "text",
2889
+ "primaryKey": false,
2890
+ "notNull": true
2891
+ },
2892
+ "provider": {
2893
+ "name": "provider",
2894
+ "type": "text",
2895
+ "primaryKey": false,
2896
+ "notNull": true
2897
+ },
2898
+ "provider_tenant_id": {
2899
+ "name": "provider_tenant_id",
2900
+ "type": "text",
2901
+ "primaryKey": false,
2902
+ "notNull": true,
2903
+ "default": "''"
2904
+ },
2905
+ "provider_subject_id": {
2906
+ "name": "provider_subject_id",
2907
+ "type": "text",
2908
+ "primaryKey": false,
2909
+ "notNull": true
2910
+ },
2911
+ "display_name": {
2912
+ "name": "display_name",
2913
+ "type": "text",
2914
+ "primaryKey": false,
2915
+ "notNull": false
2916
+ },
2917
+ "handle": {
2918
+ "name": "handle",
2919
+ "type": "text",
2920
+ "primaryKey": false,
2921
+ "notNull": false
2922
+ },
2923
+ "email": {
2924
+ "name": "email",
2925
+ "type": "text",
2926
+ "primaryKey": false,
2927
+ "notNull": false
2928
+ },
2929
+ "avatar_url": {
2930
+ "name": "avatar_url",
2931
+ "type": "text",
2932
+ "primaryKey": false,
2933
+ "notNull": false
2934
+ },
2935
+ "metadata_json": {
2936
+ "name": "metadata_json",
2937
+ "type": "jsonb",
2938
+ "primaryKey": false,
2939
+ "notNull": false
2940
+ },
2941
+ "created_at": {
2942
+ "name": "created_at",
2943
+ "type": "timestamp with time zone",
2944
+ "primaryKey": false,
2945
+ "notNull": true
2946
+ },
2947
+ "updated_at": {
2948
+ "name": "updated_at",
2949
+ "type": "timestamp with time zone",
2950
+ "primaryKey": false,
2951
+ "notNull": true
2952
+ },
2953
+ "user_id": {
2954
+ "name": "user_id",
2955
+ "type": "text",
2956
+ "primaryKey": false,
2957
+ "notNull": false
2958
+ },
2959
+ "email_normalized": {
2960
+ "name": "email_normalized",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": false
2964
+ },
2965
+ "email_verified": {
2966
+ "name": "email_verified",
2967
+ "type": "boolean",
2968
+ "primaryKey": false,
2969
+ "notNull": true,
2970
+ "default": false
2971
+ },
2972
+ "signed_in_at": {
2973
+ "name": "signed_in_at",
2974
+ "type": "timestamp with time zone",
2975
+ "primaryKey": false,
2976
+ "notNull": false
2977
+ }
2978
+ },
2979
+ "indexes": {
2980
+ "junior_identities_provider_subject_uidx": {
2981
+ "name": "junior_identities_provider_subject_uidx",
2982
+ "columns": [
2983
+ {
2984
+ "expression": "provider",
2985
+ "isExpression": false,
2986
+ "asc": true,
2987
+ "nulls": "last"
2988
+ },
2989
+ {
2990
+ "expression": "provider_tenant_id",
2991
+ "isExpression": false,
2992
+ "asc": true,
2993
+ "nulls": "last"
2994
+ },
2995
+ {
2996
+ "expression": "provider_subject_id",
2997
+ "isExpression": false,
2998
+ "asc": true,
2999
+ "nulls": "last"
3000
+ }
3001
+ ],
3002
+ "isUnique": true,
3003
+ "concurrently": false,
3004
+ "method": "btree",
3005
+ "with": {}
3006
+ },
3007
+ "junior_identities_user_idx": {
3008
+ "name": "junior_identities_user_idx",
3009
+ "columns": [
3010
+ {
3011
+ "expression": "user_id",
3012
+ "isExpression": false,
3013
+ "asc": true,
3014
+ "nulls": "last"
3015
+ }
3016
+ ],
3017
+ "isUnique": false,
3018
+ "concurrently": false,
3019
+ "method": "btree",
3020
+ "with": {}
3021
+ },
3022
+ "junior_identities_verified_email_idx": {
3023
+ "name": "junior_identities_verified_email_idx",
3024
+ "columns": [
3025
+ {
3026
+ "expression": "email_normalized",
3027
+ "isExpression": false,
3028
+ "asc": true,
3029
+ "nulls": "last"
3030
+ }
3031
+ ],
3032
+ "isUnique": false,
3033
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
3034
+ "concurrently": false,
3035
+ "method": "btree",
3036
+ "with": {}
3037
+ },
3038
+ "junior_identities_kind_provider_idx": {
3039
+ "name": "junior_identities_kind_provider_idx",
3040
+ "columns": [
3041
+ {
3042
+ "expression": "kind",
3043
+ "isExpression": false,
3044
+ "asc": true,
3045
+ "nulls": "last"
3046
+ },
3047
+ {
3048
+ "expression": "provider",
3049
+ "isExpression": false,
3050
+ "asc": true,
3051
+ "nulls": "last"
3052
+ }
3053
+ ],
3054
+ "isUnique": false,
3055
+ "concurrently": false,
3056
+ "method": "btree",
3057
+ "with": {}
3058
+ }
3059
+ },
3060
+ "foreignKeys": {
3061
+ "junior_identities_user_id_junior_users_id_fk": {
3062
+ "name": "junior_identities_user_id_junior_users_id_fk",
3063
+ "tableFrom": "junior_identities",
3064
+ "tableTo": "junior_users",
3065
+ "columnsFrom": [
3066
+ "user_id"
3067
+ ],
3068
+ "columnsTo": [
3069
+ "id"
3070
+ ],
3071
+ "onDelete": "no action",
3072
+ "onUpdate": "no action"
3073
+ }
3074
+ },
3075
+ "compositePrimaryKeys": {},
3076
+ "uniqueConstraints": {},
3077
+ "policies": {},
3078
+ "checkConstraints": {},
3079
+ "isRLSEnabled": false
3080
+ },
3081
+ "public.junior_location_configurations": {
3082
+ "name": "junior_location_configurations",
3083
+ "schema": "",
3084
+ "columns": {
3085
+ "location_id": {
3086
+ "name": "location_id",
3087
+ "type": "text",
3088
+ "primaryKey": false,
3089
+ "notNull": true
3090
+ },
3091
+ "key": {
3092
+ "name": "key",
3093
+ "type": "text",
3094
+ "primaryKey": false,
3095
+ "notNull": true
3096
+ },
3097
+ "value": {
3098
+ "name": "value",
3099
+ "type": "text",
3100
+ "primaryKey": false,
3101
+ "notNull": true
3102
+ },
3103
+ "updated_at": {
3104
+ "name": "updated_at",
3105
+ "type": "timestamp with time zone",
3106
+ "primaryKey": false,
3107
+ "notNull": true
3108
+ },
3109
+ "updated_by": {
3110
+ "name": "updated_by",
3111
+ "type": "text",
3112
+ "primaryKey": false,
3113
+ "notNull": false
3114
+ },
3115
+ "source": {
3116
+ "name": "source",
3117
+ "type": "text",
3118
+ "primaryKey": false,
3119
+ "notNull": false
3120
+ },
3121
+ "expires_at": {
3122
+ "name": "expires_at",
3123
+ "type": "text",
3124
+ "primaryKey": false,
3125
+ "notNull": false
3126
+ }
3127
+ },
3128
+ "indexes": {},
3129
+ "foreignKeys": {
3130
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3131
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3132
+ "tableFrom": "junior_location_configurations",
3133
+ "tableTo": "junior_destinations",
3134
+ "columnsFrom": [
3135
+ "location_id"
3136
+ ],
3137
+ "columnsTo": [
3138
+ "id"
3139
+ ],
3140
+ "onDelete": "cascade",
3141
+ "onUpdate": "no action"
3142
+ }
3143
+ },
3144
+ "compositePrimaryKeys": {
3145
+ "junior_location_configurations_location_id_key_pk": {
3146
+ "name": "junior_location_configurations_location_id_key_pk",
3147
+ "columns": [
3148
+ "location_id",
3149
+ "key"
3150
+ ]
3151
+ }
3152
+ },
3153
+ "uniqueConstraints": {},
3154
+ "policies": {},
3155
+ "checkConstraints": {},
3156
+ "isRLSEnabled": false
3157
+ },
3158
+ "public.junior_review_item_assignees": {
3159
+ "name": "junior_review_item_assignees",
3160
+ "schema": "",
3161
+ "columns": {
3162
+ "item_id": {
3163
+ "name": "item_id",
3164
+ "type": "text",
3165
+ "primaryKey": false,
3166
+ "notNull": true
3167
+ },
3168
+ "user_id": {
3169
+ "name": "user_id",
3170
+ "type": "text",
3171
+ "primaryKey": false,
3172
+ "notNull": true
3173
+ }
3174
+ },
3175
+ "indexes": {
3176
+ "junior_review_item_assignees_user_idx": {
3177
+ "name": "junior_review_item_assignees_user_idx",
3178
+ "columns": [
3179
+ {
3180
+ "expression": "user_id",
3181
+ "isExpression": false,
3182
+ "asc": true,
3183
+ "nulls": "last"
3184
+ }
3185
+ ],
3186
+ "isUnique": false,
3187
+ "concurrently": false,
3188
+ "method": "btree",
3189
+ "with": {}
3190
+ }
3191
+ },
3192
+ "foreignKeys": {
3193
+ "junior_review_item_assignees_item_id_junior_review_items_id_fk": {
3194
+ "name": "junior_review_item_assignees_item_id_junior_review_items_id_fk",
3195
+ "tableFrom": "junior_review_item_assignees",
3196
+ "tableTo": "junior_review_items",
3197
+ "columnsFrom": [
3198
+ "item_id"
3199
+ ],
3200
+ "columnsTo": [
3201
+ "id"
3202
+ ],
3203
+ "onDelete": "cascade",
3204
+ "onUpdate": "no action"
3205
+ },
3206
+ "junior_review_item_assignees_user_id_junior_users_id_fk": {
3207
+ "name": "junior_review_item_assignees_user_id_junior_users_id_fk",
3208
+ "tableFrom": "junior_review_item_assignees",
3209
+ "tableTo": "junior_users",
3210
+ "columnsFrom": [
3211
+ "user_id"
3212
+ ],
3213
+ "columnsTo": [
3214
+ "id"
3215
+ ],
3216
+ "onDelete": "cascade",
3217
+ "onUpdate": "no action"
3218
+ }
3219
+ },
3220
+ "compositePrimaryKeys": {
3221
+ "junior_review_item_assignees_item_id_user_id_pk": {
3222
+ "name": "junior_review_item_assignees_item_id_user_id_pk",
3223
+ "columns": [
3224
+ "item_id",
3225
+ "user_id"
3226
+ ]
3227
+ }
3228
+ },
3229
+ "uniqueConstraints": {},
3230
+ "policies": {},
3231
+ "checkConstraints": {},
3232
+ "isRLSEnabled": false
3233
+ },
3234
+ "public.junior_review_item_conversations": {
3235
+ "name": "junior_review_item_conversations",
3236
+ "schema": "",
3237
+ "columns": {
3238
+ "item_id": {
3239
+ "name": "item_id",
3240
+ "type": "text",
3241
+ "primaryKey": false,
3242
+ "notNull": true
3243
+ },
3244
+ "conversation_id": {
3245
+ "name": "conversation_id",
3246
+ "type": "text",
3247
+ "primaryKey": false,
3248
+ "notNull": true
3249
+ }
3250
+ },
3251
+ "indexes": {
3252
+ "junior_review_item_conversations_conversation_idx": {
3253
+ "name": "junior_review_item_conversations_conversation_idx",
3254
+ "columns": [
3255
+ {
3256
+ "expression": "conversation_id",
3257
+ "isExpression": false,
3258
+ "asc": true,
3259
+ "nulls": "last"
3260
+ }
3261
+ ],
3262
+ "isUnique": false,
3263
+ "concurrently": false,
3264
+ "method": "btree",
3265
+ "with": {}
3266
+ }
3267
+ },
3268
+ "foreignKeys": {
3269
+ "junior_review_item_conversations_item_id_junior_review_items_id_fk": {
3270
+ "name": "junior_review_item_conversations_item_id_junior_review_items_id_fk",
3271
+ "tableFrom": "junior_review_item_conversations",
3272
+ "tableTo": "junior_review_items",
3273
+ "columnsFrom": [
3274
+ "item_id"
3275
+ ],
3276
+ "columnsTo": [
3277
+ "id"
3278
+ ],
3279
+ "onDelete": "cascade",
3280
+ "onUpdate": "no action"
3281
+ },
3282
+ "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk": {
3283
+ "name": "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk",
3284
+ "tableFrom": "junior_review_item_conversations",
3285
+ "tableTo": "junior_conversations",
3286
+ "columnsFrom": [
3287
+ "conversation_id"
3288
+ ],
3289
+ "columnsTo": [
3290
+ "conversation_id"
3291
+ ],
3292
+ "onDelete": "cascade",
3293
+ "onUpdate": "no action"
3294
+ }
3295
+ },
3296
+ "compositePrimaryKeys": {
3297
+ "junior_review_item_conversations_item_id_conversation_id_pk": {
3298
+ "name": "junior_review_item_conversations_item_id_conversation_id_pk",
3299
+ "columns": [
3300
+ "item_id",
3301
+ "conversation_id"
3302
+ ]
3303
+ }
3304
+ },
3305
+ "uniqueConstraints": {},
3306
+ "policies": {},
3307
+ "checkConstraints": {},
3308
+ "isRLSEnabled": false
3309
+ },
3310
+ "public.junior_review_item_slack_cards": {
3311
+ "name": "junior_review_item_slack_cards",
3312
+ "schema": "",
3313
+ "columns": {
3314
+ "item_id": {
3315
+ "name": "item_id",
3316
+ "type": "text",
3317
+ "primaryKey": false,
3318
+ "notNull": true
3319
+ },
3320
+ "conversation_id": {
3321
+ "name": "conversation_id",
3322
+ "type": "text",
3323
+ "primaryKey": false,
3324
+ "notNull": true
3325
+ },
3326
+ "team_id": {
3327
+ "name": "team_id",
3328
+ "type": "text",
3329
+ "primaryKey": false,
3330
+ "notNull": true
3331
+ },
3332
+ "channel_id": {
3333
+ "name": "channel_id",
3334
+ "type": "text",
3335
+ "primaryKey": false,
3336
+ "notNull": true
3337
+ },
3338
+ "message_ts": {
3339
+ "name": "message_ts",
3340
+ "type": "text",
3341
+ "primaryKey": false,
3342
+ "notNull": true
3343
+ }
3344
+ },
3345
+ "indexes": {},
3346
+ "foreignKeys": {
3347
+ "junior_review_item_slack_cards_item_id_junior_review_items_id_fk": {
3348
+ "name": "junior_review_item_slack_cards_item_id_junior_review_items_id_fk",
3349
+ "tableFrom": "junior_review_item_slack_cards",
3350
+ "tableTo": "junior_review_items",
3351
+ "columnsFrom": [
3352
+ "item_id"
3353
+ ],
3354
+ "columnsTo": [
3355
+ "id"
3356
+ ],
3357
+ "onDelete": "cascade",
3358
+ "onUpdate": "no action"
3359
+ }
3360
+ },
3361
+ "compositePrimaryKeys": {
3362
+ "junior_review_item_slack_cards_item_id_conversation_id_pk": {
3363
+ "name": "junior_review_item_slack_cards_item_id_conversation_id_pk",
3364
+ "columns": [
3365
+ "item_id",
3366
+ "conversation_id"
3367
+ ]
3368
+ }
3369
+ },
3370
+ "uniqueConstraints": {},
3371
+ "policies": {},
3372
+ "checkConstraints": {},
3373
+ "isRLSEnabled": false
3374
+ },
3375
+ "public.junior_review_items": {
3376
+ "name": "junior_review_items",
3377
+ "schema": "",
3378
+ "columns": {
3379
+ "id": {
3380
+ "name": "id",
3381
+ "type": "text",
3382
+ "primaryKey": true,
3383
+ "notNull": true
3384
+ },
3385
+ "kind": {
3386
+ "name": "kind",
3387
+ "type": "text",
3388
+ "primaryKey": false,
3389
+ "notNull": true
3390
+ },
3391
+ "status": {
3392
+ "name": "status",
3393
+ "type": "text",
3394
+ "primaryKey": false,
3395
+ "notNull": true
3396
+ },
3397
+ "visibility": {
3398
+ "name": "visibility",
3399
+ "type": "text",
3400
+ "primaryKey": false,
3401
+ "notNull": true
3402
+ },
3403
+ "title": {
3404
+ "name": "title",
3405
+ "type": "text",
3406
+ "primaryKey": false,
3407
+ "notNull": true
3408
+ },
3409
+ "body": {
3410
+ "name": "body",
3411
+ "type": "text",
3412
+ "primaryKey": false,
3413
+ "notNull": true
3414
+ },
3415
+ "request": {
3416
+ "name": "request",
3417
+ "type": "jsonb",
3418
+ "primaryKey": false,
3419
+ "notNull": false
3420
+ },
3421
+ "answer": {
3422
+ "name": "answer",
3423
+ "type": "jsonb",
3424
+ "primaryKey": false,
3425
+ "notNull": false
3426
+ },
3427
+ "assigned_to_everyone": {
3428
+ "name": "assigned_to_everyone",
3429
+ "type": "boolean",
3430
+ "primaryKey": false,
3431
+ "notNull": true,
3432
+ "default": false
3433
+ },
3434
+ "dedupe_key": {
3435
+ "name": "dedupe_key",
3436
+ "type": "text",
3437
+ "primaryKey": false,
3438
+ "notNull": true
3439
+ },
3440
+ "subject_id": {
3441
+ "name": "subject_id",
3442
+ "type": "text",
3443
+ "primaryKey": false,
3444
+ "notNull": false
3445
+ },
3446
+ "subject_title": {
3447
+ "name": "subject_title",
3448
+ "type": "text",
3449
+ "primaryKey": false,
3450
+ "notNull": false
3451
+ },
3452
+ "subject_url": {
3453
+ "name": "subject_url",
3454
+ "type": "text",
3455
+ "primaryKey": false,
3456
+ "notNull": false
3457
+ },
3458
+ "added_by_conversation_id": {
3459
+ "name": "added_by_conversation_id",
3460
+ "type": "text",
3461
+ "primaryKey": false,
3462
+ "notNull": true
3463
+ },
3464
+ "provider": {
3465
+ "name": "provider",
3466
+ "type": "text",
3467
+ "primaryKey": false,
3468
+ "notNull": false
3469
+ },
3470
+ "provider_tenant_id": {
3471
+ "name": "provider_tenant_id",
3472
+ "type": "text",
3473
+ "primaryKey": false,
3474
+ "notNull": false
3475
+ },
3476
+ "automation_id": {
3477
+ "name": "automation_id",
3478
+ "type": "text",
3479
+ "primaryKey": false,
3480
+ "notNull": false
3481
+ },
3482
+ "closed_at": {
3483
+ "name": "closed_at",
3484
+ "type": "timestamp with time zone",
3485
+ "primaryKey": false,
3486
+ "notNull": false
3487
+ },
3488
+ "closed_by_user_id": {
3489
+ "name": "closed_by_user_id",
3490
+ "type": "text",
3491
+ "primaryKey": false,
3492
+ "notNull": false
3493
+ },
3494
+ "close_reason": {
3495
+ "name": "close_reason",
3496
+ "type": "text",
3497
+ "primaryKey": false,
3498
+ "notNull": false
3499
+ },
3500
+ "created_at": {
3501
+ "name": "created_at",
3502
+ "type": "timestamp with time zone",
3503
+ "primaryKey": false,
3504
+ "notNull": true
3505
+ },
3506
+ "updated_at": {
3507
+ "name": "updated_at",
3508
+ "type": "timestamp with time zone",
3509
+ "primaryKey": false,
3510
+ "notNull": true
3511
+ }
3512
+ },
3513
+ "indexes": {
3514
+ "junior_review_items_open_dedupe_uidx": {
3515
+ "name": "junior_review_items_open_dedupe_uidx",
3516
+ "columns": [
3517
+ {
3518
+ "expression": "coalesce(\"provider\", '')",
3519
+ "asc": true,
3520
+ "isExpression": true,
3521
+ "nulls": "last"
3522
+ },
3523
+ {
3524
+ "expression": "coalesce(\"provider_tenant_id\", '')",
3525
+ "asc": true,
3526
+ "isExpression": true,
3527
+ "nulls": "last"
3528
+ },
3529
+ {
3530
+ "expression": "dedupe_key",
3531
+ "isExpression": false,
3532
+ "asc": true,
3533
+ "nulls": "last"
3534
+ }
3535
+ ],
3536
+ "isUnique": true,
3537
+ "where": "\"junior_review_items\".\"status\" = 'open'",
3538
+ "concurrently": false,
3539
+ "method": "btree",
3540
+ "with": {}
3541
+ },
3542
+ "junior_review_items_status_idx": {
3543
+ "name": "junior_review_items_status_idx",
3544
+ "columns": [
3545
+ {
3546
+ "expression": "status",
3547
+ "isExpression": false,
3548
+ "asc": true,
3549
+ "nulls": "last"
3550
+ },
3551
+ {
3552
+ "expression": "updated_at",
3553
+ "isExpression": false,
3554
+ "asc": true,
3555
+ "nulls": "last"
3556
+ },
3557
+ {
3558
+ "expression": "id",
3559
+ "isExpression": false,
3560
+ "asc": true,
3561
+ "nulls": "last"
3562
+ }
3563
+ ],
3564
+ "isUnique": false,
3565
+ "concurrently": false,
3566
+ "method": "btree",
3567
+ "with": {}
3568
+ },
3569
+ "junior_review_items_subject_idx": {
3570
+ "name": "junior_review_items_subject_idx",
3571
+ "columns": [
3572
+ {
3573
+ "expression": "subject_id",
3574
+ "isExpression": false,
3575
+ "asc": true,
3576
+ "nulls": "last"
3577
+ },
3578
+ {
3579
+ "expression": "status",
3580
+ "isExpression": false,
3581
+ "asc": true,
3582
+ "nulls": "last"
3583
+ }
3584
+ ],
3585
+ "isUnique": false,
3586
+ "concurrently": false,
3587
+ "method": "btree",
3588
+ "with": {}
3589
+ },
3590
+ "junior_review_items_automation_idx": {
3591
+ "name": "junior_review_items_automation_idx",
3592
+ "columns": [
3593
+ {
3594
+ "expression": "automation_id",
3595
+ "isExpression": false,
3596
+ "asc": true,
3597
+ "nulls": "last"
3598
+ },
3599
+ {
3600
+ "expression": "status",
3601
+ "isExpression": false,
3602
+ "asc": true,
3603
+ "nulls": "last"
3604
+ }
3605
+ ],
3606
+ "isUnique": false,
3607
+ "concurrently": false,
3608
+ "method": "btree",
3609
+ "with": {}
3610
+ }
3611
+ },
3612
+ "foreignKeys": {
3613
+ "junior_review_items_automation_id_junior_automations_id_fk": {
3614
+ "name": "junior_review_items_automation_id_junior_automations_id_fk",
3615
+ "tableFrom": "junior_review_items",
3616
+ "tableTo": "junior_automations",
3617
+ "columnsFrom": [
3618
+ "automation_id"
3619
+ ],
3620
+ "columnsTo": [
3621
+ "id"
3622
+ ],
3623
+ "onDelete": "set null",
3624
+ "onUpdate": "no action"
3625
+ },
3626
+ "junior_review_items_closed_by_user_id_junior_users_id_fk": {
3627
+ "name": "junior_review_items_closed_by_user_id_junior_users_id_fk",
3628
+ "tableFrom": "junior_review_items",
3629
+ "tableTo": "junior_users",
3630
+ "columnsFrom": [
3631
+ "closed_by_user_id"
3632
+ ],
3633
+ "columnsTo": [
3634
+ "id"
3635
+ ],
3636
+ "onDelete": "no action",
3637
+ "onUpdate": "no action"
3638
+ }
3639
+ },
3640
+ "compositePrimaryKeys": {},
3641
+ "uniqueConstraints": {},
3642
+ "policies": {},
3643
+ "checkConstraints": {
3644
+ "junior_review_items_kind_check": {
3645
+ "name": "junior_review_items_kind_check",
3646
+ "value": "(\"junior_review_items\".\"kind\" = 'notice' and \"junior_review_items\".\"request\" is null and \"junior_review_items\".\"answer\" is null) or (\"junior_review_items\".\"kind\" = 'action' and \"junior_review_items\".\"request\" is not null)"
3647
+ },
3648
+ "junior_review_items_status_check": {
3649
+ "name": "junior_review_items_status_check",
3650
+ "value": "(\"junior_review_items\".\"status\" = 'open' and \"junior_review_items\".\"closed_at\" is null) or (\"junior_review_items\".\"status\" in ('done', 'dismissed') and \"junior_review_items\".\"closed_at\" is not null)"
3651
+ },
3652
+ "junior_review_items_tenant_check": {
3653
+ "name": "junior_review_items_tenant_check",
3654
+ "value": "(\"junior_review_items\".\"provider\" is null) = (\"junior_review_items\".\"provider_tenant_id\" is null)"
3655
+ },
3656
+ "junior_review_items_visibility_check": {
3657
+ "name": "junior_review_items_visibility_check",
3658
+ "value": "\"junior_review_items\".\"visibility\" = 'public' or not \"junior_review_items\".\"assigned_to_everyone\""
3659
+ }
3660
+ },
3661
+ "isRLSEnabled": false
3662
+ },
3663
+ "public.junior_snapshots": {
3664
+ "name": "junior_snapshots",
3665
+ "schema": "",
3666
+ "columns": {
3667
+ "id": {
3668
+ "name": "id",
3669
+ "type": "text",
3670
+ "primaryKey": true,
3671
+ "notNull": true
3672
+ },
3673
+ "workspace_id": {
3674
+ "name": "workspace_id",
3675
+ "type": "text",
3676
+ "primaryKey": false,
3677
+ "notNull": true
3678
+ },
3679
+ "profile_hash": {
3680
+ "name": "profile_hash",
3681
+ "type": "text",
3682
+ "primaryKey": false,
3683
+ "notNull": true
3684
+ },
3685
+ "status": {
3686
+ "name": "status",
3687
+ "type": "text",
3688
+ "primaryKey": false,
3689
+ "notNull": true
3690
+ },
3691
+ "snapshot_id": {
3692
+ "name": "snapshot_id",
3693
+ "type": "text",
3694
+ "primaryKey": false,
3695
+ "notNull": false
3696
+ },
3697
+ "build_duration_ms": {
3698
+ "name": "build_duration_ms",
3699
+ "type": "integer",
3700
+ "primaryKey": false,
3701
+ "notNull": false
3702
+ },
3703
+ "size_bytes": {
3704
+ "name": "size_bytes",
3705
+ "type": "bigint",
3706
+ "primaryKey": false,
3707
+ "notNull": false
3708
+ },
3709
+ "generated_at": {
3710
+ "name": "generated_at",
3711
+ "type": "timestamp with time zone",
3712
+ "primaryKey": false,
3713
+ "notNull": false
3714
+ },
3715
+ "build_started_at": {
3716
+ "name": "build_started_at",
3717
+ "type": "timestamp with time zone",
3718
+ "primaryKey": false,
3719
+ "notNull": false
3720
+ },
3721
+ "build_phase": {
3722
+ "name": "build_phase",
3723
+ "type": "text",
3724
+ "primaryKey": false,
3725
+ "notNull": false
3726
+ },
3727
+ "build_sandbox_name": {
3728
+ "name": "build_sandbox_name",
3729
+ "type": "text",
3730
+ "primaryKey": false,
3731
+ "notNull": false
3732
+ },
3733
+ "build_command_id": {
3734
+ "name": "build_command_id",
3735
+ "type": "text",
3736
+ "primaryKey": false,
3737
+ "notNull": false
3738
+ },
3739
+ "build_error": {
3740
+ "name": "build_error",
3741
+ "type": "text",
3742
+ "primaryKey": false,
3743
+ "notNull": false
3744
+ },
3745
+ "created_at": {
3746
+ "name": "created_at",
3747
+ "type": "timestamp with time zone",
3748
+ "primaryKey": false,
3749
+ "notNull": true
3750
+ },
3751
+ "updated_at": {
3752
+ "name": "updated_at",
3753
+ "type": "timestamp with time zone",
3754
+ "primaryKey": false,
3755
+ "notNull": true
3756
+ }
3757
+ },
3758
+ "indexes": {
3759
+ "junior_snapshots_snapshot_id_uidx": {
3760
+ "name": "junior_snapshots_snapshot_id_uidx",
3761
+ "columns": [
3762
+ {
3763
+ "expression": "snapshot_id",
3764
+ "isExpression": false,
3765
+ "asc": true,
3766
+ "nulls": "last"
3767
+ }
3768
+ ],
3769
+ "isUnique": true,
3770
+ "concurrently": false,
3771
+ "method": "btree",
3772
+ "with": {}
3773
+ },
3774
+ "junior_snapshots_workspace_idx": {
3775
+ "name": "junior_snapshots_workspace_idx",
3776
+ "columns": [
3777
+ {
3778
+ "expression": "workspace_id",
3779
+ "isExpression": false,
3780
+ "asc": true,
3781
+ "nulls": "last"
3782
+ }
3783
+ ],
3784
+ "isUnique": false,
3785
+ "concurrently": false,
3786
+ "method": "btree",
3787
+ "with": {}
3788
+ },
3789
+ "junior_snapshots_workspace_profile_status_idx": {
3790
+ "name": "junior_snapshots_workspace_profile_status_idx",
3791
+ "columns": [
3792
+ {
3793
+ "expression": "workspace_id",
3794
+ "isExpression": false,
3795
+ "asc": true,
3796
+ "nulls": "last"
3797
+ },
3798
+ {
3799
+ "expression": "profile_hash",
3800
+ "isExpression": false,
3801
+ "asc": true,
3802
+ "nulls": "last"
3803
+ },
3804
+ {
3805
+ "expression": "status",
3806
+ "isExpression": false,
3807
+ "asc": true,
3808
+ "nulls": "last"
3809
+ }
3810
+ ],
3811
+ "isUnique": false,
3812
+ "concurrently": false,
3813
+ "method": "btree",
3814
+ "with": {}
3815
+ },
3816
+ "junior_snapshots_active_build_uidx": {
3817
+ "name": "junior_snapshots_active_build_uidx",
3818
+ "columns": [
3819
+ {
3820
+ "expression": "workspace_id",
3821
+ "isExpression": false,
3822
+ "asc": true,
3823
+ "nulls": "last"
3824
+ },
3825
+ {
3826
+ "expression": "profile_hash",
3827
+ "isExpression": false,
3828
+ "asc": true,
3829
+ "nulls": "last"
3830
+ }
3831
+ ],
3832
+ "isUnique": true,
3833
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
3834
+ "concurrently": false,
3835
+ "method": "btree",
3836
+ "with": {}
3837
+ },
3838
+ "junior_snapshots_workspace_status_idx": {
3839
+ "name": "junior_snapshots_workspace_status_idx",
3840
+ "columns": [
3841
+ {
3842
+ "expression": "workspace_id",
3843
+ "isExpression": false,
3844
+ "asc": true,
3845
+ "nulls": "last"
3846
+ },
3847
+ {
3848
+ "expression": "status",
3849
+ "isExpression": false,
3850
+ "asc": true,
3851
+ "nulls": "last"
3852
+ }
3853
+ ],
3854
+ "isUnique": false,
3855
+ "concurrently": false,
3856
+ "method": "btree",
3857
+ "with": {}
3858
+ }
3859
+ },
3860
+ "foreignKeys": {
3861
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
3862
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
3863
+ "tableFrom": "junior_snapshots",
3864
+ "tableTo": "junior_workspaces",
3865
+ "columnsFrom": [
3866
+ "workspace_id"
3867
+ ],
3868
+ "columnsTo": [
3869
+ "id"
3870
+ ],
3871
+ "onDelete": "cascade",
3872
+ "onUpdate": "no action"
3873
+ }
3874
+ },
3875
+ "compositePrimaryKeys": {},
3876
+ "uniqueConstraints": {},
3877
+ "policies": {},
3878
+ "checkConstraints": {
3879
+ "junior_snapshots_status_check": {
3880
+ "name": "junior_snapshots_status_check",
3881
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
3882
+ },
3883
+ "junior_snapshots_build_phase_check": {
3884
+ "name": "junior_snapshots_build_phase_check",
3885
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
3886
+ },
3887
+ "junior_snapshots_ready_fields_check": {
3888
+ "name": "junior_snapshots_ready_fields_check",
3889
+ "value": "\"junior_snapshots\".\"status\" <> 'ready' or (\"junior_snapshots\".\"snapshot_id\" is not null and \"junior_snapshots\".\"build_duration_ms\" is not null and \"junior_snapshots\".\"generated_at\" is not null)"
3890
+ },
3891
+ "junior_snapshots_build_fields_check": {
3892
+ "name": "junior_snapshots_build_fields_check",
3893
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
3894
+ },
3895
+ "junior_snapshots_build_duration_check": {
3896
+ "name": "junior_snapshots_build_duration_check",
3897
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
3898
+ },
3899
+ "junior_snapshots_size_bytes_check": {
3900
+ "name": "junior_snapshots_size_bytes_check",
3901
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
3902
+ }
3903
+ },
3904
+ "isRLSEnabled": false
3905
+ },
3906
+ "public.junior_stats": {
3907
+ "name": "junior_stats",
3908
+ "schema": "",
3909
+ "columns": {
3910
+ "date": {
3911
+ "name": "date",
3912
+ "type": "date",
3913
+ "primaryKey": false,
3914
+ "notNull": true
3915
+ },
3916
+ "namespace": {
3917
+ "name": "namespace",
3918
+ "type": "text",
3919
+ "primaryKey": false,
3920
+ "notNull": true
3921
+ },
3922
+ "metric": {
3923
+ "name": "metric",
3924
+ "type": "text",
3925
+ "primaryKey": false,
3926
+ "notNull": true
3927
+ },
3928
+ "name": {
3929
+ "name": "name",
3930
+ "type": "text",
3931
+ "primaryKey": false,
3932
+ "notNull": true
3933
+ },
3934
+ "count": {
3935
+ "name": "count",
3936
+ "type": "integer",
3937
+ "primaryKey": false,
3938
+ "notNull": true,
3939
+ "default": 0
3940
+ }
3941
+ },
3942
+ "indexes": {},
3943
+ "foreignKeys": {},
3944
+ "compositePrimaryKeys": {
3945
+ "junior_stats_date_namespace_metric_name_pk": {
3946
+ "name": "junior_stats_date_namespace_metric_name_pk",
3947
+ "columns": [
3948
+ "date",
3949
+ "namespace",
3950
+ "metric",
3951
+ "name"
3952
+ ]
3953
+ }
3954
+ },
3955
+ "uniqueConstraints": {},
3956
+ "policies": {},
3957
+ "checkConstraints": {},
3958
+ "isRLSEnabled": false
3959
+ },
3960
+ "public.junior_users": {
3961
+ "name": "junior_users",
3962
+ "schema": "",
3963
+ "columns": {
3964
+ "id": {
3965
+ "name": "id",
3966
+ "type": "text",
3967
+ "primaryKey": true,
3968
+ "notNull": true
3969
+ },
3970
+ "primary_email": {
3971
+ "name": "primary_email",
3972
+ "type": "text",
3973
+ "primaryKey": false,
3974
+ "notNull": true
3975
+ },
3976
+ "primary_email_normalized": {
3977
+ "name": "primary_email_normalized",
3978
+ "type": "text",
3979
+ "primaryKey": false,
3980
+ "notNull": true
3981
+ },
3982
+ "display_name": {
3983
+ "name": "display_name",
3984
+ "type": "text",
3985
+ "primaryKey": false,
3986
+ "notNull": false
3987
+ },
3988
+ "timezone": {
3989
+ "name": "timezone",
3990
+ "type": "text",
3991
+ "primaryKey": false,
3992
+ "notNull": false
3993
+ },
3994
+ "customization": {
3995
+ "name": "customization",
3996
+ "type": "text",
3997
+ "primaryKey": false,
3998
+ "notNull": false
3999
+ },
4000
+ "is_admin": {
4001
+ "name": "is_admin",
4002
+ "type": "boolean",
4003
+ "primaryKey": false,
4004
+ "notNull": true,
4005
+ "default": false
4006
+ },
4007
+ "created_at": {
4008
+ "name": "created_at",
4009
+ "type": "timestamp with time zone",
4010
+ "primaryKey": false,
4011
+ "notNull": true
4012
+ },
4013
+ "updated_at": {
4014
+ "name": "updated_at",
4015
+ "type": "timestamp with time zone",
4016
+ "primaryKey": false,
4017
+ "notNull": true
4018
+ }
4019
+ },
4020
+ "indexes": {
4021
+ "junior_users_primary_email_normalized_uidx": {
4022
+ "name": "junior_users_primary_email_normalized_uidx",
4023
+ "columns": [
4024
+ {
4025
+ "expression": "primary_email_normalized",
4026
+ "isExpression": false,
4027
+ "asc": true,
4028
+ "nulls": "last"
4029
+ }
4030
+ ],
4031
+ "isUnique": true,
4032
+ "concurrently": false,
4033
+ "method": "btree",
4034
+ "with": {}
4035
+ }
4036
+ },
4037
+ "foreignKeys": {},
4038
+ "compositePrimaryKeys": {},
4039
+ "uniqueConstraints": {},
4040
+ "policies": {},
4041
+ "checkConstraints": {},
4042
+ "isRLSEnabled": false
4043
+ },
4044
+ "public.junior_workspace_repos": {
4045
+ "name": "junior_workspace_repos",
4046
+ "schema": "",
4047
+ "columns": {
4048
+ "workspace_id": {
4049
+ "name": "workspace_id",
4050
+ "type": "text",
4051
+ "primaryKey": false,
4052
+ "notNull": true
4053
+ },
4054
+ "provider": {
4055
+ "name": "provider",
4056
+ "type": "text",
4057
+ "primaryKey": false,
4058
+ "notNull": true
4059
+ },
4060
+ "repo": {
4061
+ "name": "repo",
4062
+ "type": "text",
4063
+ "primaryKey": false,
4064
+ "notNull": true
4065
+ }
4066
+ },
4067
+ "indexes": {},
4068
+ "foreignKeys": {
4069
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
4070
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
4071
+ "tableFrom": "junior_workspace_repos",
4072
+ "tableTo": "junior_workspaces",
4073
+ "columnsFrom": [
4074
+ "workspace_id"
4075
+ ],
4076
+ "columnsTo": [
4077
+ "id"
4078
+ ],
4079
+ "onDelete": "cascade",
4080
+ "onUpdate": "no action"
4081
+ }
4082
+ },
4083
+ "compositePrimaryKeys": {
4084
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
4085
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
4086
+ "columns": [
4087
+ "workspace_id",
4088
+ "provider",
4089
+ "repo"
4090
+ ]
4091
+ }
4092
+ },
4093
+ "uniqueConstraints": {},
4094
+ "policies": {},
4095
+ "checkConstraints": {},
4096
+ "isRLSEnabled": false
4097
+ },
4098
+ "public.junior_workspaces": {
4099
+ "name": "junior_workspaces",
4100
+ "schema": "",
4101
+ "columns": {
4102
+ "id": {
4103
+ "name": "id",
4104
+ "type": "text",
4105
+ "primaryKey": true,
4106
+ "notNull": true
4107
+ },
4108
+ "name": {
4109
+ "name": "name",
4110
+ "type": "text",
4111
+ "primaryKey": false,
4112
+ "notNull": true
4113
+ },
4114
+ "setup_script": {
4115
+ "name": "setup_script",
4116
+ "type": "text",
4117
+ "primaryKey": false,
4118
+ "notNull": true,
4119
+ "default": "''"
4120
+ },
4121
+ "vcpus": {
4122
+ "name": "vcpus",
4123
+ "type": "integer",
4124
+ "primaryKey": false,
4125
+ "notNull": false
4126
+ },
4127
+ "created_at": {
4128
+ "name": "created_at",
4129
+ "type": "timestamp with time zone",
4130
+ "primaryKey": false,
4131
+ "notNull": true
4132
+ },
4133
+ "updated_at": {
4134
+ "name": "updated_at",
4135
+ "type": "timestamp with time zone",
4136
+ "primaryKey": false,
4137
+ "notNull": true
4138
+ }
4139
+ },
4140
+ "indexes": {
4141
+ "junior_workspaces_name_idx": {
4142
+ "name": "junior_workspaces_name_idx",
4143
+ "columns": [
4144
+ {
4145
+ "expression": "name",
4146
+ "isExpression": false,
4147
+ "asc": true,
4148
+ "nulls": "last"
4149
+ }
4150
+ ],
4151
+ "isUnique": true,
4152
+ "concurrently": false,
4153
+ "method": "btree",
4154
+ "with": {}
4155
+ }
4156
+ },
4157
+ "foreignKeys": {},
4158
+ "compositePrimaryKeys": {},
4159
+ "uniqueConstraints": {},
4160
+ "policies": {},
4161
+ "checkConstraints": {},
4162
+ "isRLSEnabled": false
4163
+ }
4164
+ },
4165
+ "enums": {},
4166
+ "schemas": {},
4167
+ "sequences": {},
4168
+ "roles": {},
4169
+ "policies": {},
4170
+ "views": {},
4171
+ "_meta": {
4172
+ "columns": {},
4173
+ "schemas": {},
4174
+ "tables": {}
4175
+ }
4176
+ }