@sentry/junior 0.254.0 → 0.256.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 (60) hide show
  1. package/dist/{admin-D7kYbu5l.js → admin-BhucwVfy.js} +1 -1
  2. package/dist/{agent-hooks-DfPubHYm.js → agent-hooks-DlSK8PQQ.js} +8 -8
  3. package/dist/{agent-runner-BWmnJ0dD.js → agent-runner-C6_cd61V.js} +24 -21
  4. package/dist/api/schema.d.ts +0 -8
  5. package/dist/api/schema.js +2 -2
  6. package/dist/api.js +60 -70
  7. package/dist/app.js +36 -36
  8. package/dist/{assistant-reply-B3J6ogAM.js → assistant-reply-yn5G-YEG.js} +1 -1
  9. package/dist/{automation-gznOMaQ2.js → automation-CHdlHVZP.js} +3 -4
  10. package/dist/{briefs-B_fgUFD2.js → briefs-U6Bi3IYw.js} +2 -2
  11. package/dist/{catalog-runtime-TG5WF66H.js → catalog-runtime-DF5OWqCc.js} +1 -1
  12. package/dist/cli/chat.js +15 -15
  13. package/dist/cli/check.js +3 -3
  14. package/dist/cli/main.js +2 -2
  15. package/dist/cli/plugins.js +4 -4
  16. package/dist/cli/snapshot-create.js +3 -3
  17. package/dist/cli/upgrade.js +3 -3
  18. package/dist/{client-oBgOmQV6.js → client-BVrAp-pq.js} +2 -2
  19. package/dist/{config-CRlLncIj.js → config-DdBiDanf.js} +2 -2
  20. package/dist/{connections-BZAuDnYm.js → connections-CG04HdpC.js} +9 -9
  21. package/dist/{conversation-privacy-Dui3hTO-.js → conversation-privacy-CpSYOWnP.js} +1 -1
  22. package/dist/{credential-sync-9HiSpphh.js → credential-sync-DKWNdcgm.js} +14 -14
  23. package/dist/{executor-B88oEqok.js → executor-BroK9oKy.js} +5 -6
  24. package/dist/{images-k8HewSp_.js → images-D0VZ5nv0.js} +2 -2
  25. package/dist/instrumentation.js +2 -2
  26. package/dist/{job-queue-B6KaQXY6.js → job-queue-BbGg3gvu.js} +1 -1
  27. package/dist/{logging-B3nJLXT7.js → logging-tPQeUe2i.js} +1 -1
  28. package/dist/{message-C9Wx3Rxx.js → message-DdPGRYQP.js} +3 -3
  29. package/dist/nitro.js +3 -3
  30. package/dist/{oauth-callback-server-CetsCZng.js → oauth-callback-server-B-2errCX.js} +2 -2
  31. package/dist/{pending-auth-m8aJlwP_.js → pending-auth-DT3MRVW8.js} +2 -2
  32. package/dist/{profile-Dh73O6lZ.js → profile-Bb1zCVGP.js} +4 -4
  33. package/dist/{registry-C-jns0Be.js → registry-CsNavQ_Z.js} +1 -1
  34. package/dist/{resolve-CDYCpS_U.js → resolve-B6ZZ9duG.js} +2 -2
  35. package/dist/{result-sih-x_yN.js → result-j9nS0se-.js} +6 -6
  36. package/dist/{runner-CA43p74t.js → runner-Y331DoZ5.js} +9 -9
  37. package/dist/{sandbox-egress-signals-CxHHTu8e.js → sandbox-egress-signals-BUfjEdHY.js} +1 -1
  38. package/dist/{schema-C-a9U34c.js → schema-BBgv0MNf.js} +1 -1
  39. package/dist/{session-stop-DenN1GuJ.js → session-stop-q-6GNHx6.js} +10 -10
  40. package/dist/{skills-D_XDFkSx.js → skills-CyvTsR9M.js} +2 -2
  41. package/dist/{spawn-CcWYt3Tl.js → spawn-Do5mX3d_.js} +2 -2
  42. package/dist/{store-CIs0Tr31.js → store-D2It0ozF.js} +6 -6
  43. package/dist/{task-queue-DAY-aQLX.js → task-queue-ZMk9bLRT.js} +3 -3
  44. package/dist/{task-runner-BE6Jgt2u.js → task-runner-cIGU5VwJ.js} +10 -10
  45. package/dist/{tasks-DO9VM9cu.js → tasks-CODtRzvX.js} +16 -26
  46. package/dist/{thread-state-FreaCOZD.js → thread-state-BPkwVmvK.js} +6 -6
  47. package/dist/{turn-failure-response-CJSt2ZSf.js → turn-failure-response-ChmMeKar.js} +7 -7
  48. package/dist/{turn-lifecycle-BXclEcfZ.js → turn-lifecycle-BUP7ZOVa.js} +1 -1
  49. package/dist/{turn-session-routing-CItfUsjQ.js → turn-session-routing-BcWM3PLm.js} +1 -1
  50. package/dist/{validation-MW8dmhF9.js → validation-DCd69-cP.js} +1 -1
  51. package/dist/{version-DcWD8xpq.js → version-DBc4Qt_P.js} +1 -1
  52. package/dist/version.js +1 -1
  53. package/dist/{viewer-CGZiUVMU.js → viewer-C-9nFKYr.js} +3 -3
  54. package/dist/{web-input-Dpqh0oBt.js → web-input-Cv42P3ni.js} +74 -75
  55. package/dist/{work-DbA9xNO1.js → work-6UmVQq1V.js} +9 -9
  56. package/dist/{worker-DuCs9-3G.js → worker-DAoBZuZn.js} +5 -5
  57. package/migrations/0058_automation_creator_identity.sql +45 -0
  58. package/migrations/meta/0058_snapshot.json +3598 -0
  59. package/migrations/meta/_journal.json +7 -0
  60. package/package.json +4 -4
@@ -0,0 +1,3598 @@
1
+ {
2
+ "id": "eb4205ac-70e2-40fe-b4af-464dad9ac188",
3
+ "prevId": "5fa6dab4-99c4-4a5b-babc-3fccd9db8228",
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": true
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_identity_idx": {
1103
+ "name": "junior_automations_creator_identity_idx",
1104
+ "columns": [
1105
+ {
1106
+ "expression": "creator_identity_id",
1107
+ "isExpression": false,
1108
+ "asc": true,
1109
+ "nulls": "last"
1110
+ },
1111
+ {
1112
+ "expression": "created_at_ms",
1113
+ "isExpression": false,
1114
+ "asc": true,
1115
+ "nulls": "last"
1116
+ },
1117
+ {
1118
+ "expression": "id",
1119
+ "isExpression": false,
1120
+ "asc": true,
1121
+ "nulls": "last"
1122
+ }
1123
+ ],
1124
+ "isUnique": false,
1125
+ "concurrently": false,
1126
+ "method": "btree",
1127
+ "with": {}
1128
+ },
1129
+ "junior_automations_run_now_due_idx": {
1130
+ "name": "junior_automations_run_now_due_idx",
1131
+ "columns": [
1132
+ {
1133
+ "expression": "run_now_at_ms",
1134
+ "isExpression": false,
1135
+ "asc": true,
1136
+ "nulls": "last"
1137
+ },
1138
+ {
1139
+ "expression": "created_at_ms",
1140
+ "isExpression": false,
1141
+ "asc": true,
1142
+ "nulls": "last"
1143
+ },
1144
+ {
1145
+ "expression": "id",
1146
+ "isExpression": false,
1147
+ "asc": true,
1148
+ "nulls": "last"
1149
+ }
1150
+ ],
1151
+ "isUnique": false,
1152
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"run_now_at_ms\" IS NOT NULL",
1153
+ "concurrently": false,
1154
+ "method": "btree",
1155
+ "with": {}
1156
+ },
1157
+ "junior_automations_next_run_due_idx": {
1158
+ "name": "junior_automations_next_run_due_idx",
1159
+ "columns": [
1160
+ {
1161
+ "expression": "next_run_at_ms",
1162
+ "isExpression": false,
1163
+ "asc": true,
1164
+ "nulls": "last"
1165
+ },
1166
+ {
1167
+ "expression": "created_at_ms",
1168
+ "isExpression": false,
1169
+ "asc": true,
1170
+ "nulls": "last"
1171
+ },
1172
+ {
1173
+ "expression": "id",
1174
+ "isExpression": false,
1175
+ "asc": true,
1176
+ "nulls": "last"
1177
+ }
1178
+ ],
1179
+ "isUnique": false,
1180
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"next_run_at_ms\" IS NOT NULL",
1181
+ "concurrently": false,
1182
+ "method": "btree",
1183
+ "with": {}
1184
+ },
1185
+ "junior_automations_match_idx": {
1186
+ "name": "junior_automations_match_idx",
1187
+ "columns": [
1188
+ {
1189
+ "expression": "namespace",
1190
+ "isExpression": false,
1191
+ "asc": true,
1192
+ "nulls": "last"
1193
+ },
1194
+ {
1195
+ "expression": "identifier",
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\" <> 'deleted'",
1215
+ "concurrently": false,
1216
+ "method": "btree",
1217
+ "with": {}
1218
+ }
1219
+ },
1220
+ "foreignKeys": {
1221
+ "junior_automations_creator_identity_id_junior_identities_id_fk": {
1222
+ "name": "junior_automations_creator_identity_id_junior_identities_id_fk",
1223
+ "tableFrom": "junior_automations",
1224
+ "tableTo": "junior_identities",
1225
+ "columnsFrom": [
1226
+ "creator_identity_id"
1227
+ ],
1228
+ "columnsTo": [
1229
+ "id"
1230
+ ],
1231
+ "onDelete": "no action",
1232
+ "onUpdate": "no action"
1233
+ }
1234
+ },
1235
+ "compositePrimaryKeys": {},
1236
+ "uniqueConstraints": {},
1237
+ "policies": {},
1238
+ "checkConstraints": {
1239
+ "junior_automations_kind_check": {
1240
+ "name": "junior_automations_kind_check",
1241
+ "value": "\"junior_automations\".\"kind\" in ('scheduled', 'event')"
1242
+ },
1243
+ "junior_automations_status_check": {
1244
+ "name": "junior_automations_status_check",
1245
+ "value": "\"junior_automations\".\"status\" in ('active', 'blocked', 'paused', 'completed', 'deleted')"
1246
+ },
1247
+ "junior_automations_record_check": {
1248
+ "name": "junior_automations_record_check",
1249
+ "value": "jsonb_typeof(\"junior_automations\".\"record\") = 'object'"
1250
+ },
1251
+ "junior_automations_trigger_check": {
1252
+ "name": "junior_automations_trigger_check",
1253
+ "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')"
1254
+ }
1255
+ },
1256
+ "isRLSEnabled": false
1257
+ },
1258
+ "public.junior_code_changes": {
1259
+ "name": "junior_code_changes",
1260
+ "schema": "",
1261
+ "columns": {
1262
+ "id": {
1263
+ "name": "id",
1264
+ "type": "uuid",
1265
+ "primaryKey": true,
1266
+ "notNull": true
1267
+ },
1268
+ "closed_at": {
1269
+ "name": "closed_at",
1270
+ "type": "timestamp with time zone",
1271
+ "primaryKey": false,
1272
+ "notNull": false
1273
+ },
1274
+ "conversation_ids": {
1275
+ "name": "conversation_ids",
1276
+ "type": "text[]",
1277
+ "primaryKey": false,
1278
+ "notNull": true,
1279
+ "default": "ARRAY[]::text[]"
1280
+ },
1281
+ "merged_at": {
1282
+ "name": "merged_at",
1283
+ "type": "timestamp with time zone",
1284
+ "primaryKey": false,
1285
+ "notNull": false
1286
+ },
1287
+ "number": {
1288
+ "name": "number",
1289
+ "type": "integer",
1290
+ "primaryKey": false,
1291
+ "notNull": true
1292
+ },
1293
+ "opened_at": {
1294
+ "name": "opened_at",
1295
+ "type": "timestamp with time zone",
1296
+ "primaryKey": false,
1297
+ "notNull": true
1298
+ },
1299
+ "provider": {
1300
+ "name": "provider",
1301
+ "type": "text",
1302
+ "primaryKey": false,
1303
+ "notNull": true
1304
+ },
1305
+ "provider_id": {
1306
+ "name": "provider_id",
1307
+ "type": "text",
1308
+ "primaryKey": false,
1309
+ "notNull": true
1310
+ },
1311
+ "repository_id": {
1312
+ "name": "repository_id",
1313
+ "type": "uuid",
1314
+ "primaryKey": false,
1315
+ "notNull": true
1316
+ },
1317
+ "state": {
1318
+ "name": "state",
1319
+ "type": "text",
1320
+ "primaryKey": false,
1321
+ "notNull": true
1322
+ },
1323
+ "title": {
1324
+ "name": "title",
1325
+ "type": "text",
1326
+ "primaryKey": false,
1327
+ "notNull": false
1328
+ },
1329
+ "updated_at": {
1330
+ "name": "updated_at",
1331
+ "type": "timestamp with time zone",
1332
+ "primaryKey": false,
1333
+ "notNull": true
1334
+ },
1335
+ "url": {
1336
+ "name": "url",
1337
+ "type": "text",
1338
+ "primaryKey": false,
1339
+ "notNull": false
1340
+ }
1341
+ },
1342
+ "indexes": {
1343
+ "junior_code_changes_provider_id_idx": {
1344
+ "name": "junior_code_changes_provider_id_idx",
1345
+ "columns": [
1346
+ {
1347
+ "expression": "provider",
1348
+ "isExpression": false,
1349
+ "asc": true,
1350
+ "nulls": "last"
1351
+ },
1352
+ {
1353
+ "expression": "provider_id",
1354
+ "isExpression": false,
1355
+ "asc": true,
1356
+ "nulls": "last"
1357
+ }
1358
+ ],
1359
+ "isUnique": true,
1360
+ "concurrently": false,
1361
+ "method": "btree",
1362
+ "with": {}
1363
+ },
1364
+ "junior_code_changes_opened_at_idx": {
1365
+ "name": "junior_code_changes_opened_at_idx",
1366
+ "columns": [
1367
+ {
1368
+ "expression": "opened_at",
1369
+ "isExpression": false,
1370
+ "asc": true,
1371
+ "nulls": "last"
1372
+ }
1373
+ ],
1374
+ "isUnique": false,
1375
+ "concurrently": false,
1376
+ "method": "btree",
1377
+ "with": {}
1378
+ },
1379
+ "junior_code_changes_merged_at_idx": {
1380
+ "name": "junior_code_changes_merged_at_idx",
1381
+ "columns": [
1382
+ {
1383
+ "expression": "merged_at",
1384
+ "isExpression": false,
1385
+ "asc": true,
1386
+ "nulls": "last"
1387
+ }
1388
+ ],
1389
+ "isUnique": false,
1390
+ "concurrently": false,
1391
+ "method": "btree",
1392
+ "with": {}
1393
+ },
1394
+ "junior_code_changes_closed_at_idx": {
1395
+ "name": "junior_code_changes_closed_at_idx",
1396
+ "columns": [
1397
+ {
1398
+ "expression": "closed_at",
1399
+ "isExpression": false,
1400
+ "asc": true,
1401
+ "nulls": "last"
1402
+ }
1403
+ ],
1404
+ "isUnique": false,
1405
+ "concurrently": false,
1406
+ "method": "btree",
1407
+ "with": {}
1408
+ },
1409
+ "junior_code_changes_open_idx": {
1410
+ "name": "junior_code_changes_open_idx",
1411
+ "columns": [
1412
+ {
1413
+ "expression": "id",
1414
+ "isExpression": false,
1415
+ "asc": true,
1416
+ "nulls": "last"
1417
+ }
1418
+ ],
1419
+ "isUnique": false,
1420
+ "where": "\"junior_code_changes\".\"state\" = 'open'",
1421
+ "concurrently": false,
1422
+ "method": "btree",
1423
+ "with": {}
1424
+ }
1425
+ },
1426
+ "foreignKeys": {
1427
+ "junior_code_changes_repository_id_junior_code_repositories_id_fk": {
1428
+ "name": "junior_code_changes_repository_id_junior_code_repositories_id_fk",
1429
+ "tableFrom": "junior_code_changes",
1430
+ "tableTo": "junior_code_repositories",
1431
+ "columnsFrom": [
1432
+ "repository_id"
1433
+ ],
1434
+ "columnsTo": [
1435
+ "id"
1436
+ ],
1437
+ "onDelete": "cascade",
1438
+ "onUpdate": "no action"
1439
+ }
1440
+ },
1441
+ "compositePrimaryKeys": {},
1442
+ "uniqueConstraints": {},
1443
+ "policies": {},
1444
+ "checkConstraints": {},
1445
+ "isRLSEnabled": false
1446
+ },
1447
+ "public.junior_code_repositories": {
1448
+ "name": "junior_code_repositories",
1449
+ "schema": "",
1450
+ "columns": {
1451
+ "id": {
1452
+ "name": "id",
1453
+ "type": "uuid",
1454
+ "primaryKey": true,
1455
+ "notNull": true
1456
+ },
1457
+ "name": {
1458
+ "name": "name",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": true
1462
+ },
1463
+ "provider": {
1464
+ "name": "provider",
1465
+ "type": "text",
1466
+ "primaryKey": false,
1467
+ "notNull": true
1468
+ },
1469
+ "provider_id": {
1470
+ "name": "provider_id",
1471
+ "type": "text",
1472
+ "primaryKey": false,
1473
+ "notNull": true
1474
+ },
1475
+ "url": {
1476
+ "name": "url",
1477
+ "type": "text",
1478
+ "primaryKey": false,
1479
+ "notNull": false
1480
+ },
1481
+ "updated_at": {
1482
+ "name": "updated_at",
1483
+ "type": "timestamp with time zone",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ }
1487
+ },
1488
+ "indexes": {
1489
+ "junior_code_repositories_provider_id_idx": {
1490
+ "name": "junior_code_repositories_provider_id_idx",
1491
+ "columns": [
1492
+ {
1493
+ "expression": "provider",
1494
+ "isExpression": false,
1495
+ "asc": true,
1496
+ "nulls": "last"
1497
+ },
1498
+ {
1499
+ "expression": "provider_id",
1500
+ "isExpression": false,
1501
+ "asc": true,
1502
+ "nulls": "last"
1503
+ }
1504
+ ],
1505
+ "isUnique": true,
1506
+ "concurrently": false,
1507
+ "method": "btree",
1508
+ "with": {}
1509
+ }
1510
+ },
1511
+ "foreignKeys": {},
1512
+ "compositePrimaryKeys": {},
1513
+ "uniqueConstraints": {},
1514
+ "policies": {},
1515
+ "checkConstraints": {},
1516
+ "isRLSEnabled": false
1517
+ },
1518
+ "public.junior_conversation_annotations": {
1519
+ "name": "junior_conversation_annotations",
1520
+ "schema": "",
1521
+ "columns": {
1522
+ "conversation_id": {
1523
+ "name": "conversation_id",
1524
+ "type": "text",
1525
+ "primaryKey": false,
1526
+ "notNull": true
1527
+ },
1528
+ "plugin": {
1529
+ "name": "plugin",
1530
+ "type": "text",
1531
+ "primaryKey": false,
1532
+ "notNull": true
1533
+ },
1534
+ "kind": {
1535
+ "name": "kind",
1536
+ "type": "text",
1537
+ "primaryKey": false,
1538
+ "notNull": true
1539
+ },
1540
+ "key": {
1541
+ "name": "key",
1542
+ "type": "text",
1543
+ "primaryKey": false,
1544
+ "notNull": true
1545
+ },
1546
+ "annotation_json": {
1547
+ "name": "annotation_json",
1548
+ "type": "jsonb",
1549
+ "primaryKey": false,
1550
+ "notNull": true
1551
+ },
1552
+ "created_at": {
1553
+ "name": "created_at",
1554
+ "type": "timestamp with time zone",
1555
+ "primaryKey": false,
1556
+ "notNull": true
1557
+ },
1558
+ "updated_at": {
1559
+ "name": "updated_at",
1560
+ "type": "timestamp with time zone",
1561
+ "primaryKey": false,
1562
+ "notNull": true
1563
+ }
1564
+ },
1565
+ "indexes": {},
1566
+ "foreignKeys": {
1567
+ "junior_conversation_annotations_conversation_id_fk": {
1568
+ "name": "junior_conversation_annotations_conversation_id_fk",
1569
+ "tableFrom": "junior_conversation_annotations",
1570
+ "tableTo": "junior_conversations",
1571
+ "columnsFrom": [
1572
+ "conversation_id"
1573
+ ],
1574
+ "columnsTo": [
1575
+ "conversation_id"
1576
+ ],
1577
+ "onDelete": "cascade",
1578
+ "onUpdate": "no action"
1579
+ }
1580
+ },
1581
+ "compositePrimaryKeys": {
1582
+ "junior_conversation_annotations_pk": {
1583
+ "name": "junior_conversation_annotations_pk",
1584
+ "columns": [
1585
+ "conversation_id",
1586
+ "plugin",
1587
+ "kind",
1588
+ "key"
1589
+ ]
1590
+ }
1591
+ },
1592
+ "uniqueConstraints": {},
1593
+ "policies": {},
1594
+ "checkConstraints": {},
1595
+ "isRLSEnabled": false
1596
+ },
1597
+ "public.junior_conversation_bindings": {
1598
+ "name": "junior_conversation_bindings",
1599
+ "schema": "",
1600
+ "columns": {
1601
+ "conversation_id": {
1602
+ "name": "conversation_id",
1603
+ "type": "text",
1604
+ "primaryKey": false,
1605
+ "notNull": true
1606
+ },
1607
+ "provider": {
1608
+ "name": "provider",
1609
+ "type": "text",
1610
+ "primaryKey": false,
1611
+ "notNull": true
1612
+ },
1613
+ "provider_tenant_id": {
1614
+ "name": "provider_tenant_id",
1615
+ "type": "text",
1616
+ "primaryKey": false,
1617
+ "notNull": true,
1618
+ "default": "''"
1619
+ },
1620
+ "provider_destination_id": {
1621
+ "name": "provider_destination_id",
1622
+ "type": "text",
1623
+ "primaryKey": false,
1624
+ "notNull": true
1625
+ },
1626
+ "provider_conversation_id": {
1627
+ "name": "provider_conversation_id",
1628
+ "type": "text",
1629
+ "primaryKey": false,
1630
+ "notNull": true
1631
+ },
1632
+ "created_at": {
1633
+ "name": "created_at",
1634
+ "type": "timestamp with time zone",
1635
+ "primaryKey": false,
1636
+ "notNull": true
1637
+ }
1638
+ },
1639
+ "indexes": {
1640
+ "junior_conversation_bindings_conversation_idx": {
1641
+ "name": "junior_conversation_bindings_conversation_idx",
1642
+ "columns": [
1643
+ {
1644
+ "expression": "conversation_id",
1645
+ "isExpression": false,
1646
+ "asc": true,
1647
+ "nulls": "last"
1648
+ }
1649
+ ],
1650
+ "isUnique": false,
1651
+ "concurrently": false,
1652
+ "method": "btree",
1653
+ "with": {}
1654
+ }
1655
+ },
1656
+ "foreignKeys": {
1657
+ "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk": {
1658
+ "name": "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk",
1659
+ "tableFrom": "junior_conversation_bindings",
1660
+ "tableTo": "junior_conversations",
1661
+ "columnsFrom": [
1662
+ "conversation_id"
1663
+ ],
1664
+ "columnsTo": [
1665
+ "conversation_id"
1666
+ ],
1667
+ "onDelete": "no action",
1668
+ "onUpdate": "no action"
1669
+ }
1670
+ },
1671
+ "compositePrimaryKeys": {
1672
+ "junior_conversation_bindings_provider_conversation_pk": {
1673
+ "name": "junior_conversation_bindings_provider_conversation_pk",
1674
+ "columns": [
1675
+ "provider",
1676
+ "provider_tenant_id",
1677
+ "provider_destination_id",
1678
+ "provider_conversation_id"
1679
+ ]
1680
+ }
1681
+ },
1682
+ "uniqueConstraints": {},
1683
+ "policies": {},
1684
+ "checkConstraints": {},
1685
+ "isRLSEnabled": false
1686
+ },
1687
+ "public.junior_conversation_briefs": {
1688
+ "name": "junior_conversation_briefs",
1689
+ "schema": "",
1690
+ "columns": {
1691
+ "conversation_id": {
1692
+ "name": "conversation_id",
1693
+ "type": "text",
1694
+ "primaryKey": false,
1695
+ "notNull": true
1696
+ },
1697
+ "version": {
1698
+ "name": "version",
1699
+ "type": "integer",
1700
+ "primaryKey": false,
1701
+ "notNull": true
1702
+ },
1703
+ "turn_id": {
1704
+ "name": "turn_id",
1705
+ "type": "text",
1706
+ "primaryKey": false,
1707
+ "notNull": true
1708
+ },
1709
+ "through_seq": {
1710
+ "name": "through_seq",
1711
+ "type": "integer",
1712
+ "primaryKey": false,
1713
+ "notNull": true
1714
+ },
1715
+ "content": {
1716
+ "name": "content",
1717
+ "type": "jsonb",
1718
+ "primaryKey": false,
1719
+ "notNull": true
1720
+ },
1721
+ "search_text": {
1722
+ "name": "search_text",
1723
+ "type": "text",
1724
+ "primaryKey": false,
1725
+ "notNull": true
1726
+ },
1727
+ "model_id": {
1728
+ "name": "model_id",
1729
+ "type": "text",
1730
+ "primaryKey": false,
1731
+ "notNull": true
1732
+ },
1733
+ "cost_usd": {
1734
+ "name": "cost_usd",
1735
+ "type": "double precision",
1736
+ "primaryKey": false,
1737
+ "notNull": false
1738
+ },
1739
+ "created_at": {
1740
+ "name": "created_at",
1741
+ "type": "timestamp with time zone",
1742
+ "primaryKey": false,
1743
+ "notNull": true,
1744
+ "default": "now()"
1745
+ }
1746
+ },
1747
+ "indexes": {
1748
+ "junior_conversation_briefs_conversation_turn_idx": {
1749
+ "name": "junior_conversation_briefs_conversation_turn_idx",
1750
+ "columns": [
1751
+ {
1752
+ "expression": "conversation_id",
1753
+ "isExpression": false,
1754
+ "asc": true,
1755
+ "nulls": "last"
1756
+ },
1757
+ {
1758
+ "expression": "turn_id",
1759
+ "isExpression": false,
1760
+ "asc": true,
1761
+ "nulls": "last"
1762
+ }
1763
+ ],
1764
+ "isUnique": true,
1765
+ "concurrently": false,
1766
+ "method": "btree",
1767
+ "with": {}
1768
+ },
1769
+ "junior_conversation_briefs_conversation_version_idx": {
1770
+ "name": "junior_conversation_briefs_conversation_version_idx",
1771
+ "columns": [
1772
+ {
1773
+ "expression": "conversation_id",
1774
+ "isExpression": false,
1775
+ "asc": true,
1776
+ "nulls": "last"
1777
+ },
1778
+ {
1779
+ "expression": "version",
1780
+ "isExpression": false,
1781
+ "asc": false,
1782
+ "nulls": "last"
1783
+ }
1784
+ ],
1785
+ "isUnique": false,
1786
+ "concurrently": false,
1787
+ "method": "btree",
1788
+ "with": {}
1789
+ },
1790
+ "junior_conversation_briefs_search_idx": {
1791
+ "name": "junior_conversation_briefs_search_idx",
1792
+ "columns": [
1793
+ {
1794
+ "expression": "to_tsvector('english', \"search_text\")",
1795
+ "asc": true,
1796
+ "isExpression": true,
1797
+ "nulls": "last"
1798
+ }
1799
+ ],
1800
+ "isUnique": false,
1801
+ "concurrently": false,
1802
+ "method": "gin",
1803
+ "with": {}
1804
+ }
1805
+ },
1806
+ "foreignKeys": {
1807
+ "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk": {
1808
+ "name": "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk",
1809
+ "tableFrom": "junior_conversation_briefs",
1810
+ "tableTo": "junior_conversations",
1811
+ "columnsFrom": [
1812
+ "conversation_id"
1813
+ ],
1814
+ "columnsTo": [
1815
+ "conversation_id"
1816
+ ],
1817
+ "onDelete": "cascade",
1818
+ "onUpdate": "no action"
1819
+ }
1820
+ },
1821
+ "compositePrimaryKeys": {
1822
+ "junior_conversation_briefs_conversation_id_version_pk": {
1823
+ "name": "junior_conversation_briefs_conversation_id_version_pk",
1824
+ "columns": [
1825
+ "conversation_id",
1826
+ "version"
1827
+ ]
1828
+ }
1829
+ },
1830
+ "uniqueConstraints": {},
1831
+ "policies": {},
1832
+ "checkConstraints": {},
1833
+ "isRLSEnabled": false
1834
+ },
1835
+ "public.junior_conversation_events": {
1836
+ "name": "junior_conversation_events",
1837
+ "schema": "",
1838
+ "columns": {
1839
+ "conversation_id": {
1840
+ "name": "conversation_id",
1841
+ "type": "text",
1842
+ "primaryKey": false,
1843
+ "notNull": true
1844
+ },
1845
+ "seq": {
1846
+ "name": "seq",
1847
+ "type": "integer",
1848
+ "primaryKey": false,
1849
+ "notNull": true
1850
+ },
1851
+ "history_version": {
1852
+ "name": "history_version",
1853
+ "type": "integer",
1854
+ "primaryKey": false,
1855
+ "notNull": true
1856
+ },
1857
+ "schema_version": {
1858
+ "name": "schema_version",
1859
+ "type": "integer",
1860
+ "primaryKey": false,
1861
+ "notNull": true,
1862
+ "default": 1
1863
+ },
1864
+ "idempotency_key": {
1865
+ "name": "idempotency_key",
1866
+ "type": "text",
1867
+ "primaryKey": false,
1868
+ "notNull": false
1869
+ },
1870
+ "type": {
1871
+ "name": "type",
1872
+ "type": "text",
1873
+ "primaryKey": false,
1874
+ "notNull": true
1875
+ },
1876
+ "payload": {
1877
+ "name": "payload",
1878
+ "type": "jsonb",
1879
+ "primaryKey": false,
1880
+ "notNull": true
1881
+ },
1882
+ "actor_identity_id": {
1883
+ "name": "actor_identity_id",
1884
+ "type": "text",
1885
+ "primaryKey": false,
1886
+ "notNull": false
1887
+ },
1888
+ "created_at": {
1889
+ "name": "created_at",
1890
+ "type": "timestamp with time zone",
1891
+ "primaryKey": false,
1892
+ "notNull": true
1893
+ }
1894
+ },
1895
+ "indexes": {
1896
+ "junior_conversation_events_history_version_idx": {
1897
+ "name": "junior_conversation_events_history_version_idx",
1898
+ "columns": [
1899
+ {
1900
+ "expression": "conversation_id",
1901
+ "isExpression": false,
1902
+ "asc": true,
1903
+ "nulls": "last"
1904
+ },
1905
+ {
1906
+ "expression": "history_version",
1907
+ "isExpression": false,
1908
+ "asc": true,
1909
+ "nulls": "last"
1910
+ },
1911
+ {
1912
+ "expression": "seq",
1913
+ "isExpression": false,
1914
+ "asc": true,
1915
+ "nulls": "last"
1916
+ }
1917
+ ],
1918
+ "isUnique": false,
1919
+ "concurrently": false,
1920
+ "method": "btree",
1921
+ "with": {}
1922
+ },
1923
+ "junior_conversation_events_type_idx": {
1924
+ "name": "junior_conversation_events_type_idx",
1925
+ "columns": [
1926
+ {
1927
+ "expression": "conversation_id",
1928
+ "isExpression": false,
1929
+ "asc": true,
1930
+ "nulls": "last"
1931
+ },
1932
+ {
1933
+ "expression": "type",
1934
+ "isExpression": false,
1935
+ "asc": true,
1936
+ "nulls": "last"
1937
+ },
1938
+ {
1939
+ "expression": "seq",
1940
+ "isExpression": false,
1941
+ "asc": true,
1942
+ "nulls": "last"
1943
+ }
1944
+ ],
1945
+ "isUnique": false,
1946
+ "concurrently": false,
1947
+ "method": "btree",
1948
+ "with": {}
1949
+ },
1950
+ "junior_conversation_events_actor_identity_idx": {
1951
+ "name": "junior_conversation_events_actor_identity_idx",
1952
+ "columns": [
1953
+ {
1954
+ "expression": "actor_identity_id",
1955
+ "isExpression": false,
1956
+ "asc": true,
1957
+ "nulls": "last"
1958
+ },
1959
+ {
1960
+ "expression": "conversation_id",
1961
+ "isExpression": false,
1962
+ "asc": true,
1963
+ "nulls": "last"
1964
+ },
1965
+ {
1966
+ "expression": "seq",
1967
+ "isExpression": false,
1968
+ "asc": true,
1969
+ "nulls": "last"
1970
+ }
1971
+ ],
1972
+ "isUnique": false,
1973
+ "concurrently": false,
1974
+ "method": "btree",
1975
+ "with": {}
1976
+ },
1977
+ "junior_conversation_events_message_search_idx": {
1978
+ "name": "junior_conversation_events_message_search_idx",
1979
+ "columns": [
1980
+ {
1981
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
1982
+ "asc": true,
1983
+ "isExpression": true,
1984
+ "nulls": "last"
1985
+ }
1986
+ ],
1987
+ "isUnique": false,
1988
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
1989
+ "concurrently": false,
1990
+ "method": "gin",
1991
+ "with": {}
1992
+ },
1993
+ "junior_conversation_events_idempotency_idx": {
1994
+ "name": "junior_conversation_events_idempotency_idx",
1995
+ "columns": [
1996
+ {
1997
+ "expression": "conversation_id",
1998
+ "isExpression": false,
1999
+ "asc": true,
2000
+ "nulls": "last"
2001
+ },
2002
+ {
2003
+ "expression": "idempotency_key",
2004
+ "isExpression": false,
2005
+ "asc": true,
2006
+ "nulls": "last"
2007
+ }
2008
+ ],
2009
+ "isUnique": true,
2010
+ "concurrently": false,
2011
+ "method": "btree",
2012
+ "with": {}
2013
+ }
2014
+ },
2015
+ "foreignKeys": {
2016
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
2017
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
2018
+ "tableFrom": "junior_conversation_events",
2019
+ "tableTo": "junior_identities",
2020
+ "columnsFrom": [
2021
+ "actor_identity_id"
2022
+ ],
2023
+ "columnsTo": [
2024
+ "id"
2025
+ ],
2026
+ "onDelete": "no action",
2027
+ "onUpdate": "no action"
2028
+ },
2029
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
2030
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
2031
+ "tableFrom": "junior_conversation_events",
2032
+ "tableTo": "junior_conversations",
2033
+ "columnsFrom": [
2034
+ "conversation_id"
2035
+ ],
2036
+ "columnsTo": [
2037
+ "conversation_id"
2038
+ ],
2039
+ "onDelete": "no action",
2040
+ "onUpdate": "no action"
2041
+ }
2042
+ },
2043
+ "compositePrimaryKeys": {
2044
+ "junior_conversation_events_conversation_id_seq_pk": {
2045
+ "name": "junior_conversation_events_conversation_id_seq_pk",
2046
+ "columns": [
2047
+ "conversation_id",
2048
+ "seq"
2049
+ ]
2050
+ }
2051
+ },
2052
+ "uniqueConstraints": {},
2053
+ "policies": {},
2054
+ "checkConstraints": {},
2055
+ "isRLSEnabled": false
2056
+ },
2057
+ "public.junior_conversation_metrics": {
2058
+ "name": "junior_conversation_metrics",
2059
+ "schema": "",
2060
+ "columns": {
2061
+ "conversation_id": {
2062
+ "name": "conversation_id",
2063
+ "type": "text",
2064
+ "primaryKey": false,
2065
+ "notNull": true
2066
+ },
2067
+ "run_id": {
2068
+ "name": "run_id",
2069
+ "type": "text",
2070
+ "primaryKey": false,
2071
+ "notNull": true
2072
+ },
2073
+ "metric": {
2074
+ "name": "metric",
2075
+ "type": "text",
2076
+ "primaryKey": false,
2077
+ "notNull": true
2078
+ },
2079
+ "value": {
2080
+ "name": "value",
2081
+ "type": "double precision",
2082
+ "primaryKey": false,
2083
+ "notNull": true
2084
+ },
2085
+ "occurred_at": {
2086
+ "name": "occurred_at",
2087
+ "type": "timestamp with time zone",
2088
+ "primaryKey": false,
2089
+ "notNull": true
2090
+ },
2091
+ "updated_at": {
2092
+ "name": "updated_at",
2093
+ "type": "timestamp with time zone",
2094
+ "primaryKey": false,
2095
+ "notNull": true
2096
+ }
2097
+ },
2098
+ "indexes": {
2099
+ "junior_conversation_metrics_occurred_at_metric_idx": {
2100
+ "name": "junior_conversation_metrics_occurred_at_metric_idx",
2101
+ "columns": [
2102
+ {
2103
+ "expression": "occurred_at",
2104
+ "isExpression": false,
2105
+ "asc": true,
2106
+ "nulls": "last"
2107
+ },
2108
+ {
2109
+ "expression": "metric",
2110
+ "isExpression": false,
2111
+ "asc": true,
2112
+ "nulls": "last"
2113
+ }
2114
+ ],
2115
+ "isUnique": false,
2116
+ "concurrently": false,
2117
+ "method": "btree",
2118
+ "with": {}
2119
+ }
2120
+ },
2121
+ "foreignKeys": {
2122
+ "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk": {
2123
+ "name": "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
2124
+ "tableFrom": "junior_conversation_metrics",
2125
+ "tableTo": "junior_conversations",
2126
+ "columnsFrom": [
2127
+ "conversation_id"
2128
+ ],
2129
+ "columnsTo": [
2130
+ "conversation_id"
2131
+ ],
2132
+ "onDelete": "no action",
2133
+ "onUpdate": "no action"
2134
+ }
2135
+ },
2136
+ "compositePrimaryKeys": {
2137
+ "junior_conversation_metrics_conversation_id_run_id_metric_pk": {
2138
+ "name": "junior_conversation_metrics_conversation_id_run_id_metric_pk",
2139
+ "columns": [
2140
+ "conversation_id",
2141
+ "run_id",
2142
+ "metric"
2143
+ ]
2144
+ }
2145
+ },
2146
+ "uniqueConstraints": {},
2147
+ "policies": {},
2148
+ "checkConstraints": {},
2149
+ "isRLSEnabled": false
2150
+ },
2151
+ "public.junior_conversation_participants": {
2152
+ "name": "junior_conversation_participants",
2153
+ "schema": "",
2154
+ "columns": {
2155
+ "user_id": {
2156
+ "name": "user_id",
2157
+ "type": "text",
2158
+ "primaryKey": false,
2159
+ "notNull": true
2160
+ },
2161
+ "root_conversation_id": {
2162
+ "name": "root_conversation_id",
2163
+ "type": "text",
2164
+ "primaryKey": false,
2165
+ "notNull": true
2166
+ },
2167
+ "last_message_at": {
2168
+ "name": "last_message_at",
2169
+ "type": "timestamp with time zone",
2170
+ "primaryKey": false,
2171
+ "notNull": true
2172
+ },
2173
+ "archived_at": {
2174
+ "name": "archived_at",
2175
+ "type": "timestamp with time zone",
2176
+ "primaryKey": false,
2177
+ "notNull": false
2178
+ }
2179
+ },
2180
+ "indexes": {
2181
+ "junior_conversation_participants_user_activity_idx": {
2182
+ "name": "junior_conversation_participants_user_activity_idx",
2183
+ "columns": [
2184
+ {
2185
+ "expression": "user_id",
2186
+ "isExpression": false,
2187
+ "asc": true,
2188
+ "nulls": "last"
2189
+ },
2190
+ {
2191
+ "expression": "last_message_at",
2192
+ "isExpression": false,
2193
+ "asc": false,
2194
+ "nulls": "last"
2195
+ }
2196
+ ],
2197
+ "isUnique": false,
2198
+ "concurrently": false,
2199
+ "method": "btree",
2200
+ "with": {}
2201
+ },
2202
+ "junior_conversation_participants_root_idx": {
2203
+ "name": "junior_conversation_participants_root_idx",
2204
+ "columns": [
2205
+ {
2206
+ "expression": "root_conversation_id",
2207
+ "isExpression": false,
2208
+ "asc": true,
2209
+ "nulls": "last"
2210
+ }
2211
+ ],
2212
+ "isUnique": false,
2213
+ "concurrently": false,
2214
+ "method": "btree",
2215
+ "with": {}
2216
+ }
2217
+ },
2218
+ "foreignKeys": {
2219
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
2220
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
2221
+ "tableFrom": "junior_conversation_participants",
2222
+ "tableTo": "junior_users",
2223
+ "columnsFrom": [
2224
+ "user_id"
2225
+ ],
2226
+ "columnsTo": [
2227
+ "id"
2228
+ ],
2229
+ "onDelete": "no action",
2230
+ "onUpdate": "no action"
2231
+ },
2232
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
2233
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
2234
+ "tableFrom": "junior_conversation_participants",
2235
+ "tableTo": "junior_conversations",
2236
+ "columnsFrom": [
2237
+ "root_conversation_id"
2238
+ ],
2239
+ "columnsTo": [
2240
+ "conversation_id"
2241
+ ],
2242
+ "onDelete": "no action",
2243
+ "onUpdate": "no action"
2244
+ }
2245
+ },
2246
+ "compositePrimaryKeys": {
2247
+ "junior_conversation_participants_user_root_pk": {
2248
+ "name": "junior_conversation_participants_user_root_pk",
2249
+ "columns": [
2250
+ "user_id",
2251
+ "root_conversation_id"
2252
+ ]
2253
+ }
2254
+ },
2255
+ "uniqueConstraints": {},
2256
+ "policies": {},
2257
+ "checkConstraints": {},
2258
+ "isRLSEnabled": false
2259
+ },
2260
+ "public.junior_conversations": {
2261
+ "name": "junior_conversations",
2262
+ "schema": "",
2263
+ "columns": {
2264
+ "conversation_id": {
2265
+ "name": "conversation_id",
2266
+ "type": "text",
2267
+ "primaryKey": true,
2268
+ "notNull": true
2269
+ },
2270
+ "schema_version": {
2271
+ "name": "schema_version",
2272
+ "type": "integer",
2273
+ "primaryKey": false,
2274
+ "notNull": true,
2275
+ "default": 1
2276
+ },
2277
+ "source": {
2278
+ "name": "source",
2279
+ "type": "text",
2280
+ "primaryKey": false,
2281
+ "notNull": false
2282
+ },
2283
+ "source_json": {
2284
+ "name": "source_json",
2285
+ "type": "jsonb",
2286
+ "primaryKey": false,
2287
+ "notNull": false
2288
+ },
2289
+ "location_json": {
2290
+ "name": "location_json",
2291
+ "type": "jsonb",
2292
+ "primaryKey": false,
2293
+ "notNull": false
2294
+ },
2295
+ "destination_id": {
2296
+ "name": "destination_id",
2297
+ "type": "text",
2298
+ "primaryKey": false,
2299
+ "notNull": false
2300
+ },
2301
+ "destination_json": {
2302
+ "name": "destination_json",
2303
+ "type": "jsonb",
2304
+ "primaryKey": false,
2305
+ "notNull": false
2306
+ },
2307
+ "actor_identity_id": {
2308
+ "name": "actor_identity_id",
2309
+ "type": "text",
2310
+ "primaryKey": false,
2311
+ "notNull": false
2312
+ },
2313
+ "creator_identity_id": {
2314
+ "name": "creator_identity_id",
2315
+ "type": "text",
2316
+ "primaryKey": false,
2317
+ "notNull": false
2318
+ },
2319
+ "credential_subject_identity_id": {
2320
+ "name": "credential_subject_identity_id",
2321
+ "type": "text",
2322
+ "primaryKey": false,
2323
+ "notNull": false
2324
+ },
2325
+ "actor_json": {
2326
+ "name": "actor_json",
2327
+ "type": "jsonb",
2328
+ "primaryKey": false,
2329
+ "notNull": false
2330
+ },
2331
+ "channel_name": {
2332
+ "name": "channel_name",
2333
+ "type": "text",
2334
+ "primaryKey": false,
2335
+ "notNull": false
2336
+ },
2337
+ "title": {
2338
+ "name": "title",
2339
+ "type": "text",
2340
+ "primaryKey": false,
2341
+ "notNull": false
2342
+ },
2343
+ "created_at": {
2344
+ "name": "created_at",
2345
+ "type": "timestamp with time zone",
2346
+ "primaryKey": false,
2347
+ "notNull": true
2348
+ },
2349
+ "last_activity_at": {
2350
+ "name": "last_activity_at",
2351
+ "type": "timestamp with time zone",
2352
+ "primaryKey": false,
2353
+ "notNull": true
2354
+ },
2355
+ "updated_at": {
2356
+ "name": "updated_at",
2357
+ "type": "timestamp with time zone",
2358
+ "primaryKey": false,
2359
+ "notNull": true
2360
+ },
2361
+ "execution_updated_at": {
2362
+ "name": "execution_updated_at",
2363
+ "type": "timestamp with time zone",
2364
+ "primaryKey": false,
2365
+ "notNull": false
2366
+ },
2367
+ "execution_status": {
2368
+ "name": "execution_status",
2369
+ "type": "text",
2370
+ "primaryKey": false,
2371
+ "notNull": true
2372
+ },
2373
+ "run_id": {
2374
+ "name": "run_id",
2375
+ "type": "text",
2376
+ "primaryKey": false,
2377
+ "notNull": false
2378
+ },
2379
+ "last_checkpoint_at": {
2380
+ "name": "last_checkpoint_at",
2381
+ "type": "timestamp with time zone",
2382
+ "primaryKey": false,
2383
+ "notNull": false
2384
+ },
2385
+ "last_enqueued_at": {
2386
+ "name": "last_enqueued_at",
2387
+ "type": "timestamp with time zone",
2388
+ "primaryKey": false,
2389
+ "notNull": false
2390
+ },
2391
+ "parent_conversation_id": {
2392
+ "name": "parent_conversation_id",
2393
+ "type": "text",
2394
+ "primaryKey": false,
2395
+ "notNull": false
2396
+ },
2397
+ "forked_from_conversation_id": {
2398
+ "name": "forked_from_conversation_id",
2399
+ "type": "text",
2400
+ "primaryKey": false,
2401
+ "notNull": false
2402
+ },
2403
+ "root_conversation_id": {
2404
+ "name": "root_conversation_id",
2405
+ "type": "text",
2406
+ "primaryKey": false,
2407
+ "notNull": false
2408
+ },
2409
+ "transcript_purged_at": {
2410
+ "name": "transcript_purged_at",
2411
+ "type": "timestamp with time zone",
2412
+ "primaryKey": false,
2413
+ "notNull": false
2414
+ },
2415
+ "stopped_at": {
2416
+ "name": "stopped_at",
2417
+ "type": "timestamp with time zone",
2418
+ "primaryKey": false,
2419
+ "notNull": false
2420
+ },
2421
+ "duration_ms": {
2422
+ "name": "duration_ms",
2423
+ "type": "integer",
2424
+ "primaryKey": false,
2425
+ "notNull": true,
2426
+ "default": 0
2427
+ },
2428
+ "usage_json": {
2429
+ "name": "usage_json",
2430
+ "type": "jsonb",
2431
+ "primaryKey": false,
2432
+ "notNull": false
2433
+ },
2434
+ "execution_duration_ms": {
2435
+ "name": "execution_duration_ms",
2436
+ "type": "integer",
2437
+ "primaryKey": false,
2438
+ "notNull": true,
2439
+ "default": 0
2440
+ },
2441
+ "execution_usage_json": {
2442
+ "name": "execution_usage_json",
2443
+ "type": "jsonb",
2444
+ "primaryKey": false,
2445
+ "notNull": false
2446
+ },
2447
+ "metric_run_id": {
2448
+ "name": "metric_run_id",
2449
+ "type": "text",
2450
+ "primaryKey": false,
2451
+ "notNull": false
2452
+ },
2453
+ "archived_at": {
2454
+ "name": "archived_at",
2455
+ "type": "timestamp with time zone",
2456
+ "primaryKey": false,
2457
+ "notNull": false
2458
+ }
2459
+ },
2460
+ "indexes": {
2461
+ "junior_conversations_last_activity_idx": {
2462
+ "name": "junior_conversations_last_activity_idx",
2463
+ "columns": [
2464
+ {
2465
+ "expression": "last_activity_at",
2466
+ "isExpression": false,
2467
+ "asc": false,
2468
+ "nulls": "last"
2469
+ },
2470
+ {
2471
+ "expression": "conversation_id",
2472
+ "isExpression": false,
2473
+ "asc": true,
2474
+ "nulls": "last"
2475
+ }
2476
+ ],
2477
+ "isUnique": false,
2478
+ "concurrently": false,
2479
+ "method": "btree",
2480
+ "with": {}
2481
+ },
2482
+ "junior_conversations_active_idx": {
2483
+ "name": "junior_conversations_active_idx",
2484
+ "columns": [
2485
+ {
2486
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
2487
+ "asc": true,
2488
+ "isExpression": true,
2489
+ "nulls": "last"
2490
+ },
2491
+ {
2492
+ "expression": "conversation_id",
2493
+ "isExpression": false,
2494
+ "asc": true,
2495
+ "nulls": "last"
2496
+ }
2497
+ ],
2498
+ "isUnique": false,
2499
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
2500
+ "concurrently": false,
2501
+ "method": "btree",
2502
+ "with": {}
2503
+ },
2504
+ "junior_conversations_destination_activity_idx": {
2505
+ "name": "junior_conversations_destination_activity_idx",
2506
+ "columns": [
2507
+ {
2508
+ "expression": "destination_id",
2509
+ "isExpression": false,
2510
+ "asc": true,
2511
+ "nulls": "last"
2512
+ },
2513
+ {
2514
+ "expression": "last_activity_at",
2515
+ "isExpression": false,
2516
+ "asc": false,
2517
+ "nulls": "last"
2518
+ }
2519
+ ],
2520
+ "isUnique": false,
2521
+ "concurrently": false,
2522
+ "method": "btree",
2523
+ "with": {}
2524
+ },
2525
+ "junior_conversations_actor_activity_idx": {
2526
+ "name": "junior_conversations_actor_activity_idx",
2527
+ "columns": [
2528
+ {
2529
+ "expression": "actor_identity_id",
2530
+ "isExpression": false,
2531
+ "asc": true,
2532
+ "nulls": "last"
2533
+ },
2534
+ {
2535
+ "expression": "last_activity_at",
2536
+ "isExpression": false,
2537
+ "asc": false,
2538
+ "nulls": "last"
2539
+ }
2540
+ ],
2541
+ "isUnique": false,
2542
+ "concurrently": false,
2543
+ "method": "btree",
2544
+ "with": {}
2545
+ },
2546
+ "junior_conversations_parent_idx": {
2547
+ "name": "junior_conversations_parent_idx",
2548
+ "columns": [
2549
+ {
2550
+ "expression": "parent_conversation_id",
2551
+ "isExpression": false,
2552
+ "asc": true,
2553
+ "nulls": "last"
2554
+ }
2555
+ ],
2556
+ "isUnique": false,
2557
+ "concurrently": false,
2558
+ "method": "btree",
2559
+ "with": {}
2560
+ },
2561
+ "junior_conversations_forked_from_idx": {
2562
+ "name": "junior_conversations_forked_from_idx",
2563
+ "columns": [
2564
+ {
2565
+ "expression": "forked_from_conversation_id",
2566
+ "isExpression": false,
2567
+ "asc": true,
2568
+ "nulls": "last"
2569
+ }
2570
+ ],
2571
+ "isUnique": false,
2572
+ "concurrently": false,
2573
+ "method": "btree",
2574
+ "with": {}
2575
+ },
2576
+ "junior_conversations_root_idx": {
2577
+ "name": "junior_conversations_root_idx",
2578
+ "columns": [
2579
+ {
2580
+ "expression": "root_conversation_id",
2581
+ "isExpression": false,
2582
+ "asc": true,
2583
+ "nulls": "last"
2584
+ }
2585
+ ],
2586
+ "isUnique": false,
2587
+ "concurrently": false,
2588
+ "method": "btree",
2589
+ "with": {}
2590
+ }
2591
+ },
2592
+ "foreignKeys": {
2593
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
2594
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
2595
+ "tableFrom": "junior_conversations",
2596
+ "tableTo": "junior_destinations",
2597
+ "columnsFrom": [
2598
+ "destination_id"
2599
+ ],
2600
+ "columnsTo": [
2601
+ "id"
2602
+ ],
2603
+ "onDelete": "no action",
2604
+ "onUpdate": "no action"
2605
+ },
2606
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
2607
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
2608
+ "tableFrom": "junior_conversations",
2609
+ "tableTo": "junior_identities",
2610
+ "columnsFrom": [
2611
+ "actor_identity_id"
2612
+ ],
2613
+ "columnsTo": [
2614
+ "id"
2615
+ ],
2616
+ "onDelete": "no action",
2617
+ "onUpdate": "no action"
2618
+ },
2619
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
2620
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
2621
+ "tableFrom": "junior_conversations",
2622
+ "tableTo": "junior_identities",
2623
+ "columnsFrom": [
2624
+ "creator_identity_id"
2625
+ ],
2626
+ "columnsTo": [
2627
+ "id"
2628
+ ],
2629
+ "onDelete": "no action",
2630
+ "onUpdate": "no action"
2631
+ },
2632
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
2633
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
2634
+ "tableFrom": "junior_conversations",
2635
+ "tableTo": "junior_identities",
2636
+ "columnsFrom": [
2637
+ "credential_subject_identity_id"
2638
+ ],
2639
+ "columnsTo": [
2640
+ "id"
2641
+ ],
2642
+ "onDelete": "no action",
2643
+ "onUpdate": "no action"
2644
+ },
2645
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
2646
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
2647
+ "tableFrom": "junior_conversations",
2648
+ "tableTo": "junior_conversations",
2649
+ "columnsFrom": [
2650
+ "parent_conversation_id"
2651
+ ],
2652
+ "columnsTo": [
2653
+ "conversation_id"
2654
+ ],
2655
+ "onDelete": "no action",
2656
+ "onUpdate": "no action"
2657
+ },
2658
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
2659
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
2660
+ "tableFrom": "junior_conversations",
2661
+ "tableTo": "junior_conversations",
2662
+ "columnsFrom": [
2663
+ "forked_from_conversation_id"
2664
+ ],
2665
+ "columnsTo": [
2666
+ "conversation_id"
2667
+ ],
2668
+ "onDelete": "set null",
2669
+ "onUpdate": "no action"
2670
+ },
2671
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
2672
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
2673
+ "tableFrom": "junior_conversations",
2674
+ "tableTo": "junior_conversations",
2675
+ "columnsFrom": [
2676
+ "root_conversation_id"
2677
+ ],
2678
+ "columnsTo": [
2679
+ "conversation_id"
2680
+ ],
2681
+ "onDelete": "no action",
2682
+ "onUpdate": "no action"
2683
+ }
2684
+ },
2685
+ "compositePrimaryKeys": {},
2686
+ "uniqueConstraints": {},
2687
+ "policies": {},
2688
+ "checkConstraints": {},
2689
+ "isRLSEnabled": false
2690
+ },
2691
+ "public.junior_destinations": {
2692
+ "name": "junior_destinations",
2693
+ "schema": "",
2694
+ "columns": {
2695
+ "id": {
2696
+ "name": "id",
2697
+ "type": "text",
2698
+ "primaryKey": true,
2699
+ "notNull": true
2700
+ },
2701
+ "provider": {
2702
+ "name": "provider",
2703
+ "type": "text",
2704
+ "primaryKey": false,
2705
+ "notNull": true
2706
+ },
2707
+ "provider_tenant_id": {
2708
+ "name": "provider_tenant_id",
2709
+ "type": "text",
2710
+ "primaryKey": false,
2711
+ "notNull": true,
2712
+ "default": "''"
2713
+ },
2714
+ "provider_destination_id": {
2715
+ "name": "provider_destination_id",
2716
+ "type": "text",
2717
+ "primaryKey": false,
2718
+ "notNull": true
2719
+ },
2720
+ "kind": {
2721
+ "name": "kind",
2722
+ "type": "text",
2723
+ "primaryKey": false,
2724
+ "notNull": true
2725
+ },
2726
+ "parent_destination_id": {
2727
+ "name": "parent_destination_id",
2728
+ "type": "text",
2729
+ "primaryKey": false,
2730
+ "notNull": false
2731
+ },
2732
+ "display_name": {
2733
+ "name": "display_name",
2734
+ "type": "text",
2735
+ "primaryKey": false,
2736
+ "notNull": false
2737
+ },
2738
+ "visibility": {
2739
+ "name": "visibility",
2740
+ "type": "text",
2741
+ "primaryKey": false,
2742
+ "notNull": true,
2743
+ "default": "'unknown'"
2744
+ },
2745
+ "metadata_json": {
2746
+ "name": "metadata_json",
2747
+ "type": "jsonb",
2748
+ "primaryKey": false,
2749
+ "notNull": false
2750
+ },
2751
+ "created_at": {
2752
+ "name": "created_at",
2753
+ "type": "timestamp with time zone",
2754
+ "primaryKey": false,
2755
+ "notNull": true
2756
+ },
2757
+ "updated_at": {
2758
+ "name": "updated_at",
2759
+ "type": "timestamp with time zone",
2760
+ "primaryKey": false,
2761
+ "notNull": true
2762
+ }
2763
+ },
2764
+ "indexes": {
2765
+ "junior_destinations_provider_destination_uidx": {
2766
+ "name": "junior_destinations_provider_destination_uidx",
2767
+ "columns": [
2768
+ {
2769
+ "expression": "provider",
2770
+ "isExpression": false,
2771
+ "asc": true,
2772
+ "nulls": "last"
2773
+ },
2774
+ {
2775
+ "expression": "provider_tenant_id",
2776
+ "isExpression": false,
2777
+ "asc": true,
2778
+ "nulls": "last"
2779
+ },
2780
+ {
2781
+ "expression": "provider_destination_id",
2782
+ "isExpression": false,
2783
+ "asc": true,
2784
+ "nulls": "last"
2785
+ }
2786
+ ],
2787
+ "isUnique": true,
2788
+ "concurrently": false,
2789
+ "method": "btree",
2790
+ "with": {}
2791
+ },
2792
+ "junior_destinations_provider_kind_idx": {
2793
+ "name": "junior_destinations_provider_kind_idx",
2794
+ "columns": [
2795
+ {
2796
+ "expression": "provider",
2797
+ "isExpression": false,
2798
+ "asc": true,
2799
+ "nulls": "last"
2800
+ },
2801
+ {
2802
+ "expression": "kind",
2803
+ "isExpression": false,
2804
+ "asc": true,
2805
+ "nulls": "last"
2806
+ }
2807
+ ],
2808
+ "isUnique": false,
2809
+ "concurrently": false,
2810
+ "method": "btree",
2811
+ "with": {}
2812
+ }
2813
+ },
2814
+ "foreignKeys": {},
2815
+ "compositePrimaryKeys": {},
2816
+ "uniqueConstraints": {},
2817
+ "policies": {},
2818
+ "checkConstraints": {},
2819
+ "isRLSEnabled": false
2820
+ },
2821
+ "public.junior_identities": {
2822
+ "name": "junior_identities",
2823
+ "schema": "",
2824
+ "columns": {
2825
+ "id": {
2826
+ "name": "id",
2827
+ "type": "text",
2828
+ "primaryKey": true,
2829
+ "notNull": true
2830
+ },
2831
+ "kind": {
2832
+ "name": "kind",
2833
+ "type": "text",
2834
+ "primaryKey": false,
2835
+ "notNull": true
2836
+ },
2837
+ "provider": {
2838
+ "name": "provider",
2839
+ "type": "text",
2840
+ "primaryKey": false,
2841
+ "notNull": true
2842
+ },
2843
+ "provider_tenant_id": {
2844
+ "name": "provider_tenant_id",
2845
+ "type": "text",
2846
+ "primaryKey": false,
2847
+ "notNull": true,
2848
+ "default": "''"
2849
+ },
2850
+ "provider_subject_id": {
2851
+ "name": "provider_subject_id",
2852
+ "type": "text",
2853
+ "primaryKey": false,
2854
+ "notNull": true
2855
+ },
2856
+ "display_name": {
2857
+ "name": "display_name",
2858
+ "type": "text",
2859
+ "primaryKey": false,
2860
+ "notNull": false
2861
+ },
2862
+ "handle": {
2863
+ "name": "handle",
2864
+ "type": "text",
2865
+ "primaryKey": false,
2866
+ "notNull": false
2867
+ },
2868
+ "email": {
2869
+ "name": "email",
2870
+ "type": "text",
2871
+ "primaryKey": false,
2872
+ "notNull": false
2873
+ },
2874
+ "avatar_url": {
2875
+ "name": "avatar_url",
2876
+ "type": "text",
2877
+ "primaryKey": false,
2878
+ "notNull": false
2879
+ },
2880
+ "metadata_json": {
2881
+ "name": "metadata_json",
2882
+ "type": "jsonb",
2883
+ "primaryKey": false,
2884
+ "notNull": false
2885
+ },
2886
+ "created_at": {
2887
+ "name": "created_at",
2888
+ "type": "timestamp with time zone",
2889
+ "primaryKey": false,
2890
+ "notNull": true
2891
+ },
2892
+ "updated_at": {
2893
+ "name": "updated_at",
2894
+ "type": "timestamp with time zone",
2895
+ "primaryKey": false,
2896
+ "notNull": true
2897
+ },
2898
+ "user_id": {
2899
+ "name": "user_id",
2900
+ "type": "text",
2901
+ "primaryKey": false,
2902
+ "notNull": false
2903
+ },
2904
+ "email_normalized": {
2905
+ "name": "email_normalized",
2906
+ "type": "text",
2907
+ "primaryKey": false,
2908
+ "notNull": false
2909
+ },
2910
+ "email_verified": {
2911
+ "name": "email_verified",
2912
+ "type": "boolean",
2913
+ "primaryKey": false,
2914
+ "notNull": true,
2915
+ "default": false
2916
+ }
2917
+ },
2918
+ "indexes": {
2919
+ "junior_identities_provider_subject_uidx": {
2920
+ "name": "junior_identities_provider_subject_uidx",
2921
+ "columns": [
2922
+ {
2923
+ "expression": "provider",
2924
+ "isExpression": false,
2925
+ "asc": true,
2926
+ "nulls": "last"
2927
+ },
2928
+ {
2929
+ "expression": "provider_tenant_id",
2930
+ "isExpression": false,
2931
+ "asc": true,
2932
+ "nulls": "last"
2933
+ },
2934
+ {
2935
+ "expression": "provider_subject_id",
2936
+ "isExpression": false,
2937
+ "asc": true,
2938
+ "nulls": "last"
2939
+ }
2940
+ ],
2941
+ "isUnique": true,
2942
+ "concurrently": false,
2943
+ "method": "btree",
2944
+ "with": {}
2945
+ },
2946
+ "junior_identities_user_idx": {
2947
+ "name": "junior_identities_user_idx",
2948
+ "columns": [
2949
+ {
2950
+ "expression": "user_id",
2951
+ "isExpression": false,
2952
+ "asc": true,
2953
+ "nulls": "last"
2954
+ }
2955
+ ],
2956
+ "isUnique": false,
2957
+ "concurrently": false,
2958
+ "method": "btree",
2959
+ "with": {}
2960
+ },
2961
+ "junior_identities_verified_email_idx": {
2962
+ "name": "junior_identities_verified_email_idx",
2963
+ "columns": [
2964
+ {
2965
+ "expression": "email_normalized",
2966
+ "isExpression": false,
2967
+ "asc": true,
2968
+ "nulls": "last"
2969
+ }
2970
+ ],
2971
+ "isUnique": false,
2972
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
2973
+ "concurrently": false,
2974
+ "method": "btree",
2975
+ "with": {}
2976
+ },
2977
+ "junior_identities_kind_provider_idx": {
2978
+ "name": "junior_identities_kind_provider_idx",
2979
+ "columns": [
2980
+ {
2981
+ "expression": "kind",
2982
+ "isExpression": false,
2983
+ "asc": true,
2984
+ "nulls": "last"
2985
+ },
2986
+ {
2987
+ "expression": "provider",
2988
+ "isExpression": false,
2989
+ "asc": true,
2990
+ "nulls": "last"
2991
+ }
2992
+ ],
2993
+ "isUnique": false,
2994
+ "concurrently": false,
2995
+ "method": "btree",
2996
+ "with": {}
2997
+ }
2998
+ },
2999
+ "foreignKeys": {
3000
+ "junior_identities_user_id_junior_users_id_fk": {
3001
+ "name": "junior_identities_user_id_junior_users_id_fk",
3002
+ "tableFrom": "junior_identities",
3003
+ "tableTo": "junior_users",
3004
+ "columnsFrom": [
3005
+ "user_id"
3006
+ ],
3007
+ "columnsTo": [
3008
+ "id"
3009
+ ],
3010
+ "onDelete": "no action",
3011
+ "onUpdate": "no action"
3012
+ }
3013
+ },
3014
+ "compositePrimaryKeys": {},
3015
+ "uniqueConstraints": {},
3016
+ "policies": {},
3017
+ "checkConstraints": {},
3018
+ "isRLSEnabled": false
3019
+ },
3020
+ "public.junior_location_configurations": {
3021
+ "name": "junior_location_configurations",
3022
+ "schema": "",
3023
+ "columns": {
3024
+ "location_id": {
3025
+ "name": "location_id",
3026
+ "type": "text",
3027
+ "primaryKey": false,
3028
+ "notNull": true
3029
+ },
3030
+ "key": {
3031
+ "name": "key",
3032
+ "type": "text",
3033
+ "primaryKey": false,
3034
+ "notNull": true
3035
+ },
3036
+ "value": {
3037
+ "name": "value",
3038
+ "type": "text",
3039
+ "primaryKey": false,
3040
+ "notNull": true
3041
+ },
3042
+ "updated_at": {
3043
+ "name": "updated_at",
3044
+ "type": "timestamp with time zone",
3045
+ "primaryKey": false,
3046
+ "notNull": true
3047
+ },
3048
+ "updated_by": {
3049
+ "name": "updated_by",
3050
+ "type": "text",
3051
+ "primaryKey": false,
3052
+ "notNull": false
3053
+ },
3054
+ "source": {
3055
+ "name": "source",
3056
+ "type": "text",
3057
+ "primaryKey": false,
3058
+ "notNull": false
3059
+ },
3060
+ "expires_at": {
3061
+ "name": "expires_at",
3062
+ "type": "text",
3063
+ "primaryKey": false,
3064
+ "notNull": false
3065
+ }
3066
+ },
3067
+ "indexes": {},
3068
+ "foreignKeys": {
3069
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3070
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3071
+ "tableFrom": "junior_location_configurations",
3072
+ "tableTo": "junior_destinations",
3073
+ "columnsFrom": [
3074
+ "location_id"
3075
+ ],
3076
+ "columnsTo": [
3077
+ "id"
3078
+ ],
3079
+ "onDelete": "cascade",
3080
+ "onUpdate": "no action"
3081
+ }
3082
+ },
3083
+ "compositePrimaryKeys": {
3084
+ "junior_location_configurations_location_id_key_pk": {
3085
+ "name": "junior_location_configurations_location_id_key_pk",
3086
+ "columns": [
3087
+ "location_id",
3088
+ "key"
3089
+ ]
3090
+ }
3091
+ },
3092
+ "uniqueConstraints": {},
3093
+ "policies": {},
3094
+ "checkConstraints": {},
3095
+ "isRLSEnabled": false
3096
+ },
3097
+ "public.junior_snapshots": {
3098
+ "name": "junior_snapshots",
3099
+ "schema": "",
3100
+ "columns": {
3101
+ "id": {
3102
+ "name": "id",
3103
+ "type": "text",
3104
+ "primaryKey": true,
3105
+ "notNull": true
3106
+ },
3107
+ "workspace_id": {
3108
+ "name": "workspace_id",
3109
+ "type": "text",
3110
+ "primaryKey": false,
3111
+ "notNull": true
3112
+ },
3113
+ "profile_hash": {
3114
+ "name": "profile_hash",
3115
+ "type": "text",
3116
+ "primaryKey": false,
3117
+ "notNull": true
3118
+ },
3119
+ "status": {
3120
+ "name": "status",
3121
+ "type": "text",
3122
+ "primaryKey": false,
3123
+ "notNull": true
3124
+ },
3125
+ "snapshot_id": {
3126
+ "name": "snapshot_id",
3127
+ "type": "text",
3128
+ "primaryKey": false,
3129
+ "notNull": false
3130
+ },
3131
+ "build_duration_ms": {
3132
+ "name": "build_duration_ms",
3133
+ "type": "integer",
3134
+ "primaryKey": false,
3135
+ "notNull": false
3136
+ },
3137
+ "size_bytes": {
3138
+ "name": "size_bytes",
3139
+ "type": "bigint",
3140
+ "primaryKey": false,
3141
+ "notNull": false
3142
+ },
3143
+ "generated_at": {
3144
+ "name": "generated_at",
3145
+ "type": "timestamp with time zone",
3146
+ "primaryKey": false,
3147
+ "notNull": false
3148
+ },
3149
+ "build_started_at": {
3150
+ "name": "build_started_at",
3151
+ "type": "timestamp with time zone",
3152
+ "primaryKey": false,
3153
+ "notNull": false
3154
+ },
3155
+ "build_phase": {
3156
+ "name": "build_phase",
3157
+ "type": "text",
3158
+ "primaryKey": false,
3159
+ "notNull": false
3160
+ },
3161
+ "build_sandbox_name": {
3162
+ "name": "build_sandbox_name",
3163
+ "type": "text",
3164
+ "primaryKey": false,
3165
+ "notNull": false
3166
+ },
3167
+ "build_command_id": {
3168
+ "name": "build_command_id",
3169
+ "type": "text",
3170
+ "primaryKey": false,
3171
+ "notNull": false
3172
+ },
3173
+ "build_error": {
3174
+ "name": "build_error",
3175
+ "type": "text",
3176
+ "primaryKey": false,
3177
+ "notNull": false
3178
+ },
3179
+ "created_at": {
3180
+ "name": "created_at",
3181
+ "type": "timestamp with time zone",
3182
+ "primaryKey": false,
3183
+ "notNull": true
3184
+ },
3185
+ "updated_at": {
3186
+ "name": "updated_at",
3187
+ "type": "timestamp with time zone",
3188
+ "primaryKey": false,
3189
+ "notNull": true
3190
+ }
3191
+ },
3192
+ "indexes": {
3193
+ "junior_snapshots_snapshot_id_uidx": {
3194
+ "name": "junior_snapshots_snapshot_id_uidx",
3195
+ "columns": [
3196
+ {
3197
+ "expression": "snapshot_id",
3198
+ "isExpression": false,
3199
+ "asc": true,
3200
+ "nulls": "last"
3201
+ }
3202
+ ],
3203
+ "isUnique": true,
3204
+ "concurrently": false,
3205
+ "method": "btree",
3206
+ "with": {}
3207
+ },
3208
+ "junior_snapshots_workspace_idx": {
3209
+ "name": "junior_snapshots_workspace_idx",
3210
+ "columns": [
3211
+ {
3212
+ "expression": "workspace_id",
3213
+ "isExpression": false,
3214
+ "asc": true,
3215
+ "nulls": "last"
3216
+ }
3217
+ ],
3218
+ "isUnique": false,
3219
+ "concurrently": false,
3220
+ "method": "btree",
3221
+ "with": {}
3222
+ },
3223
+ "junior_snapshots_workspace_profile_status_idx": {
3224
+ "name": "junior_snapshots_workspace_profile_status_idx",
3225
+ "columns": [
3226
+ {
3227
+ "expression": "workspace_id",
3228
+ "isExpression": false,
3229
+ "asc": true,
3230
+ "nulls": "last"
3231
+ },
3232
+ {
3233
+ "expression": "profile_hash",
3234
+ "isExpression": false,
3235
+ "asc": true,
3236
+ "nulls": "last"
3237
+ },
3238
+ {
3239
+ "expression": "status",
3240
+ "isExpression": false,
3241
+ "asc": true,
3242
+ "nulls": "last"
3243
+ }
3244
+ ],
3245
+ "isUnique": false,
3246
+ "concurrently": false,
3247
+ "method": "btree",
3248
+ "with": {}
3249
+ },
3250
+ "junior_snapshots_active_build_uidx": {
3251
+ "name": "junior_snapshots_active_build_uidx",
3252
+ "columns": [
3253
+ {
3254
+ "expression": "workspace_id",
3255
+ "isExpression": false,
3256
+ "asc": true,
3257
+ "nulls": "last"
3258
+ },
3259
+ {
3260
+ "expression": "profile_hash",
3261
+ "isExpression": false,
3262
+ "asc": true,
3263
+ "nulls": "last"
3264
+ }
3265
+ ],
3266
+ "isUnique": true,
3267
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
3268
+ "concurrently": false,
3269
+ "method": "btree",
3270
+ "with": {}
3271
+ },
3272
+ "junior_snapshots_workspace_status_idx": {
3273
+ "name": "junior_snapshots_workspace_status_idx",
3274
+ "columns": [
3275
+ {
3276
+ "expression": "workspace_id",
3277
+ "isExpression": false,
3278
+ "asc": true,
3279
+ "nulls": "last"
3280
+ },
3281
+ {
3282
+ "expression": "status",
3283
+ "isExpression": false,
3284
+ "asc": true,
3285
+ "nulls": "last"
3286
+ }
3287
+ ],
3288
+ "isUnique": false,
3289
+ "concurrently": false,
3290
+ "method": "btree",
3291
+ "with": {}
3292
+ }
3293
+ },
3294
+ "foreignKeys": {
3295
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
3296
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
3297
+ "tableFrom": "junior_snapshots",
3298
+ "tableTo": "junior_workspaces",
3299
+ "columnsFrom": [
3300
+ "workspace_id"
3301
+ ],
3302
+ "columnsTo": [
3303
+ "id"
3304
+ ],
3305
+ "onDelete": "cascade",
3306
+ "onUpdate": "no action"
3307
+ }
3308
+ },
3309
+ "compositePrimaryKeys": {},
3310
+ "uniqueConstraints": {},
3311
+ "policies": {},
3312
+ "checkConstraints": {
3313
+ "junior_snapshots_status_check": {
3314
+ "name": "junior_snapshots_status_check",
3315
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
3316
+ },
3317
+ "junior_snapshots_build_phase_check": {
3318
+ "name": "junior_snapshots_build_phase_check",
3319
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
3320
+ },
3321
+ "junior_snapshots_ready_fields_check": {
3322
+ "name": "junior_snapshots_ready_fields_check",
3323
+ "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)"
3324
+ },
3325
+ "junior_snapshots_build_fields_check": {
3326
+ "name": "junior_snapshots_build_fields_check",
3327
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
3328
+ },
3329
+ "junior_snapshots_build_duration_check": {
3330
+ "name": "junior_snapshots_build_duration_check",
3331
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
3332
+ },
3333
+ "junior_snapshots_size_bytes_check": {
3334
+ "name": "junior_snapshots_size_bytes_check",
3335
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
3336
+ }
3337
+ },
3338
+ "isRLSEnabled": false
3339
+ },
3340
+ "public.junior_stats": {
3341
+ "name": "junior_stats",
3342
+ "schema": "",
3343
+ "columns": {
3344
+ "date": {
3345
+ "name": "date",
3346
+ "type": "date",
3347
+ "primaryKey": false,
3348
+ "notNull": true
3349
+ },
3350
+ "namespace": {
3351
+ "name": "namespace",
3352
+ "type": "text",
3353
+ "primaryKey": false,
3354
+ "notNull": true
3355
+ },
3356
+ "metric": {
3357
+ "name": "metric",
3358
+ "type": "text",
3359
+ "primaryKey": false,
3360
+ "notNull": true
3361
+ },
3362
+ "name": {
3363
+ "name": "name",
3364
+ "type": "text",
3365
+ "primaryKey": false,
3366
+ "notNull": true
3367
+ },
3368
+ "count": {
3369
+ "name": "count",
3370
+ "type": "integer",
3371
+ "primaryKey": false,
3372
+ "notNull": true,
3373
+ "default": 0
3374
+ }
3375
+ },
3376
+ "indexes": {},
3377
+ "foreignKeys": {},
3378
+ "compositePrimaryKeys": {
3379
+ "junior_stats_date_namespace_metric_name_pk": {
3380
+ "name": "junior_stats_date_namespace_metric_name_pk",
3381
+ "columns": [
3382
+ "date",
3383
+ "namespace",
3384
+ "metric",
3385
+ "name"
3386
+ ]
3387
+ }
3388
+ },
3389
+ "uniqueConstraints": {},
3390
+ "policies": {},
3391
+ "checkConstraints": {},
3392
+ "isRLSEnabled": false
3393
+ },
3394
+ "public.junior_users": {
3395
+ "name": "junior_users",
3396
+ "schema": "",
3397
+ "columns": {
3398
+ "id": {
3399
+ "name": "id",
3400
+ "type": "text",
3401
+ "primaryKey": true,
3402
+ "notNull": true
3403
+ },
3404
+ "primary_email": {
3405
+ "name": "primary_email",
3406
+ "type": "text",
3407
+ "primaryKey": false,
3408
+ "notNull": true
3409
+ },
3410
+ "primary_email_normalized": {
3411
+ "name": "primary_email_normalized",
3412
+ "type": "text",
3413
+ "primaryKey": false,
3414
+ "notNull": true
3415
+ },
3416
+ "display_name": {
3417
+ "name": "display_name",
3418
+ "type": "text",
3419
+ "primaryKey": false,
3420
+ "notNull": false
3421
+ },
3422
+ "timezone": {
3423
+ "name": "timezone",
3424
+ "type": "text",
3425
+ "primaryKey": false,
3426
+ "notNull": false
3427
+ },
3428
+ "is_admin": {
3429
+ "name": "is_admin",
3430
+ "type": "boolean",
3431
+ "primaryKey": false,
3432
+ "notNull": true,
3433
+ "default": false
3434
+ },
3435
+ "created_at": {
3436
+ "name": "created_at",
3437
+ "type": "timestamp with time zone",
3438
+ "primaryKey": false,
3439
+ "notNull": true
3440
+ },
3441
+ "updated_at": {
3442
+ "name": "updated_at",
3443
+ "type": "timestamp with time zone",
3444
+ "primaryKey": false,
3445
+ "notNull": true
3446
+ }
3447
+ },
3448
+ "indexes": {
3449
+ "junior_users_primary_email_normalized_uidx": {
3450
+ "name": "junior_users_primary_email_normalized_uidx",
3451
+ "columns": [
3452
+ {
3453
+ "expression": "primary_email_normalized",
3454
+ "isExpression": false,
3455
+ "asc": true,
3456
+ "nulls": "last"
3457
+ }
3458
+ ],
3459
+ "isUnique": true,
3460
+ "concurrently": false,
3461
+ "method": "btree",
3462
+ "with": {}
3463
+ }
3464
+ },
3465
+ "foreignKeys": {},
3466
+ "compositePrimaryKeys": {},
3467
+ "uniqueConstraints": {},
3468
+ "policies": {},
3469
+ "checkConstraints": {},
3470
+ "isRLSEnabled": false
3471
+ },
3472
+ "public.junior_workspace_repos": {
3473
+ "name": "junior_workspace_repos",
3474
+ "schema": "",
3475
+ "columns": {
3476
+ "workspace_id": {
3477
+ "name": "workspace_id",
3478
+ "type": "text",
3479
+ "primaryKey": false,
3480
+ "notNull": true
3481
+ },
3482
+ "provider": {
3483
+ "name": "provider",
3484
+ "type": "text",
3485
+ "primaryKey": false,
3486
+ "notNull": true
3487
+ },
3488
+ "repo": {
3489
+ "name": "repo",
3490
+ "type": "text",
3491
+ "primaryKey": false,
3492
+ "notNull": true
3493
+ }
3494
+ },
3495
+ "indexes": {},
3496
+ "foreignKeys": {
3497
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
3498
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
3499
+ "tableFrom": "junior_workspace_repos",
3500
+ "tableTo": "junior_workspaces",
3501
+ "columnsFrom": [
3502
+ "workspace_id"
3503
+ ],
3504
+ "columnsTo": [
3505
+ "id"
3506
+ ],
3507
+ "onDelete": "cascade",
3508
+ "onUpdate": "no action"
3509
+ }
3510
+ },
3511
+ "compositePrimaryKeys": {
3512
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
3513
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
3514
+ "columns": [
3515
+ "workspace_id",
3516
+ "provider",
3517
+ "repo"
3518
+ ]
3519
+ }
3520
+ },
3521
+ "uniqueConstraints": {},
3522
+ "policies": {},
3523
+ "checkConstraints": {},
3524
+ "isRLSEnabled": false
3525
+ },
3526
+ "public.junior_workspaces": {
3527
+ "name": "junior_workspaces",
3528
+ "schema": "",
3529
+ "columns": {
3530
+ "id": {
3531
+ "name": "id",
3532
+ "type": "text",
3533
+ "primaryKey": true,
3534
+ "notNull": true
3535
+ },
3536
+ "name": {
3537
+ "name": "name",
3538
+ "type": "text",
3539
+ "primaryKey": false,
3540
+ "notNull": true
3541
+ },
3542
+ "setup_script": {
3543
+ "name": "setup_script",
3544
+ "type": "text",
3545
+ "primaryKey": false,
3546
+ "notNull": true,
3547
+ "default": "''"
3548
+ },
3549
+ "created_at": {
3550
+ "name": "created_at",
3551
+ "type": "timestamp with time zone",
3552
+ "primaryKey": false,
3553
+ "notNull": true
3554
+ },
3555
+ "updated_at": {
3556
+ "name": "updated_at",
3557
+ "type": "timestamp with time zone",
3558
+ "primaryKey": false,
3559
+ "notNull": true
3560
+ }
3561
+ },
3562
+ "indexes": {
3563
+ "junior_workspaces_name_idx": {
3564
+ "name": "junior_workspaces_name_idx",
3565
+ "columns": [
3566
+ {
3567
+ "expression": "name",
3568
+ "isExpression": false,
3569
+ "asc": true,
3570
+ "nulls": "last"
3571
+ }
3572
+ ],
3573
+ "isUnique": true,
3574
+ "concurrently": false,
3575
+ "method": "btree",
3576
+ "with": {}
3577
+ }
3578
+ },
3579
+ "foreignKeys": {},
3580
+ "compositePrimaryKeys": {},
3581
+ "uniqueConstraints": {},
3582
+ "policies": {},
3583
+ "checkConstraints": {},
3584
+ "isRLSEnabled": false
3585
+ }
3586
+ },
3587
+ "enums": {},
3588
+ "schemas": {},
3589
+ "sequences": {},
3590
+ "roles": {},
3591
+ "policies": {},
3592
+ "views": {},
3593
+ "_meta": {
3594
+ "columns": {},
3595
+ "schemas": {},
3596
+ "tables": {}
3597
+ }
3598
+ }