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