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