@sentry/junior 0.270.0 → 0.272.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 (75) hide show
  1. package/dist/{actor-CP9K2Idu.js → actor-B4DYygOB.js} +1 -1
  2. package/dist/{adapter-BQNTKVTF.js → adapter-BDYDi1F9.js} +1 -1
  3. package/dist/{admin-CKVEoXa4.js → admin-Dj7EFycG.js} +1 -1
  4. package/dist/{agent-runner-MSQSMFkq.js → agent-runner-Cl6Usx2Y.js} +336 -280
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +5 -5
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +81 -37
  9. package/dist/{app-Bz8t4P8p.d.ts → app-DjZblE2J.d.ts} +8 -2
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +74 -40
  12. package/dist/{interruption-marker-CdblrIQK.js → assistant-reply-DN2w6JL_.js} +2 -8
  13. package/dist/{automation-Dwh_xcqM.js → automation-CV7g5h3A.js} +1 -1
  14. package/dist/{briefs-DNFzFFVx.js → briefs-PysAqnjV.js} +4 -4
  15. package/dist/{catalog-runtime-Bdym_wKy.js → catalog-runtime-BNeCWIaF.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{client-B2MjENki.js → client-FRphcDWW.js} +2 -2
  24. package/dist/{config-Dm3pWRqY.js → config-BUP9wjiR.js} +3 -3
  25. package/dist/{connections-0BBhiD-p.js → connections-CesHau9u.js} +10 -10
  26. package/dist/{conversation-AhOVzN_k.js → conversation-BtQzLoK8.js} +12 -1
  27. package/dist/{conversation-privacy-C1pJ89rs.js → conversation-privacy-DiGvA9a3.js} +1 -1
  28. package/dist/{credential-sync-BRiWYs6_.js → credential-sync-D2odJC30.js} +15 -15
  29. package/dist/{credentialed-BeBaJMZ_.js → credentialed-CgTulRDH.js} +33 -26
  30. package/dist/{db-BYOuu6v2.d.ts → db-BPLmOwXf.d.ts} +11 -1
  31. package/dist/{executor-BB6eJkD4.js → executor-DGDpyegI.js} +30 -7
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{job-queue-DiaXoSDg.js → job-queue-CjB97sii.js} +2 -2
  34. package/dist/{list-BTDRxkOg.js → list-JZUP1yog.js} +37 -53
  35. package/dist/{logging-C6EdT6PP.js → logging-CjkDr-jP.js} +1 -1
  36. package/dist/message-D9y8PKA1.js +186 -0
  37. package/dist/nitro.d.ts +1 -1
  38. package/dist/nitro.js +3 -3
  39. package/dist/{oauth-callback-server-CjFFVGqa.js → oauth-callback-server-02Pej6hj.js} +2 -2
  40. package/dist/{prompt-BPSdXYXV.js → prompt-vfceH0c-.js} +1 -1
  41. package/dist/{registry-CndmkP2P.js → registry-7XgwNgQe.js} +2 -2
  42. package/dist/{reporting-window-DRCi1Ls_.js → reporting-window-DgHgwQB3.js} +6 -1
  43. package/dist/{resolve-BkAA1wH7.js → resolve-CuuxNfWG.js} +3 -3
  44. package/dist/{result-9TJTpuYP.js → result-BRhb6iN1.js} +17 -13
  45. package/dist/{runner-BmKLSyJm.js → runner-DaWCofuS.js} +11 -11
  46. package/dist/{sandbox-egress-signals-CjLaogMo.js → sandbox-egress-signals-Bn6FA1UC.js} +1 -1
  47. package/dist/{schema-WayPSHFu.d.ts → schema-CNjAzYOw.d.ts} +28 -5
  48. package/dist/{schema-DNLJ_MzW.js → schema-D5VLF4NT.js} +13 -9
  49. package/dist/{service-account-DlhYl-Mu.js → service-account-D9vrsi8d.js} +3 -3
  50. package/dist/{service-account-D6e9cVmH.js → service-account-H45LIAG2.js} +3 -3
  51. package/dist/{session-stop-MZRgYqYH.js → session-stop-HKl0ECX0.js} +81 -153
  52. package/dist/{skills-BggTR_ue.js → skills-CsiKu3-g.js} +2 -2
  53. package/dist/{spawn-DmtlcAT_.js → spawn-DqjBxqWh.js} +2 -2
  54. package/dist/{store-BeWGgaMA.js → store-CPF2kzbu.js} +3 -3
  55. package/dist/{store-Byarin7b.js → store-DyVKH0QB.js} +47 -30
  56. package/dist/{task-queue-Dt1_ZoI_.js → task-queue-BbQXCcNX.js} +3 -3
  57. package/dist/{task-runner-DyKqAPpm.js → task-runner-ChzW5E7R.js} +7 -7
  58. package/dist/{thread-state-BHBLMvgb.js → thread-state-Ds8JTsX6.js} +5 -5
  59. package/dist/{turn-failure-response-DWXy_0oJ.js → turn-failure-response-DCMvjsA0.js} +15 -10
  60. package/dist/{turn-lifecycle-AiXkVqCB.js → turn-lifecycle-DM_77q33.js} +1 -1
  61. package/dist/{turn-session-routing-B9KLBhaT.js → turn-session-routing-BV_gX7n3.js} +13 -13
  62. package/dist/{validation-BW60Vtx_.js → validation-DcGelbBi.js} +1 -1
  63. package/dist/{version-CivPYmkH.js → version-C48azPKq.js} +1 -1
  64. package/dist/version.js +1 -1
  65. package/dist/{viewer-BTgAfdUg.js → viewer-BCRuO8Wg.js} +26 -10
  66. package/dist/{work-Bjm52fHo.js → work-zxkmbJAp.js} +27 -11
  67. package/dist/{worker-CMbgtHLu.js → worker-CNNxHF1V.js} +6 -6
  68. package/migrations/0071_review_item_turn.sql +1 -0
  69. package/migrations/0072_conversation_read_positions.sql +10 -0
  70. package/migrations/meta/0071_snapshot.json +4003 -0
  71. package/migrations/meta/0072_snapshot.json +4064 -0
  72. package/migrations/meta/_journal.json +14 -0
  73. package/package.json +4 -4
  74. package/dist/message-DsjiWRVg.js +0 -59
  75. package/migrations/AGENTS.md +0 -17
@@ -0,0 +1,4064 @@
1
+ {
2
+ "id": "c894a9e6-7ba9-4fc6-8d22-c95f15ccb156",
3
+ "prevId": "e195a34f-e236-4221-881e-ccdcee261e6e",
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
+ "root_conversation_id": {
2416
+ "name": "root_conversation_id",
2417
+ "type": "text",
2418
+ "primaryKey": false,
2419
+ "notNull": false
2420
+ },
2421
+ "transcript_purged_at": {
2422
+ "name": "transcript_purged_at",
2423
+ "type": "timestamp with time zone",
2424
+ "primaryKey": false,
2425
+ "notNull": false
2426
+ },
2427
+ "stopped_at": {
2428
+ "name": "stopped_at",
2429
+ "type": "timestamp with time zone",
2430
+ "primaryKey": false,
2431
+ "notNull": false
2432
+ },
2433
+ "duration_ms": {
2434
+ "name": "duration_ms",
2435
+ "type": "integer",
2436
+ "primaryKey": false,
2437
+ "notNull": true,
2438
+ "default": 0
2439
+ },
2440
+ "usage_json": {
2441
+ "name": "usage_json",
2442
+ "type": "jsonb",
2443
+ "primaryKey": false,
2444
+ "notNull": false
2445
+ },
2446
+ "execution_duration_ms": {
2447
+ "name": "execution_duration_ms",
2448
+ "type": "integer",
2449
+ "primaryKey": false,
2450
+ "notNull": true,
2451
+ "default": 0
2452
+ },
2453
+ "execution_usage_json": {
2454
+ "name": "execution_usage_json",
2455
+ "type": "jsonb",
2456
+ "primaryKey": false,
2457
+ "notNull": false
2458
+ },
2459
+ "metric_run_id": {
2460
+ "name": "metric_run_id",
2461
+ "type": "text",
2462
+ "primaryKey": false,
2463
+ "notNull": false
2464
+ },
2465
+ "archived_at": {
2466
+ "name": "archived_at",
2467
+ "type": "timestamp with time zone",
2468
+ "primaryKey": false,
2469
+ "notNull": false
2470
+ }
2471
+ },
2472
+ "indexes": {
2473
+ "junior_conversations_last_activity_idx": {
2474
+ "name": "junior_conversations_last_activity_idx",
2475
+ "columns": [
2476
+ {
2477
+ "expression": "last_activity_at",
2478
+ "isExpression": false,
2479
+ "asc": false,
2480
+ "nulls": "last"
2481
+ },
2482
+ {
2483
+ "expression": "conversation_id",
2484
+ "isExpression": false,
2485
+ "asc": true,
2486
+ "nulls": "last"
2487
+ }
2488
+ ],
2489
+ "isUnique": false,
2490
+ "concurrently": false,
2491
+ "method": "btree",
2492
+ "with": {}
2493
+ },
2494
+ "junior_conversations_active_idx": {
2495
+ "name": "junior_conversations_active_idx",
2496
+ "columns": [
2497
+ {
2498
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
2499
+ "asc": true,
2500
+ "isExpression": true,
2501
+ "nulls": "last"
2502
+ },
2503
+ {
2504
+ "expression": "conversation_id",
2505
+ "isExpression": false,
2506
+ "asc": true,
2507
+ "nulls": "last"
2508
+ }
2509
+ ],
2510
+ "isUnique": false,
2511
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
2512
+ "concurrently": false,
2513
+ "method": "btree",
2514
+ "with": {}
2515
+ },
2516
+ "junior_conversations_destination_activity_idx": {
2517
+ "name": "junior_conversations_destination_activity_idx",
2518
+ "columns": [
2519
+ {
2520
+ "expression": "destination_id",
2521
+ "isExpression": false,
2522
+ "asc": true,
2523
+ "nulls": "last"
2524
+ },
2525
+ {
2526
+ "expression": "last_activity_at",
2527
+ "isExpression": false,
2528
+ "asc": false,
2529
+ "nulls": "last"
2530
+ }
2531
+ ],
2532
+ "isUnique": false,
2533
+ "concurrently": false,
2534
+ "method": "btree",
2535
+ "with": {}
2536
+ },
2537
+ "junior_conversations_actor_activity_idx": {
2538
+ "name": "junior_conversations_actor_activity_idx",
2539
+ "columns": [
2540
+ {
2541
+ "expression": "actor_identity_id",
2542
+ "isExpression": false,
2543
+ "asc": true,
2544
+ "nulls": "last"
2545
+ },
2546
+ {
2547
+ "expression": "last_activity_at",
2548
+ "isExpression": false,
2549
+ "asc": false,
2550
+ "nulls": "last"
2551
+ }
2552
+ ],
2553
+ "isUnique": false,
2554
+ "concurrently": false,
2555
+ "method": "btree",
2556
+ "with": {}
2557
+ },
2558
+ "junior_conversations_parent_idx": {
2559
+ "name": "junior_conversations_parent_idx",
2560
+ "columns": [
2561
+ {
2562
+ "expression": "parent_conversation_id",
2563
+ "isExpression": false,
2564
+ "asc": true,
2565
+ "nulls": "last"
2566
+ }
2567
+ ],
2568
+ "isUnique": false,
2569
+ "concurrently": false,
2570
+ "method": "btree",
2571
+ "with": {}
2572
+ },
2573
+ "junior_conversations_forked_from_idx": {
2574
+ "name": "junior_conversations_forked_from_idx",
2575
+ "columns": [
2576
+ {
2577
+ "expression": "forked_from_conversation_id",
2578
+ "isExpression": false,
2579
+ "asc": true,
2580
+ "nulls": "last"
2581
+ }
2582
+ ],
2583
+ "isUnique": false,
2584
+ "concurrently": false,
2585
+ "method": "btree",
2586
+ "with": {}
2587
+ },
2588
+ "junior_conversations_root_idx": {
2589
+ "name": "junior_conversations_root_idx",
2590
+ "columns": [
2591
+ {
2592
+ "expression": "root_conversation_id",
2593
+ "isExpression": false,
2594
+ "asc": true,
2595
+ "nulls": "last"
2596
+ }
2597
+ ],
2598
+ "isUnique": false,
2599
+ "concurrently": false,
2600
+ "method": "btree",
2601
+ "with": {}
2602
+ }
2603
+ },
2604
+ "foreignKeys": {
2605
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
2606
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
2607
+ "tableFrom": "junior_conversations",
2608
+ "tableTo": "junior_destinations",
2609
+ "columnsFrom": ["destination_id"],
2610
+ "columnsTo": ["id"],
2611
+ "onDelete": "no action",
2612
+ "onUpdate": "no action"
2613
+ },
2614
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
2615
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
2616
+ "tableFrom": "junior_conversations",
2617
+ "tableTo": "junior_identities",
2618
+ "columnsFrom": ["actor_identity_id"],
2619
+ "columnsTo": ["id"],
2620
+ "onDelete": "no action",
2621
+ "onUpdate": "no action"
2622
+ },
2623
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
2624
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
2625
+ "tableFrom": "junior_conversations",
2626
+ "tableTo": "junior_identities",
2627
+ "columnsFrom": ["creator_identity_id"],
2628
+ "columnsTo": ["id"],
2629
+ "onDelete": "no action",
2630
+ "onUpdate": "no action"
2631
+ },
2632
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
2633
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
2634
+ "tableFrom": "junior_conversations",
2635
+ "tableTo": "junior_identities",
2636
+ "columnsFrom": ["credential_subject_identity_id"],
2637
+ "columnsTo": ["id"],
2638
+ "onDelete": "no action",
2639
+ "onUpdate": "no action"
2640
+ },
2641
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
2642
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
2643
+ "tableFrom": "junior_conversations",
2644
+ "tableTo": "junior_conversations",
2645
+ "columnsFrom": ["parent_conversation_id"],
2646
+ "columnsTo": ["conversation_id"],
2647
+ "onDelete": "no action",
2648
+ "onUpdate": "no action"
2649
+ },
2650
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
2651
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
2652
+ "tableFrom": "junior_conversations",
2653
+ "tableTo": "junior_conversations",
2654
+ "columnsFrom": ["forked_from_conversation_id"],
2655
+ "columnsTo": ["conversation_id"],
2656
+ "onDelete": "set null",
2657
+ "onUpdate": "no action"
2658
+ },
2659
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
2660
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
2661
+ "tableFrom": "junior_conversations",
2662
+ "tableTo": "junior_conversations",
2663
+ "columnsFrom": ["root_conversation_id"],
2664
+ "columnsTo": ["conversation_id"],
2665
+ "onDelete": "no action",
2666
+ "onUpdate": "no action"
2667
+ }
2668
+ },
2669
+ "compositePrimaryKeys": {},
2670
+ "uniqueConstraints": {},
2671
+ "policies": {},
2672
+ "checkConstraints": {},
2673
+ "isRLSEnabled": false
2674
+ },
2675
+ "public.junior_destinations": {
2676
+ "name": "junior_destinations",
2677
+ "schema": "",
2678
+ "columns": {
2679
+ "id": {
2680
+ "name": "id",
2681
+ "type": "text",
2682
+ "primaryKey": true,
2683
+ "notNull": true
2684
+ },
2685
+ "provider": {
2686
+ "name": "provider",
2687
+ "type": "text",
2688
+ "primaryKey": false,
2689
+ "notNull": true
2690
+ },
2691
+ "provider_tenant_id": {
2692
+ "name": "provider_tenant_id",
2693
+ "type": "text",
2694
+ "primaryKey": false,
2695
+ "notNull": true,
2696
+ "default": "''"
2697
+ },
2698
+ "provider_destination_id": {
2699
+ "name": "provider_destination_id",
2700
+ "type": "text",
2701
+ "primaryKey": false,
2702
+ "notNull": true
2703
+ },
2704
+ "kind": {
2705
+ "name": "kind",
2706
+ "type": "text",
2707
+ "primaryKey": false,
2708
+ "notNull": true
2709
+ },
2710
+ "parent_destination_id": {
2711
+ "name": "parent_destination_id",
2712
+ "type": "text",
2713
+ "primaryKey": false,
2714
+ "notNull": false
2715
+ },
2716
+ "display_name": {
2717
+ "name": "display_name",
2718
+ "type": "text",
2719
+ "primaryKey": false,
2720
+ "notNull": false
2721
+ },
2722
+ "visibility": {
2723
+ "name": "visibility",
2724
+ "type": "text",
2725
+ "primaryKey": false,
2726
+ "notNull": true,
2727
+ "default": "'unknown'"
2728
+ },
2729
+ "metadata_json": {
2730
+ "name": "metadata_json",
2731
+ "type": "jsonb",
2732
+ "primaryKey": false,
2733
+ "notNull": false
2734
+ },
2735
+ "created_at": {
2736
+ "name": "created_at",
2737
+ "type": "timestamp with time zone",
2738
+ "primaryKey": false,
2739
+ "notNull": true
2740
+ },
2741
+ "updated_at": {
2742
+ "name": "updated_at",
2743
+ "type": "timestamp with time zone",
2744
+ "primaryKey": false,
2745
+ "notNull": true
2746
+ }
2747
+ },
2748
+ "indexes": {
2749
+ "junior_destinations_provider_destination_uidx": {
2750
+ "name": "junior_destinations_provider_destination_uidx",
2751
+ "columns": [
2752
+ {
2753
+ "expression": "provider",
2754
+ "isExpression": false,
2755
+ "asc": true,
2756
+ "nulls": "last"
2757
+ },
2758
+ {
2759
+ "expression": "provider_tenant_id",
2760
+ "isExpression": false,
2761
+ "asc": true,
2762
+ "nulls": "last"
2763
+ },
2764
+ {
2765
+ "expression": "provider_destination_id",
2766
+ "isExpression": false,
2767
+ "asc": true,
2768
+ "nulls": "last"
2769
+ }
2770
+ ],
2771
+ "isUnique": true,
2772
+ "concurrently": false,
2773
+ "method": "btree",
2774
+ "with": {}
2775
+ },
2776
+ "junior_destinations_provider_kind_idx": {
2777
+ "name": "junior_destinations_provider_kind_idx",
2778
+ "columns": [
2779
+ {
2780
+ "expression": "provider",
2781
+ "isExpression": false,
2782
+ "asc": true,
2783
+ "nulls": "last"
2784
+ },
2785
+ {
2786
+ "expression": "kind",
2787
+ "isExpression": false,
2788
+ "asc": true,
2789
+ "nulls": "last"
2790
+ }
2791
+ ],
2792
+ "isUnique": false,
2793
+ "concurrently": false,
2794
+ "method": "btree",
2795
+ "with": {}
2796
+ }
2797
+ },
2798
+ "foreignKeys": {},
2799
+ "compositePrimaryKeys": {},
2800
+ "uniqueConstraints": {},
2801
+ "policies": {},
2802
+ "checkConstraints": {},
2803
+ "isRLSEnabled": false
2804
+ },
2805
+ "public.junior_identities": {
2806
+ "name": "junior_identities",
2807
+ "schema": "",
2808
+ "columns": {
2809
+ "id": {
2810
+ "name": "id",
2811
+ "type": "text",
2812
+ "primaryKey": true,
2813
+ "notNull": true
2814
+ },
2815
+ "kind": {
2816
+ "name": "kind",
2817
+ "type": "text",
2818
+ "primaryKey": false,
2819
+ "notNull": true
2820
+ },
2821
+ "provider": {
2822
+ "name": "provider",
2823
+ "type": "text",
2824
+ "primaryKey": false,
2825
+ "notNull": true
2826
+ },
2827
+ "provider_tenant_id": {
2828
+ "name": "provider_tenant_id",
2829
+ "type": "text",
2830
+ "primaryKey": false,
2831
+ "notNull": true,
2832
+ "default": "''"
2833
+ },
2834
+ "provider_subject_id": {
2835
+ "name": "provider_subject_id",
2836
+ "type": "text",
2837
+ "primaryKey": false,
2838
+ "notNull": true
2839
+ },
2840
+ "display_name": {
2841
+ "name": "display_name",
2842
+ "type": "text",
2843
+ "primaryKey": false,
2844
+ "notNull": false
2845
+ },
2846
+ "handle": {
2847
+ "name": "handle",
2848
+ "type": "text",
2849
+ "primaryKey": false,
2850
+ "notNull": false
2851
+ },
2852
+ "email": {
2853
+ "name": "email",
2854
+ "type": "text",
2855
+ "primaryKey": false,
2856
+ "notNull": false
2857
+ },
2858
+ "avatar_url": {
2859
+ "name": "avatar_url",
2860
+ "type": "text",
2861
+ "primaryKey": false,
2862
+ "notNull": false
2863
+ },
2864
+ "metadata_json": {
2865
+ "name": "metadata_json",
2866
+ "type": "jsonb",
2867
+ "primaryKey": false,
2868
+ "notNull": false
2869
+ },
2870
+ "created_at": {
2871
+ "name": "created_at",
2872
+ "type": "timestamp with time zone",
2873
+ "primaryKey": false,
2874
+ "notNull": true
2875
+ },
2876
+ "updated_at": {
2877
+ "name": "updated_at",
2878
+ "type": "timestamp with time zone",
2879
+ "primaryKey": false,
2880
+ "notNull": true
2881
+ },
2882
+ "user_id": {
2883
+ "name": "user_id",
2884
+ "type": "text",
2885
+ "primaryKey": false,
2886
+ "notNull": false
2887
+ },
2888
+ "email_normalized": {
2889
+ "name": "email_normalized",
2890
+ "type": "text",
2891
+ "primaryKey": false,
2892
+ "notNull": false
2893
+ },
2894
+ "email_verified": {
2895
+ "name": "email_verified",
2896
+ "type": "boolean",
2897
+ "primaryKey": false,
2898
+ "notNull": true,
2899
+ "default": false
2900
+ },
2901
+ "signed_in_at": {
2902
+ "name": "signed_in_at",
2903
+ "type": "timestamp with time zone",
2904
+ "primaryKey": false,
2905
+ "notNull": false
2906
+ }
2907
+ },
2908
+ "indexes": {
2909
+ "junior_identities_provider_subject_uidx": {
2910
+ "name": "junior_identities_provider_subject_uidx",
2911
+ "columns": [
2912
+ {
2913
+ "expression": "provider",
2914
+ "isExpression": false,
2915
+ "asc": true,
2916
+ "nulls": "last"
2917
+ },
2918
+ {
2919
+ "expression": "provider_tenant_id",
2920
+ "isExpression": false,
2921
+ "asc": true,
2922
+ "nulls": "last"
2923
+ },
2924
+ {
2925
+ "expression": "provider_subject_id",
2926
+ "isExpression": false,
2927
+ "asc": true,
2928
+ "nulls": "last"
2929
+ }
2930
+ ],
2931
+ "isUnique": true,
2932
+ "concurrently": false,
2933
+ "method": "btree",
2934
+ "with": {}
2935
+ },
2936
+ "junior_identities_user_idx": {
2937
+ "name": "junior_identities_user_idx",
2938
+ "columns": [
2939
+ {
2940
+ "expression": "user_id",
2941
+ "isExpression": false,
2942
+ "asc": true,
2943
+ "nulls": "last"
2944
+ }
2945
+ ],
2946
+ "isUnique": false,
2947
+ "concurrently": false,
2948
+ "method": "btree",
2949
+ "with": {}
2950
+ },
2951
+ "junior_identities_verified_email_idx": {
2952
+ "name": "junior_identities_verified_email_idx",
2953
+ "columns": [
2954
+ {
2955
+ "expression": "email_normalized",
2956
+ "isExpression": false,
2957
+ "asc": true,
2958
+ "nulls": "last"
2959
+ }
2960
+ ],
2961
+ "isUnique": false,
2962
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
2963
+ "concurrently": false,
2964
+ "method": "btree",
2965
+ "with": {}
2966
+ },
2967
+ "junior_identities_kind_provider_idx": {
2968
+ "name": "junior_identities_kind_provider_idx",
2969
+ "columns": [
2970
+ {
2971
+ "expression": "kind",
2972
+ "isExpression": false,
2973
+ "asc": true,
2974
+ "nulls": "last"
2975
+ },
2976
+ {
2977
+ "expression": "provider",
2978
+ "isExpression": false,
2979
+ "asc": true,
2980
+ "nulls": "last"
2981
+ }
2982
+ ],
2983
+ "isUnique": false,
2984
+ "concurrently": false,
2985
+ "method": "btree",
2986
+ "with": {}
2987
+ }
2988
+ },
2989
+ "foreignKeys": {
2990
+ "junior_identities_user_id_junior_users_id_fk": {
2991
+ "name": "junior_identities_user_id_junior_users_id_fk",
2992
+ "tableFrom": "junior_identities",
2993
+ "tableTo": "junior_users",
2994
+ "columnsFrom": ["user_id"],
2995
+ "columnsTo": ["id"],
2996
+ "onDelete": "no action",
2997
+ "onUpdate": "no action"
2998
+ }
2999
+ },
3000
+ "compositePrimaryKeys": {},
3001
+ "uniqueConstraints": {},
3002
+ "policies": {},
3003
+ "checkConstraints": {},
3004
+ "isRLSEnabled": false
3005
+ },
3006
+ "public.junior_location_configurations": {
3007
+ "name": "junior_location_configurations",
3008
+ "schema": "",
3009
+ "columns": {
3010
+ "location_id": {
3011
+ "name": "location_id",
3012
+ "type": "text",
3013
+ "primaryKey": false,
3014
+ "notNull": true
3015
+ },
3016
+ "key": {
3017
+ "name": "key",
3018
+ "type": "text",
3019
+ "primaryKey": false,
3020
+ "notNull": true
3021
+ },
3022
+ "value": {
3023
+ "name": "value",
3024
+ "type": "text",
3025
+ "primaryKey": false,
3026
+ "notNull": true
3027
+ },
3028
+ "updated_at": {
3029
+ "name": "updated_at",
3030
+ "type": "timestamp with time zone",
3031
+ "primaryKey": false,
3032
+ "notNull": true
3033
+ },
3034
+ "updated_by": {
3035
+ "name": "updated_by",
3036
+ "type": "text",
3037
+ "primaryKey": false,
3038
+ "notNull": false
3039
+ },
3040
+ "source": {
3041
+ "name": "source",
3042
+ "type": "text",
3043
+ "primaryKey": false,
3044
+ "notNull": false
3045
+ },
3046
+ "expires_at": {
3047
+ "name": "expires_at",
3048
+ "type": "text",
3049
+ "primaryKey": false,
3050
+ "notNull": false
3051
+ }
3052
+ },
3053
+ "indexes": {},
3054
+ "foreignKeys": {
3055
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3056
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3057
+ "tableFrom": "junior_location_configurations",
3058
+ "tableTo": "junior_destinations",
3059
+ "columnsFrom": ["location_id"],
3060
+ "columnsTo": ["id"],
3061
+ "onDelete": "cascade",
3062
+ "onUpdate": "no action"
3063
+ }
3064
+ },
3065
+ "compositePrimaryKeys": {
3066
+ "junior_location_configurations_location_id_key_pk": {
3067
+ "name": "junior_location_configurations_location_id_key_pk",
3068
+ "columns": ["location_id", "key"]
3069
+ }
3070
+ },
3071
+ "uniqueConstraints": {},
3072
+ "policies": {},
3073
+ "checkConstraints": {},
3074
+ "isRLSEnabled": false
3075
+ },
3076
+ "public.junior_review_item_assignees": {
3077
+ "name": "junior_review_item_assignees",
3078
+ "schema": "",
3079
+ "columns": {
3080
+ "item_id": {
3081
+ "name": "item_id",
3082
+ "type": "text",
3083
+ "primaryKey": false,
3084
+ "notNull": true
3085
+ },
3086
+ "user_id": {
3087
+ "name": "user_id",
3088
+ "type": "text",
3089
+ "primaryKey": false,
3090
+ "notNull": true
3091
+ }
3092
+ },
3093
+ "indexes": {
3094
+ "junior_review_item_assignees_user_idx": {
3095
+ "name": "junior_review_item_assignees_user_idx",
3096
+ "columns": [
3097
+ {
3098
+ "expression": "user_id",
3099
+ "isExpression": false,
3100
+ "asc": true,
3101
+ "nulls": "last"
3102
+ }
3103
+ ],
3104
+ "isUnique": false,
3105
+ "concurrently": false,
3106
+ "method": "btree",
3107
+ "with": {}
3108
+ }
3109
+ },
3110
+ "foreignKeys": {
3111
+ "junior_review_item_assignees_item_id_junior_review_items_id_fk": {
3112
+ "name": "junior_review_item_assignees_item_id_junior_review_items_id_fk",
3113
+ "tableFrom": "junior_review_item_assignees",
3114
+ "tableTo": "junior_review_items",
3115
+ "columnsFrom": ["item_id"],
3116
+ "columnsTo": ["id"],
3117
+ "onDelete": "cascade",
3118
+ "onUpdate": "no action"
3119
+ },
3120
+ "junior_review_item_assignees_user_id_junior_users_id_fk": {
3121
+ "name": "junior_review_item_assignees_user_id_junior_users_id_fk",
3122
+ "tableFrom": "junior_review_item_assignees",
3123
+ "tableTo": "junior_users",
3124
+ "columnsFrom": ["user_id"],
3125
+ "columnsTo": ["id"],
3126
+ "onDelete": "cascade",
3127
+ "onUpdate": "no action"
3128
+ }
3129
+ },
3130
+ "compositePrimaryKeys": {
3131
+ "junior_review_item_assignees_item_id_user_id_pk": {
3132
+ "name": "junior_review_item_assignees_item_id_user_id_pk",
3133
+ "columns": ["item_id", "user_id"]
3134
+ }
3135
+ },
3136
+ "uniqueConstraints": {},
3137
+ "policies": {},
3138
+ "checkConstraints": {},
3139
+ "isRLSEnabled": false
3140
+ },
3141
+ "public.junior_review_item_conversations": {
3142
+ "name": "junior_review_item_conversations",
3143
+ "schema": "",
3144
+ "columns": {
3145
+ "item_id": {
3146
+ "name": "item_id",
3147
+ "type": "text",
3148
+ "primaryKey": false,
3149
+ "notNull": true
3150
+ },
3151
+ "conversation_id": {
3152
+ "name": "conversation_id",
3153
+ "type": "text",
3154
+ "primaryKey": false,
3155
+ "notNull": true
3156
+ }
3157
+ },
3158
+ "indexes": {
3159
+ "junior_review_item_conversations_conversation_idx": {
3160
+ "name": "junior_review_item_conversations_conversation_idx",
3161
+ "columns": [
3162
+ {
3163
+ "expression": "conversation_id",
3164
+ "isExpression": false,
3165
+ "asc": true,
3166
+ "nulls": "last"
3167
+ }
3168
+ ],
3169
+ "isUnique": false,
3170
+ "concurrently": false,
3171
+ "method": "btree",
3172
+ "with": {}
3173
+ }
3174
+ },
3175
+ "foreignKeys": {
3176
+ "junior_review_item_conversations_item_id_junior_review_items_id_fk": {
3177
+ "name": "junior_review_item_conversations_item_id_junior_review_items_id_fk",
3178
+ "tableFrom": "junior_review_item_conversations",
3179
+ "tableTo": "junior_review_items",
3180
+ "columnsFrom": ["item_id"],
3181
+ "columnsTo": ["id"],
3182
+ "onDelete": "cascade",
3183
+ "onUpdate": "no action"
3184
+ },
3185
+ "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk": {
3186
+ "name": "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk",
3187
+ "tableFrom": "junior_review_item_conversations",
3188
+ "tableTo": "junior_conversations",
3189
+ "columnsFrom": ["conversation_id"],
3190
+ "columnsTo": ["conversation_id"],
3191
+ "onDelete": "cascade",
3192
+ "onUpdate": "no action"
3193
+ }
3194
+ },
3195
+ "compositePrimaryKeys": {
3196
+ "junior_review_item_conversations_item_id_conversation_id_pk": {
3197
+ "name": "junior_review_item_conversations_item_id_conversation_id_pk",
3198
+ "columns": ["item_id", "conversation_id"]
3199
+ }
3200
+ },
3201
+ "uniqueConstraints": {},
3202
+ "policies": {},
3203
+ "checkConstraints": {},
3204
+ "isRLSEnabled": false
3205
+ },
3206
+ "public.junior_review_item_slack_cards": {
3207
+ "name": "junior_review_item_slack_cards",
3208
+ "schema": "",
3209
+ "columns": {
3210
+ "item_id": {
3211
+ "name": "item_id",
3212
+ "type": "text",
3213
+ "primaryKey": false,
3214
+ "notNull": true
3215
+ },
3216
+ "conversation_id": {
3217
+ "name": "conversation_id",
3218
+ "type": "text",
3219
+ "primaryKey": false,
3220
+ "notNull": true
3221
+ },
3222
+ "team_id": {
3223
+ "name": "team_id",
3224
+ "type": "text",
3225
+ "primaryKey": false,
3226
+ "notNull": true
3227
+ },
3228
+ "channel_id": {
3229
+ "name": "channel_id",
3230
+ "type": "text",
3231
+ "primaryKey": false,
3232
+ "notNull": true
3233
+ },
3234
+ "message_ts": {
3235
+ "name": "message_ts",
3236
+ "type": "text",
3237
+ "primaryKey": false,
3238
+ "notNull": true
3239
+ }
3240
+ },
3241
+ "indexes": {},
3242
+ "foreignKeys": {
3243
+ "junior_review_item_slack_cards_item_id_junior_review_items_id_fk": {
3244
+ "name": "junior_review_item_slack_cards_item_id_junior_review_items_id_fk",
3245
+ "tableFrom": "junior_review_item_slack_cards",
3246
+ "tableTo": "junior_review_items",
3247
+ "columnsFrom": ["item_id"],
3248
+ "columnsTo": ["id"],
3249
+ "onDelete": "cascade",
3250
+ "onUpdate": "no action"
3251
+ },
3252
+ "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk": {
3253
+ "name": "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk",
3254
+ "tableFrom": "junior_review_item_slack_cards",
3255
+ "tableTo": "junior_conversations",
3256
+ "columnsFrom": ["conversation_id"],
3257
+ "columnsTo": ["conversation_id"],
3258
+ "onDelete": "cascade",
3259
+ "onUpdate": "no action"
3260
+ }
3261
+ },
3262
+ "compositePrimaryKeys": {
3263
+ "junior_review_item_slack_cards_item_id_conversation_id_pk": {
3264
+ "name": "junior_review_item_slack_cards_item_id_conversation_id_pk",
3265
+ "columns": ["item_id", "conversation_id"]
3266
+ }
3267
+ },
3268
+ "uniqueConstraints": {},
3269
+ "policies": {},
3270
+ "checkConstraints": {},
3271
+ "isRLSEnabled": false
3272
+ },
3273
+ "public.junior_review_items": {
3274
+ "name": "junior_review_items",
3275
+ "schema": "",
3276
+ "columns": {
3277
+ "id": {
3278
+ "name": "id",
3279
+ "type": "text",
3280
+ "primaryKey": true,
3281
+ "notNull": true
3282
+ },
3283
+ "kind": {
3284
+ "name": "kind",
3285
+ "type": "text",
3286
+ "primaryKey": false,
3287
+ "notNull": true
3288
+ },
3289
+ "status": {
3290
+ "name": "status",
3291
+ "type": "text",
3292
+ "primaryKey": false,
3293
+ "notNull": true
3294
+ },
3295
+ "visibility": {
3296
+ "name": "visibility",
3297
+ "type": "text",
3298
+ "primaryKey": false,
3299
+ "notNull": true
3300
+ },
3301
+ "title": {
3302
+ "name": "title",
3303
+ "type": "text",
3304
+ "primaryKey": false,
3305
+ "notNull": true
3306
+ },
3307
+ "body": {
3308
+ "name": "body",
3309
+ "type": "text",
3310
+ "primaryKey": false,
3311
+ "notNull": true
3312
+ },
3313
+ "request": {
3314
+ "name": "request",
3315
+ "type": "jsonb",
3316
+ "primaryKey": false,
3317
+ "notNull": false
3318
+ },
3319
+ "answer": {
3320
+ "name": "answer",
3321
+ "type": "jsonb",
3322
+ "primaryKey": false,
3323
+ "notNull": false
3324
+ },
3325
+ "assigned_to_everyone": {
3326
+ "name": "assigned_to_everyone",
3327
+ "type": "boolean",
3328
+ "primaryKey": false,
3329
+ "notNull": true,
3330
+ "default": false
3331
+ },
3332
+ "dedupe_key": {
3333
+ "name": "dedupe_key",
3334
+ "type": "text",
3335
+ "primaryKey": false,
3336
+ "notNull": true
3337
+ },
3338
+ "subject_id": {
3339
+ "name": "subject_id",
3340
+ "type": "text",
3341
+ "primaryKey": false,
3342
+ "notNull": false
3343
+ },
3344
+ "subject_title": {
3345
+ "name": "subject_title",
3346
+ "type": "text",
3347
+ "primaryKey": false,
3348
+ "notNull": false
3349
+ },
3350
+ "subject_url": {
3351
+ "name": "subject_url",
3352
+ "type": "text",
3353
+ "primaryKey": false,
3354
+ "notNull": false
3355
+ },
3356
+ "added_by_conversation_id": {
3357
+ "name": "added_by_conversation_id",
3358
+ "type": "text",
3359
+ "primaryKey": false,
3360
+ "notNull": true
3361
+ },
3362
+ "added_by_turn_id": {
3363
+ "name": "added_by_turn_id",
3364
+ "type": "text",
3365
+ "primaryKey": false,
3366
+ "notNull": false
3367
+ },
3368
+ "provider": {
3369
+ "name": "provider",
3370
+ "type": "text",
3371
+ "primaryKey": false,
3372
+ "notNull": false
3373
+ },
3374
+ "provider_tenant_id": {
3375
+ "name": "provider_tenant_id",
3376
+ "type": "text",
3377
+ "primaryKey": false,
3378
+ "notNull": false
3379
+ },
3380
+ "automation_id": {
3381
+ "name": "automation_id",
3382
+ "type": "text",
3383
+ "primaryKey": false,
3384
+ "notNull": false
3385
+ },
3386
+ "closed_at": {
3387
+ "name": "closed_at",
3388
+ "type": "timestamp with time zone",
3389
+ "primaryKey": false,
3390
+ "notNull": false
3391
+ },
3392
+ "closed_by_user_id": {
3393
+ "name": "closed_by_user_id",
3394
+ "type": "text",
3395
+ "primaryKey": false,
3396
+ "notNull": false
3397
+ },
3398
+ "close_reason": {
3399
+ "name": "close_reason",
3400
+ "type": "text",
3401
+ "primaryKey": false,
3402
+ "notNull": false
3403
+ },
3404
+ "created_at": {
3405
+ "name": "created_at",
3406
+ "type": "timestamp with time zone",
3407
+ "primaryKey": false,
3408
+ "notNull": true
3409
+ },
3410
+ "updated_at": {
3411
+ "name": "updated_at",
3412
+ "type": "timestamp with time zone",
3413
+ "primaryKey": false,
3414
+ "notNull": true
3415
+ }
3416
+ },
3417
+ "indexes": {
3418
+ "junior_review_items_open_dedupe_uidx": {
3419
+ "name": "junior_review_items_open_dedupe_uidx",
3420
+ "columns": [
3421
+ {
3422
+ "expression": "coalesce(\"provider\", '')",
3423
+ "asc": true,
3424
+ "isExpression": true,
3425
+ "nulls": "last"
3426
+ },
3427
+ {
3428
+ "expression": "coalesce(\"provider_tenant_id\", '')",
3429
+ "asc": true,
3430
+ "isExpression": true,
3431
+ "nulls": "last"
3432
+ },
3433
+ {
3434
+ "expression": "dedupe_key",
3435
+ "isExpression": false,
3436
+ "asc": true,
3437
+ "nulls": "last"
3438
+ }
3439
+ ],
3440
+ "isUnique": true,
3441
+ "where": "\"junior_review_items\".\"status\" = 'open'",
3442
+ "concurrently": false,
3443
+ "method": "btree",
3444
+ "with": {}
3445
+ },
3446
+ "junior_review_items_status_idx": {
3447
+ "name": "junior_review_items_status_idx",
3448
+ "columns": [
3449
+ {
3450
+ "expression": "status",
3451
+ "isExpression": false,
3452
+ "asc": true,
3453
+ "nulls": "last"
3454
+ },
3455
+ {
3456
+ "expression": "updated_at",
3457
+ "isExpression": false,
3458
+ "asc": true,
3459
+ "nulls": "last"
3460
+ },
3461
+ {
3462
+ "expression": "id",
3463
+ "isExpression": false,
3464
+ "asc": true,
3465
+ "nulls": "last"
3466
+ }
3467
+ ],
3468
+ "isUnique": false,
3469
+ "concurrently": false,
3470
+ "method": "btree",
3471
+ "with": {}
3472
+ },
3473
+ "junior_review_items_subject_idx": {
3474
+ "name": "junior_review_items_subject_idx",
3475
+ "columns": [
3476
+ {
3477
+ "expression": "subject_id",
3478
+ "isExpression": false,
3479
+ "asc": true,
3480
+ "nulls": "last"
3481
+ },
3482
+ {
3483
+ "expression": "status",
3484
+ "isExpression": false,
3485
+ "asc": true,
3486
+ "nulls": "last"
3487
+ }
3488
+ ],
3489
+ "isUnique": false,
3490
+ "concurrently": false,
3491
+ "method": "btree",
3492
+ "with": {}
3493
+ },
3494
+ "junior_review_items_automation_idx": {
3495
+ "name": "junior_review_items_automation_idx",
3496
+ "columns": [
3497
+ {
3498
+ "expression": "automation_id",
3499
+ "isExpression": false,
3500
+ "asc": true,
3501
+ "nulls": "last"
3502
+ },
3503
+ {
3504
+ "expression": "status",
3505
+ "isExpression": false,
3506
+ "asc": true,
3507
+ "nulls": "last"
3508
+ }
3509
+ ],
3510
+ "isUnique": false,
3511
+ "concurrently": false,
3512
+ "method": "btree",
3513
+ "with": {}
3514
+ }
3515
+ },
3516
+ "foreignKeys": {
3517
+ "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk": {
3518
+ "name": "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk",
3519
+ "tableFrom": "junior_review_items",
3520
+ "tableTo": "junior_conversations",
3521
+ "columnsFrom": ["added_by_conversation_id"],
3522
+ "columnsTo": ["conversation_id"],
3523
+ "onDelete": "cascade",
3524
+ "onUpdate": "no action"
3525
+ },
3526
+ "junior_review_items_automation_id_junior_automations_id_fk": {
3527
+ "name": "junior_review_items_automation_id_junior_automations_id_fk",
3528
+ "tableFrom": "junior_review_items",
3529
+ "tableTo": "junior_automations",
3530
+ "columnsFrom": ["automation_id"],
3531
+ "columnsTo": ["id"],
3532
+ "onDelete": "set null",
3533
+ "onUpdate": "no action"
3534
+ },
3535
+ "junior_review_items_closed_by_user_id_junior_users_id_fk": {
3536
+ "name": "junior_review_items_closed_by_user_id_junior_users_id_fk",
3537
+ "tableFrom": "junior_review_items",
3538
+ "tableTo": "junior_users",
3539
+ "columnsFrom": ["closed_by_user_id"],
3540
+ "columnsTo": ["id"],
3541
+ "onDelete": "set null",
3542
+ "onUpdate": "no action"
3543
+ }
3544
+ },
3545
+ "compositePrimaryKeys": {},
3546
+ "uniqueConstraints": {},
3547
+ "policies": {},
3548
+ "checkConstraints": {
3549
+ "junior_review_items_kind_check": {
3550
+ "name": "junior_review_items_kind_check",
3551
+ "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)"
3552
+ },
3553
+ "junior_review_items_status_check": {
3554
+ "name": "junior_review_items_status_check",
3555
+ "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)"
3556
+ },
3557
+ "junior_review_items_tenant_check": {
3558
+ "name": "junior_review_items_tenant_check",
3559
+ "value": "(\"junior_review_items\".\"provider\" is null) = (\"junior_review_items\".\"provider_tenant_id\" is null)"
3560
+ },
3561
+ "junior_review_items_visibility_check": {
3562
+ "name": "junior_review_items_visibility_check",
3563
+ "value": "\"junior_review_items\".\"visibility\" = 'public' or not \"junior_review_items\".\"assigned_to_everyone\""
3564
+ }
3565
+ },
3566
+ "isRLSEnabled": false
3567
+ },
3568
+ "public.junior_snapshots": {
3569
+ "name": "junior_snapshots",
3570
+ "schema": "",
3571
+ "columns": {
3572
+ "id": {
3573
+ "name": "id",
3574
+ "type": "text",
3575
+ "primaryKey": true,
3576
+ "notNull": true
3577
+ },
3578
+ "workspace_id": {
3579
+ "name": "workspace_id",
3580
+ "type": "text",
3581
+ "primaryKey": false,
3582
+ "notNull": true
3583
+ },
3584
+ "profile_hash": {
3585
+ "name": "profile_hash",
3586
+ "type": "text",
3587
+ "primaryKey": false,
3588
+ "notNull": true
3589
+ },
3590
+ "status": {
3591
+ "name": "status",
3592
+ "type": "text",
3593
+ "primaryKey": false,
3594
+ "notNull": true
3595
+ },
3596
+ "snapshot_id": {
3597
+ "name": "snapshot_id",
3598
+ "type": "text",
3599
+ "primaryKey": false,
3600
+ "notNull": false
3601
+ },
3602
+ "build_duration_ms": {
3603
+ "name": "build_duration_ms",
3604
+ "type": "integer",
3605
+ "primaryKey": false,
3606
+ "notNull": false
3607
+ },
3608
+ "size_bytes": {
3609
+ "name": "size_bytes",
3610
+ "type": "bigint",
3611
+ "primaryKey": false,
3612
+ "notNull": false
3613
+ },
3614
+ "generated_at": {
3615
+ "name": "generated_at",
3616
+ "type": "timestamp with time zone",
3617
+ "primaryKey": false,
3618
+ "notNull": false
3619
+ },
3620
+ "build_started_at": {
3621
+ "name": "build_started_at",
3622
+ "type": "timestamp with time zone",
3623
+ "primaryKey": false,
3624
+ "notNull": false
3625
+ },
3626
+ "build_phase": {
3627
+ "name": "build_phase",
3628
+ "type": "text",
3629
+ "primaryKey": false,
3630
+ "notNull": false
3631
+ },
3632
+ "build_sandbox_name": {
3633
+ "name": "build_sandbox_name",
3634
+ "type": "text",
3635
+ "primaryKey": false,
3636
+ "notNull": false
3637
+ },
3638
+ "build_command_id": {
3639
+ "name": "build_command_id",
3640
+ "type": "text",
3641
+ "primaryKey": false,
3642
+ "notNull": false
3643
+ },
3644
+ "build_error": {
3645
+ "name": "build_error",
3646
+ "type": "text",
3647
+ "primaryKey": false,
3648
+ "notNull": false
3649
+ },
3650
+ "created_at": {
3651
+ "name": "created_at",
3652
+ "type": "timestamp with time zone",
3653
+ "primaryKey": false,
3654
+ "notNull": true
3655
+ },
3656
+ "updated_at": {
3657
+ "name": "updated_at",
3658
+ "type": "timestamp with time zone",
3659
+ "primaryKey": false,
3660
+ "notNull": true
3661
+ }
3662
+ },
3663
+ "indexes": {
3664
+ "junior_snapshots_snapshot_id_uidx": {
3665
+ "name": "junior_snapshots_snapshot_id_uidx",
3666
+ "columns": [
3667
+ {
3668
+ "expression": "snapshot_id",
3669
+ "isExpression": false,
3670
+ "asc": true,
3671
+ "nulls": "last"
3672
+ }
3673
+ ],
3674
+ "isUnique": true,
3675
+ "concurrently": false,
3676
+ "method": "btree",
3677
+ "with": {}
3678
+ },
3679
+ "junior_snapshots_workspace_idx": {
3680
+ "name": "junior_snapshots_workspace_idx",
3681
+ "columns": [
3682
+ {
3683
+ "expression": "workspace_id",
3684
+ "isExpression": false,
3685
+ "asc": true,
3686
+ "nulls": "last"
3687
+ }
3688
+ ],
3689
+ "isUnique": false,
3690
+ "concurrently": false,
3691
+ "method": "btree",
3692
+ "with": {}
3693
+ },
3694
+ "junior_snapshots_workspace_profile_status_idx": {
3695
+ "name": "junior_snapshots_workspace_profile_status_idx",
3696
+ "columns": [
3697
+ {
3698
+ "expression": "workspace_id",
3699
+ "isExpression": false,
3700
+ "asc": true,
3701
+ "nulls": "last"
3702
+ },
3703
+ {
3704
+ "expression": "profile_hash",
3705
+ "isExpression": false,
3706
+ "asc": true,
3707
+ "nulls": "last"
3708
+ },
3709
+ {
3710
+ "expression": "status",
3711
+ "isExpression": false,
3712
+ "asc": true,
3713
+ "nulls": "last"
3714
+ }
3715
+ ],
3716
+ "isUnique": false,
3717
+ "concurrently": false,
3718
+ "method": "btree",
3719
+ "with": {}
3720
+ },
3721
+ "junior_snapshots_active_build_uidx": {
3722
+ "name": "junior_snapshots_active_build_uidx",
3723
+ "columns": [
3724
+ {
3725
+ "expression": "workspace_id",
3726
+ "isExpression": false,
3727
+ "asc": true,
3728
+ "nulls": "last"
3729
+ },
3730
+ {
3731
+ "expression": "profile_hash",
3732
+ "isExpression": false,
3733
+ "asc": true,
3734
+ "nulls": "last"
3735
+ }
3736
+ ],
3737
+ "isUnique": true,
3738
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
3739
+ "concurrently": false,
3740
+ "method": "btree",
3741
+ "with": {}
3742
+ },
3743
+ "junior_snapshots_workspace_status_idx": {
3744
+ "name": "junior_snapshots_workspace_status_idx",
3745
+ "columns": [
3746
+ {
3747
+ "expression": "workspace_id",
3748
+ "isExpression": false,
3749
+ "asc": true,
3750
+ "nulls": "last"
3751
+ },
3752
+ {
3753
+ "expression": "status",
3754
+ "isExpression": false,
3755
+ "asc": true,
3756
+ "nulls": "last"
3757
+ }
3758
+ ],
3759
+ "isUnique": false,
3760
+ "concurrently": false,
3761
+ "method": "btree",
3762
+ "with": {}
3763
+ }
3764
+ },
3765
+ "foreignKeys": {
3766
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
3767
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
3768
+ "tableFrom": "junior_snapshots",
3769
+ "tableTo": "junior_workspaces",
3770
+ "columnsFrom": ["workspace_id"],
3771
+ "columnsTo": ["id"],
3772
+ "onDelete": "cascade",
3773
+ "onUpdate": "no action"
3774
+ }
3775
+ },
3776
+ "compositePrimaryKeys": {},
3777
+ "uniqueConstraints": {},
3778
+ "policies": {},
3779
+ "checkConstraints": {
3780
+ "junior_snapshots_status_check": {
3781
+ "name": "junior_snapshots_status_check",
3782
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
3783
+ },
3784
+ "junior_snapshots_build_phase_check": {
3785
+ "name": "junior_snapshots_build_phase_check",
3786
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
3787
+ },
3788
+ "junior_snapshots_ready_fields_check": {
3789
+ "name": "junior_snapshots_ready_fields_check",
3790
+ "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)"
3791
+ },
3792
+ "junior_snapshots_build_fields_check": {
3793
+ "name": "junior_snapshots_build_fields_check",
3794
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
3795
+ },
3796
+ "junior_snapshots_build_duration_check": {
3797
+ "name": "junior_snapshots_build_duration_check",
3798
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
3799
+ },
3800
+ "junior_snapshots_size_bytes_check": {
3801
+ "name": "junior_snapshots_size_bytes_check",
3802
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
3803
+ }
3804
+ },
3805
+ "isRLSEnabled": false
3806
+ },
3807
+ "public.junior_stats": {
3808
+ "name": "junior_stats",
3809
+ "schema": "",
3810
+ "columns": {
3811
+ "date": {
3812
+ "name": "date",
3813
+ "type": "date",
3814
+ "primaryKey": false,
3815
+ "notNull": true
3816
+ },
3817
+ "namespace": {
3818
+ "name": "namespace",
3819
+ "type": "text",
3820
+ "primaryKey": false,
3821
+ "notNull": true
3822
+ },
3823
+ "metric": {
3824
+ "name": "metric",
3825
+ "type": "text",
3826
+ "primaryKey": false,
3827
+ "notNull": true
3828
+ },
3829
+ "name": {
3830
+ "name": "name",
3831
+ "type": "text",
3832
+ "primaryKey": false,
3833
+ "notNull": true
3834
+ },
3835
+ "count": {
3836
+ "name": "count",
3837
+ "type": "integer",
3838
+ "primaryKey": false,
3839
+ "notNull": true,
3840
+ "default": 0
3841
+ }
3842
+ },
3843
+ "indexes": {},
3844
+ "foreignKeys": {},
3845
+ "compositePrimaryKeys": {
3846
+ "junior_stats_date_namespace_metric_name_pk": {
3847
+ "name": "junior_stats_date_namespace_metric_name_pk",
3848
+ "columns": ["date", "namespace", "metric", "name"]
3849
+ }
3850
+ },
3851
+ "uniqueConstraints": {},
3852
+ "policies": {},
3853
+ "checkConstraints": {},
3854
+ "isRLSEnabled": false
3855
+ },
3856
+ "public.junior_users": {
3857
+ "name": "junior_users",
3858
+ "schema": "",
3859
+ "columns": {
3860
+ "id": {
3861
+ "name": "id",
3862
+ "type": "text",
3863
+ "primaryKey": true,
3864
+ "notNull": true
3865
+ },
3866
+ "primary_email": {
3867
+ "name": "primary_email",
3868
+ "type": "text",
3869
+ "primaryKey": false,
3870
+ "notNull": true
3871
+ },
3872
+ "primary_email_normalized": {
3873
+ "name": "primary_email_normalized",
3874
+ "type": "text",
3875
+ "primaryKey": false,
3876
+ "notNull": true
3877
+ },
3878
+ "display_name": {
3879
+ "name": "display_name",
3880
+ "type": "text",
3881
+ "primaryKey": false,
3882
+ "notNull": false
3883
+ },
3884
+ "timezone": {
3885
+ "name": "timezone",
3886
+ "type": "text",
3887
+ "primaryKey": false,
3888
+ "notNull": false
3889
+ },
3890
+ "customization": {
3891
+ "name": "customization",
3892
+ "type": "text",
3893
+ "primaryKey": false,
3894
+ "notNull": false
3895
+ },
3896
+ "is_admin": {
3897
+ "name": "is_admin",
3898
+ "type": "boolean",
3899
+ "primaryKey": false,
3900
+ "notNull": true,
3901
+ "default": false
3902
+ },
3903
+ "created_at": {
3904
+ "name": "created_at",
3905
+ "type": "timestamp with time zone",
3906
+ "primaryKey": false,
3907
+ "notNull": true
3908
+ },
3909
+ "updated_at": {
3910
+ "name": "updated_at",
3911
+ "type": "timestamp with time zone",
3912
+ "primaryKey": false,
3913
+ "notNull": true
3914
+ }
3915
+ },
3916
+ "indexes": {
3917
+ "junior_users_primary_email_normalized_uidx": {
3918
+ "name": "junior_users_primary_email_normalized_uidx",
3919
+ "columns": [
3920
+ {
3921
+ "expression": "primary_email_normalized",
3922
+ "isExpression": false,
3923
+ "asc": true,
3924
+ "nulls": "last"
3925
+ }
3926
+ ],
3927
+ "isUnique": true,
3928
+ "concurrently": false,
3929
+ "method": "btree",
3930
+ "with": {}
3931
+ }
3932
+ },
3933
+ "foreignKeys": {},
3934
+ "compositePrimaryKeys": {},
3935
+ "uniqueConstraints": {},
3936
+ "policies": {},
3937
+ "checkConstraints": {},
3938
+ "isRLSEnabled": false
3939
+ },
3940
+ "public.junior_workspace_repos": {
3941
+ "name": "junior_workspace_repos",
3942
+ "schema": "",
3943
+ "columns": {
3944
+ "workspace_id": {
3945
+ "name": "workspace_id",
3946
+ "type": "text",
3947
+ "primaryKey": false,
3948
+ "notNull": true
3949
+ },
3950
+ "provider": {
3951
+ "name": "provider",
3952
+ "type": "text",
3953
+ "primaryKey": false,
3954
+ "notNull": true
3955
+ },
3956
+ "repo": {
3957
+ "name": "repo",
3958
+ "type": "text",
3959
+ "primaryKey": false,
3960
+ "notNull": true
3961
+ }
3962
+ },
3963
+ "indexes": {},
3964
+ "foreignKeys": {
3965
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
3966
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
3967
+ "tableFrom": "junior_workspace_repos",
3968
+ "tableTo": "junior_workspaces",
3969
+ "columnsFrom": ["workspace_id"],
3970
+ "columnsTo": ["id"],
3971
+ "onDelete": "cascade",
3972
+ "onUpdate": "no action"
3973
+ }
3974
+ },
3975
+ "compositePrimaryKeys": {
3976
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
3977
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
3978
+ "columns": ["workspace_id", "provider", "repo"]
3979
+ }
3980
+ },
3981
+ "uniqueConstraints": {},
3982
+ "policies": {},
3983
+ "checkConstraints": {},
3984
+ "isRLSEnabled": false
3985
+ },
3986
+ "public.junior_workspaces": {
3987
+ "name": "junior_workspaces",
3988
+ "schema": "",
3989
+ "columns": {
3990
+ "id": {
3991
+ "name": "id",
3992
+ "type": "text",
3993
+ "primaryKey": true,
3994
+ "notNull": true
3995
+ },
3996
+ "name": {
3997
+ "name": "name",
3998
+ "type": "text",
3999
+ "primaryKey": false,
4000
+ "notNull": true
4001
+ },
4002
+ "setup_script": {
4003
+ "name": "setup_script",
4004
+ "type": "text",
4005
+ "primaryKey": false,
4006
+ "notNull": true,
4007
+ "default": "''"
4008
+ },
4009
+ "vcpus": {
4010
+ "name": "vcpus",
4011
+ "type": "integer",
4012
+ "primaryKey": false,
4013
+ "notNull": false
4014
+ },
4015
+ "created_at": {
4016
+ "name": "created_at",
4017
+ "type": "timestamp with time zone",
4018
+ "primaryKey": false,
4019
+ "notNull": true
4020
+ },
4021
+ "updated_at": {
4022
+ "name": "updated_at",
4023
+ "type": "timestamp with time zone",
4024
+ "primaryKey": false,
4025
+ "notNull": true
4026
+ }
4027
+ },
4028
+ "indexes": {
4029
+ "junior_workspaces_name_idx": {
4030
+ "name": "junior_workspaces_name_idx",
4031
+ "columns": [
4032
+ {
4033
+ "expression": "name",
4034
+ "isExpression": false,
4035
+ "asc": true,
4036
+ "nulls": "last"
4037
+ }
4038
+ ],
4039
+ "isUnique": true,
4040
+ "concurrently": false,
4041
+ "method": "btree",
4042
+ "with": {}
4043
+ }
4044
+ },
4045
+ "foreignKeys": {},
4046
+ "compositePrimaryKeys": {},
4047
+ "uniqueConstraints": {},
4048
+ "policies": {},
4049
+ "checkConstraints": {},
4050
+ "isRLSEnabled": false
4051
+ }
4052
+ },
4053
+ "enums": {},
4054
+ "schemas": {},
4055
+ "sequences": {},
4056
+ "roles": {},
4057
+ "policies": {},
4058
+ "views": {},
4059
+ "_meta": {
4060
+ "columns": {},
4061
+ "schemas": {},
4062
+ "tables": {}
4063
+ }
4064
+ }