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