@sentry/junior 0.252.0 → 0.254.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/{admin-C_-XEdym.js → admin-D7kYbu5l.js} +1 -1
  2. package/dist/{agent-hooks-DcoKnnxn.js → agent-hooks-DfPubHYm.js} +9 -9
  3. package/dist/{agent-invocations-D_YoNnAn.js → agent-invocations-BY60iNw-.js} +0 -4
  4. package/dist/{agent-runner-B-7S_DCS.js → agent-runner-BWmnJ0dD.js} +21 -21
  5. package/dist/api/schema.js +1 -1
  6. package/dist/api.js +23 -23
  7. package/dist/app.js +113 -83
  8. package/dist/{assistant-reply-DbPLvsnL.js → assistant-reply-B3J6ogAM.js} +1 -1
  9. package/dist/{briefs-D4SMqc-r.js → briefs-B_fgUFD2.js} +2 -2
  10. package/dist/{catalog-runtime-BQQiwwA7.js → catalog-runtime-TG5WF66H.js} +1 -1
  11. package/dist/cli/chat.js +15 -15
  12. package/dist/cli/check.js +3 -3
  13. package/dist/cli/main.js +2 -2
  14. package/dist/cli/plugins.js +4 -4
  15. package/dist/cli/snapshot-create.js +3 -3
  16. package/dist/cli/upgrade.js +3 -3
  17. package/dist/{client-ROZeVjq0.js → client-oBgOmQV6.js} +2 -2
  18. package/dist/{config-DNNkxfGS.js → config-CRlLncIj.js} +2 -2
  19. package/dist/{connections-DJV6mLrH.js → connections-BZAuDnYm.js} +9 -9
  20. package/dist/{conversation-privacy-B19umzIL.js → conversation-privacy-Dui3hTO-.js} +1 -1
  21. package/dist/{credential-sync-CEd2F5PS.js → credential-sync-9HiSpphh.js} +14 -14
  22. package/dist/{executor-_4bdoCxe.js → executor-B88oEqok.js} +41 -92
  23. package/dist/{images-BAN7DHuO.js → images-k8HewSp_.js} +2 -2
  24. package/dist/instrumentation.js +2 -2
  25. package/dist/{job-queue-DSQx1qFY.js → job-queue-B6KaQXY6.js} +1 -1
  26. package/dist/{logging-COUsTFIL.js → logging-B3nJLXT7.js} +1 -1
  27. package/dist/{message-CtDDEwwV.js → message-C9Wx3Rxx.js} +3 -3
  28. package/dist/nitro.js +3 -3
  29. package/dist/{oauth-callback-server-CCiKrS0s.js → oauth-callback-server-CetsCZng.js} +2 -2
  30. package/dist/{pending-auth-DDx3EU4M.js → pending-auth-m8aJlwP_.js} +2 -2
  31. package/dist/{profile-DP4LKL6V.js → profile-Dh73O6lZ.js} +4 -4
  32. package/dist/{registry-CeEpPna6.js → registry-C-jns0Be.js} +1 -1
  33. package/dist/{resolve-B5ma3igH.js → resolve-CDYCpS_U.js} +2 -2
  34. package/dist/{result-Da0RVuWG.js → result-sih-x_yN.js} +6 -6
  35. package/dist/{runner-se1W_jGZ.js → runner-CA43p74t.js} +9 -9
  36. package/dist/{sandbox-egress-signals-CS959-wm.js → sandbox-egress-signals-CxHHTu8e.js} +1 -1
  37. package/dist/{schema-C9Vnyb_f.js → schema-C-a9U34c.js} +1 -1
  38. package/dist/{session-stop-DlRDisF5.js → session-stop-DenN1GuJ.js} +11 -11
  39. package/dist/{skills-CSzgs0EC.js → skills-D_XDFkSx.js} +2 -2
  40. package/dist/{spawn-DT9fMjtd.js → spawn-CcWYt3Tl.js} +2 -2
  41. package/dist/{store-Dx1U69mm.js → store-CIs0Tr31.js} +6 -6
  42. package/dist/{task-queue-BX9YrIsw.js → task-queue-DAY-aQLX.js} +3 -3
  43. package/dist/{task-runner-CO55Olal.js → task-runner-BE6Jgt2u.js} +145 -127
  44. package/dist/{tasks-DwGlFX9i.js → tasks-DO9VM9cu.js} +15 -26
  45. package/dist/{thread-state-Ces6tXmB.js → thread-state-FreaCOZD.js} +7 -7
  46. package/dist/{turn-failure-response-B4VCvEQf.js → turn-failure-response-CJSt2ZSf.js} +7 -7
  47. package/dist/{turn-lifecycle-B1VV58Yo.js → turn-lifecycle-BXclEcfZ.js} +1 -1
  48. package/dist/{turn-session-routing-Dw2Kamg9.js → turn-session-routing-CItfUsjQ.js} +1 -1
  49. package/dist/{validation-yJF9LKOv.js → validation-MW8dmhF9.js} +1 -1
  50. package/dist/{version-CZYqvIFh.js → version-DcWD8xpq.js} +1 -1
  51. package/dist/version.js +1 -1
  52. package/dist/{viewer-D96vo_42.js → viewer-CGZiUVMU.js} +4 -13
  53. package/dist/{web-input-5mls-41-.js → web-input-Dpqh0oBt.js} +44 -52
  54. package/dist/{work-D2M2-zCO.js → work-DbA9xNO1.js} +9 -9
  55. package/dist/{worker-BwCpf8tB.js → worker-DuCs9-3G.js} +5 -5
  56. package/migrations/0056_automation_runs.sql +69 -0
  57. package/migrations/0057_drop_legacy_automation_tables.sql +10 -0
  58. package/migrations/meta/0056_snapshot.json +4280 -0
  59. package/migrations/meta/0057_snapshot.json +3618 -0
  60. package/migrations/meta/_journal.json +15 -1
  61. package/package.json +5 -5
@@ -0,0 +1,4280 @@
1
+ {
2
+ "id": "be595415-8b43-4cb3-b103-41e0440f8a2a",
3
+ "prevId": "4b7d91df-2a2e-4e0d-89b4-fd28f23c3ad4",
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_task_executions": {
724
+ "name": "junior_task_executions",
725
+ "schema": "",
726
+ "columns": {
727
+ "execution_id": {
728
+ "name": "execution_id",
729
+ "type": "text",
730
+ "primaryKey": false,
731
+ "notNull": true
732
+ },
733
+ "kind": {
734
+ "name": "kind",
735
+ "type": "text",
736
+ "primaryKey": false,
737
+ "notNull": true
738
+ },
739
+ "namespace": {
740
+ "name": "namespace",
741
+ "type": "text",
742
+ "primaryKey": false,
743
+ "notNull": true
744
+ },
745
+ "task_id": {
746
+ "name": "task_id",
747
+ "type": "text",
748
+ "primaryKey": false,
749
+ "notNull": true
750
+ },
751
+ "conversation_id": {
752
+ "name": "conversation_id",
753
+ "type": "text",
754
+ "primaryKey": false,
755
+ "notNull": false
756
+ },
757
+ "executed_at_ms": {
758
+ "name": "executed_at_ms",
759
+ "type": "bigint",
760
+ "primaryKey": false,
761
+ "notNull": true
762
+ },
763
+ "status": {
764
+ "name": "status",
765
+ "type": "text",
766
+ "primaryKey": false,
767
+ "notNull": true
768
+ }
769
+ },
770
+ "indexes": {
771
+ "junior_task_executions_task_time_idx": {
772
+ "name": "junior_task_executions_task_time_idx",
773
+ "columns": [
774
+ {
775
+ "expression": "kind",
776
+ "isExpression": false,
777
+ "asc": true,
778
+ "nulls": "last"
779
+ },
780
+ {
781
+ "expression": "namespace",
782
+ "isExpression": false,
783
+ "asc": true,
784
+ "nulls": "last"
785
+ },
786
+ {
787
+ "expression": "task_id",
788
+ "isExpression": false,
789
+ "asc": true,
790
+ "nulls": "last"
791
+ },
792
+ {
793
+ "expression": "executed_at_ms",
794
+ "isExpression": false,
795
+ "asc": true,
796
+ "nulls": "last"
797
+ }
798
+ ],
799
+ "isUnique": false,
800
+ "concurrently": false,
801
+ "method": "btree",
802
+ "with": {}
803
+ },
804
+ "junior_task_executions_time_kind_idx": {
805
+ "name": "junior_task_executions_time_kind_idx",
806
+ "columns": [
807
+ {
808
+ "expression": "executed_at_ms",
809
+ "isExpression": false,
810
+ "asc": true,
811
+ "nulls": "last"
812
+ },
813
+ {
814
+ "expression": "kind",
815
+ "isExpression": false,
816
+ "asc": true,
817
+ "nulls": "last"
818
+ }
819
+ ],
820
+ "isUnique": false,
821
+ "concurrently": false,
822
+ "method": "btree",
823
+ "with": {}
824
+ },
825
+ "junior_task_executions_conversation_time_idx": {
826
+ "name": "junior_task_executions_conversation_time_idx",
827
+ "columns": [
828
+ {
829
+ "expression": "conversation_id",
830
+ "isExpression": false,
831
+ "asc": true,
832
+ "nulls": "last"
833
+ },
834
+ {
835
+ "expression": "executed_at_ms",
836
+ "isExpression": false,
837
+ "asc": true,
838
+ "nulls": "last"
839
+ }
840
+ ],
841
+ "isUnique": false,
842
+ "concurrently": false,
843
+ "method": "btree",
844
+ "with": {}
845
+ }
846
+ },
847
+ "foreignKeys": {
848
+ "junior_task_executions_conversation_id_junior_conversations_conversation_id_fk": {
849
+ "name": "junior_task_executions_conversation_id_junior_conversations_conversation_id_fk",
850
+ "tableFrom": "junior_task_executions",
851
+ "tableTo": "junior_conversations",
852
+ "columnsFrom": [
853
+ "conversation_id"
854
+ ],
855
+ "columnsTo": [
856
+ "conversation_id"
857
+ ],
858
+ "onDelete": "no action",
859
+ "onUpdate": "no action"
860
+ }
861
+ },
862
+ "compositePrimaryKeys": {
863
+ "junior_task_executions_kind_namespace_execution_id_pk": {
864
+ "name": "junior_task_executions_kind_namespace_execution_id_pk",
865
+ "columns": [
866
+ "kind",
867
+ "namespace",
868
+ "execution_id"
869
+ ]
870
+ }
871
+ },
872
+ "uniqueConstraints": {},
873
+ "policies": {},
874
+ "checkConstraints": {
875
+ "junior_task_executions_kind_check": {
876
+ "name": "junior_task_executions_kind_check",
877
+ "value": "\"junior_task_executions\".\"kind\" in ('scheduled', 'event')"
878
+ },
879
+ "junior_task_executions_status_check": {
880
+ "name": "junior_task_executions_status_check",
881
+ "value": "\"junior_task_executions\".\"status\" in ('blocked', 'completed', 'failed')"
882
+ }
883
+ },
884
+ "isRLSEnabled": false
885
+ },
886
+ "public.junior_automation_runs": {
887
+ "name": "junior_automation_runs",
888
+ "schema": "",
889
+ "columns": {
890
+ "id": {
891
+ "name": "id",
892
+ "type": "text",
893
+ "primaryKey": true,
894
+ "notNull": true
895
+ },
896
+ "automation_id": {
897
+ "name": "automation_id",
898
+ "type": "text",
899
+ "primaryKey": false,
900
+ "notNull": true
901
+ },
902
+ "conversation_id": {
903
+ "name": "conversation_id",
904
+ "type": "text",
905
+ "primaryKey": false,
906
+ "notNull": false
907
+ },
908
+ "status": {
909
+ "name": "status",
910
+ "type": "text",
911
+ "primaryKey": false,
912
+ "notNull": true
913
+ },
914
+ "scheduled_for_ms": {
915
+ "name": "scheduled_for_ms",
916
+ "type": "bigint",
917
+ "primaryKey": false,
918
+ "notNull": false
919
+ },
920
+ "attempt": {
921
+ "name": "attempt",
922
+ "type": "integer",
923
+ "primaryKey": false,
924
+ "notNull": false
925
+ },
926
+ "claimed_at_ms": {
927
+ "name": "claimed_at_ms",
928
+ "type": "bigint",
929
+ "primaryKey": false,
930
+ "notNull": false
931
+ },
932
+ "dispatch_id": {
933
+ "name": "dispatch_id",
934
+ "type": "text",
935
+ "primaryKey": false,
936
+ "notNull": false
937
+ },
938
+ "started_at_ms": {
939
+ "name": "started_at_ms",
940
+ "type": "bigint",
941
+ "primaryKey": false,
942
+ "notNull": false
943
+ },
944
+ "completed_at_ms": {
945
+ "name": "completed_at_ms",
946
+ "type": "bigint",
947
+ "primaryKey": false,
948
+ "notNull": false
949
+ },
950
+ "error_message": {
951
+ "name": "error_message",
952
+ "type": "text",
953
+ "primaryKey": false,
954
+ "notNull": false
955
+ },
956
+ "result_message_ts": {
957
+ "name": "result_message_ts",
958
+ "type": "text",
959
+ "primaryKey": false,
960
+ "notNull": false
961
+ }
962
+ },
963
+ "indexes": {
964
+ "junior_automation_runs_automation_idx": {
965
+ "name": "junior_automation_runs_automation_idx",
966
+ "columns": [
967
+ {
968
+ "expression": "automation_id",
969
+ "isExpression": false,
970
+ "asc": true,
971
+ "nulls": "last"
972
+ },
973
+ {
974
+ "expression": "completed_at_ms",
975
+ "isExpression": false,
976
+ "asc": true,
977
+ "nulls": "last"
978
+ }
979
+ ],
980
+ "isUnique": false,
981
+ "concurrently": false,
982
+ "method": "btree",
983
+ "with": {}
984
+ },
985
+ "junior_automation_runs_completed_idx": {
986
+ "name": "junior_automation_runs_completed_idx",
987
+ "columns": [
988
+ {
989
+ "expression": "completed_at_ms",
990
+ "isExpression": false,
991
+ "asc": true,
992
+ "nulls": "last"
993
+ }
994
+ ],
995
+ "isUnique": false,
996
+ "concurrently": false,
997
+ "method": "btree",
998
+ "with": {}
999
+ },
1000
+ "junior_automation_runs_incomplete_idx": {
1001
+ "name": "junior_automation_runs_incomplete_idx",
1002
+ "columns": [
1003
+ {
1004
+ "expression": "automation_id",
1005
+ "isExpression": false,
1006
+ "asc": true,
1007
+ "nulls": "last"
1008
+ },
1009
+ {
1010
+ "expression": "scheduled_for_ms",
1011
+ "isExpression": false,
1012
+ "asc": true,
1013
+ "nulls": "last"
1014
+ }
1015
+ ],
1016
+ "isUnique": false,
1017
+ "where": "\"junior_automation_runs\".\"status\" in ('pending', 'running')",
1018
+ "concurrently": false,
1019
+ "method": "btree",
1020
+ "with": {}
1021
+ }
1022
+ },
1023
+ "foreignKeys": {
1024
+ "junior_automation_runs_automation_id_junior_automations_id_fk": {
1025
+ "name": "junior_automation_runs_automation_id_junior_automations_id_fk",
1026
+ "tableFrom": "junior_automation_runs",
1027
+ "tableTo": "junior_automations",
1028
+ "columnsFrom": [
1029
+ "automation_id"
1030
+ ],
1031
+ "columnsTo": [
1032
+ "id"
1033
+ ],
1034
+ "onDelete": "cascade",
1035
+ "onUpdate": "no action"
1036
+ },
1037
+ "junior_automation_runs_conversation_id_junior_conversations_conversation_id_fk": {
1038
+ "name": "junior_automation_runs_conversation_id_junior_conversations_conversation_id_fk",
1039
+ "tableFrom": "junior_automation_runs",
1040
+ "tableTo": "junior_conversations",
1041
+ "columnsFrom": [
1042
+ "conversation_id"
1043
+ ],
1044
+ "columnsTo": [
1045
+ "conversation_id"
1046
+ ],
1047
+ "onDelete": "no action",
1048
+ "onUpdate": "no action"
1049
+ }
1050
+ },
1051
+ "compositePrimaryKeys": {},
1052
+ "uniqueConstraints": {
1053
+ "junior_automation_runs_conversation_id_unique": {
1054
+ "name": "junior_automation_runs_conversation_id_unique",
1055
+ "nullsNotDistinct": false,
1056
+ "columns": [
1057
+ "conversation_id"
1058
+ ]
1059
+ }
1060
+ },
1061
+ "policies": {},
1062
+ "checkConstraints": {
1063
+ "junior_automation_runs_status_check": {
1064
+ "name": "junior_automation_runs_status_check",
1065
+ "value": "\"junior_automation_runs\".\"status\" in ('pending', 'running', 'completed', 'failed', 'blocked', 'skipped')"
1066
+ }
1067
+ },
1068
+ "isRLSEnabled": false
1069
+ },
1070
+ "public.junior_automation_versions": {
1071
+ "name": "junior_automation_versions",
1072
+ "schema": "",
1073
+ "columns": {
1074
+ "kind": {
1075
+ "name": "kind",
1076
+ "type": "text",
1077
+ "primaryKey": false,
1078
+ "notNull": false
1079
+ },
1080
+ "automation_id": {
1081
+ "name": "automation_id",
1082
+ "type": "text",
1083
+ "primaryKey": false,
1084
+ "notNull": true
1085
+ },
1086
+ "version": {
1087
+ "name": "version",
1088
+ "type": "integer",
1089
+ "primaryKey": false,
1090
+ "notNull": true
1091
+ },
1092
+ "created_at_ms": {
1093
+ "name": "created_at_ms",
1094
+ "type": "bigint",
1095
+ "primaryKey": false,
1096
+ "notNull": true
1097
+ },
1098
+ "edited_by": {
1099
+ "name": "edited_by",
1100
+ "type": "jsonb",
1101
+ "primaryKey": false,
1102
+ "notNull": false
1103
+ },
1104
+ "definition": {
1105
+ "name": "definition",
1106
+ "type": "jsonb",
1107
+ "primaryKey": false,
1108
+ "notNull": true
1109
+ }
1110
+ },
1111
+ "indexes": {},
1112
+ "foreignKeys": {
1113
+ "junior_automation_versions_automation_id_fk": {
1114
+ "name": "junior_automation_versions_automation_id_fk",
1115
+ "tableFrom": "junior_automation_versions",
1116
+ "tableTo": "junior_automations",
1117
+ "columnsFrom": [
1118
+ "automation_id"
1119
+ ],
1120
+ "columnsTo": [
1121
+ "id"
1122
+ ],
1123
+ "onDelete": "cascade",
1124
+ "onUpdate": "no action"
1125
+ }
1126
+ },
1127
+ "compositePrimaryKeys": {
1128
+ "junior_automation_versions_pk": {
1129
+ "name": "junior_automation_versions_pk",
1130
+ "columns": [
1131
+ "automation_id",
1132
+ "version"
1133
+ ]
1134
+ }
1135
+ },
1136
+ "uniqueConstraints": {},
1137
+ "policies": {},
1138
+ "checkConstraints": {
1139
+ "junior_automation_versions_kind_check": {
1140
+ "name": "junior_automation_versions_kind_check",
1141
+ "value": "\"junior_automation_versions\".\"kind\" in ('scheduled', 'event')"
1142
+ }
1143
+ },
1144
+ "isRLSEnabled": false
1145
+ },
1146
+ "public.junior_automations": {
1147
+ "name": "junior_automations",
1148
+ "schema": "",
1149
+ "columns": {
1150
+ "id": {
1151
+ "name": "id",
1152
+ "type": "text",
1153
+ "primaryKey": true,
1154
+ "notNull": true
1155
+ },
1156
+ "kind": {
1157
+ "name": "kind",
1158
+ "type": "text",
1159
+ "primaryKey": false,
1160
+ "notNull": true
1161
+ },
1162
+ "team_id": {
1163
+ "name": "team_id",
1164
+ "type": "text",
1165
+ "primaryKey": false,
1166
+ "notNull": true
1167
+ },
1168
+ "channel_id": {
1169
+ "name": "channel_id",
1170
+ "type": "text",
1171
+ "primaryKey": false,
1172
+ "notNull": true
1173
+ },
1174
+ "creator_slack_user_id": {
1175
+ "name": "creator_slack_user_id",
1176
+ "type": "text",
1177
+ "primaryKey": false,
1178
+ "notNull": true
1179
+ },
1180
+ "creator_identity_id": {
1181
+ "name": "creator_identity_id",
1182
+ "type": "text",
1183
+ "primaryKey": false,
1184
+ "notNull": false
1185
+ },
1186
+ "status": {
1187
+ "name": "status",
1188
+ "type": "text",
1189
+ "primaryKey": false,
1190
+ "notNull": true
1191
+ },
1192
+ "status_reason": {
1193
+ "name": "status_reason",
1194
+ "type": "text",
1195
+ "primaryKey": false,
1196
+ "notNull": false
1197
+ },
1198
+ "title": {
1199
+ "name": "title",
1200
+ "type": "text",
1201
+ "primaryKey": false,
1202
+ "notNull": false
1203
+ },
1204
+ "instruction": {
1205
+ "name": "instruction",
1206
+ "type": "text",
1207
+ "primaryKey": false,
1208
+ "notNull": true
1209
+ },
1210
+ "created_at_ms": {
1211
+ "name": "created_at_ms",
1212
+ "type": "bigint",
1213
+ "primaryKey": false,
1214
+ "notNull": true
1215
+ },
1216
+ "next_run_at_ms": {
1217
+ "name": "next_run_at_ms",
1218
+ "type": "bigint",
1219
+ "primaryKey": false,
1220
+ "notNull": false
1221
+ },
1222
+ "run_now_at_ms": {
1223
+ "name": "run_now_at_ms",
1224
+ "type": "bigint",
1225
+ "primaryKey": false,
1226
+ "notNull": false
1227
+ },
1228
+ "namespace": {
1229
+ "name": "namespace",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": false
1233
+ },
1234
+ "identifier": {
1235
+ "name": "identifier",
1236
+ "type": "text",
1237
+ "primaryKey": false,
1238
+ "notNull": false
1239
+ },
1240
+ "record": {
1241
+ "name": "record",
1242
+ "type": "jsonb",
1243
+ "primaryKey": false,
1244
+ "notNull": true
1245
+ }
1246
+ },
1247
+ "indexes": {
1248
+ "junior_automations_team_idx": {
1249
+ "name": "junior_automations_team_idx",
1250
+ "columns": [
1251
+ {
1252
+ "expression": "team_id",
1253
+ "isExpression": false,
1254
+ "asc": true,
1255
+ "nulls": "last"
1256
+ },
1257
+ {
1258
+ "expression": "created_at_ms",
1259
+ "isExpression": false,
1260
+ "asc": true,
1261
+ "nulls": "last"
1262
+ },
1263
+ {
1264
+ "expression": "id",
1265
+ "isExpression": false,
1266
+ "asc": true,
1267
+ "nulls": "last"
1268
+ }
1269
+ ],
1270
+ "isUnique": false,
1271
+ "where": "\"junior_automations\".\"status\" <> 'deleted'",
1272
+ "concurrently": false,
1273
+ "method": "btree",
1274
+ "with": {}
1275
+ },
1276
+ "junior_automations_creator_idx": {
1277
+ "name": "junior_automations_creator_idx",
1278
+ "columns": [
1279
+ {
1280
+ "expression": "team_id",
1281
+ "isExpression": false,
1282
+ "asc": true,
1283
+ "nulls": "last"
1284
+ },
1285
+ {
1286
+ "expression": "creator_slack_user_id",
1287
+ "isExpression": false,
1288
+ "asc": true,
1289
+ "nulls": "last"
1290
+ },
1291
+ {
1292
+ "expression": "created_at_ms",
1293
+ "isExpression": false,
1294
+ "asc": true,
1295
+ "nulls": "last"
1296
+ },
1297
+ {
1298
+ "expression": "id",
1299
+ "isExpression": false,
1300
+ "asc": true,
1301
+ "nulls": "last"
1302
+ }
1303
+ ],
1304
+ "isUnique": false,
1305
+ "concurrently": false,
1306
+ "method": "btree",
1307
+ "with": {}
1308
+ },
1309
+ "junior_automations_creator_identity_idx": {
1310
+ "name": "junior_automations_creator_identity_idx",
1311
+ "columns": [
1312
+ {
1313
+ "expression": "creator_identity_id",
1314
+ "isExpression": false,
1315
+ "asc": true,
1316
+ "nulls": "last"
1317
+ },
1318
+ {
1319
+ "expression": "created_at_ms",
1320
+ "isExpression": false,
1321
+ "asc": true,
1322
+ "nulls": "last"
1323
+ },
1324
+ {
1325
+ "expression": "id",
1326
+ "isExpression": false,
1327
+ "asc": true,
1328
+ "nulls": "last"
1329
+ }
1330
+ ],
1331
+ "isUnique": false,
1332
+ "where": "\"junior_automations\".\"creator_identity_id\" IS NOT NULL",
1333
+ "concurrently": false,
1334
+ "method": "btree",
1335
+ "with": {}
1336
+ },
1337
+ "junior_automations_run_now_due_idx": {
1338
+ "name": "junior_automations_run_now_due_idx",
1339
+ "columns": [
1340
+ {
1341
+ "expression": "run_now_at_ms",
1342
+ "isExpression": false,
1343
+ "asc": true,
1344
+ "nulls": "last"
1345
+ },
1346
+ {
1347
+ "expression": "created_at_ms",
1348
+ "isExpression": false,
1349
+ "asc": true,
1350
+ "nulls": "last"
1351
+ },
1352
+ {
1353
+ "expression": "id",
1354
+ "isExpression": false,
1355
+ "asc": true,
1356
+ "nulls": "last"
1357
+ }
1358
+ ],
1359
+ "isUnique": false,
1360
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"run_now_at_ms\" IS NOT NULL",
1361
+ "concurrently": false,
1362
+ "method": "btree",
1363
+ "with": {}
1364
+ },
1365
+ "junior_automations_next_run_due_idx": {
1366
+ "name": "junior_automations_next_run_due_idx",
1367
+ "columns": [
1368
+ {
1369
+ "expression": "next_run_at_ms",
1370
+ "isExpression": false,
1371
+ "asc": true,
1372
+ "nulls": "last"
1373
+ },
1374
+ {
1375
+ "expression": "created_at_ms",
1376
+ "isExpression": false,
1377
+ "asc": true,
1378
+ "nulls": "last"
1379
+ },
1380
+ {
1381
+ "expression": "id",
1382
+ "isExpression": false,
1383
+ "asc": true,
1384
+ "nulls": "last"
1385
+ }
1386
+ ],
1387
+ "isUnique": false,
1388
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"next_run_at_ms\" IS NOT NULL",
1389
+ "concurrently": false,
1390
+ "method": "btree",
1391
+ "with": {}
1392
+ },
1393
+ "junior_automations_match_idx": {
1394
+ "name": "junior_automations_match_idx",
1395
+ "columns": [
1396
+ {
1397
+ "expression": "namespace",
1398
+ "isExpression": false,
1399
+ "asc": true,
1400
+ "nulls": "last"
1401
+ },
1402
+ {
1403
+ "expression": "identifier",
1404
+ "isExpression": false,
1405
+ "asc": true,
1406
+ "nulls": "last"
1407
+ },
1408
+ {
1409
+ "expression": "created_at_ms",
1410
+ "isExpression": false,
1411
+ "asc": true,
1412
+ "nulls": "last"
1413
+ },
1414
+ {
1415
+ "expression": "id",
1416
+ "isExpression": false,
1417
+ "asc": true,
1418
+ "nulls": "last"
1419
+ }
1420
+ ],
1421
+ "isUnique": false,
1422
+ "where": "\"junior_automations\".\"status\" <> 'deleted'",
1423
+ "concurrently": false,
1424
+ "method": "btree",
1425
+ "with": {}
1426
+ }
1427
+ },
1428
+ "foreignKeys": {},
1429
+ "compositePrimaryKeys": {},
1430
+ "uniqueConstraints": {},
1431
+ "policies": {},
1432
+ "checkConstraints": {
1433
+ "junior_automations_kind_check": {
1434
+ "name": "junior_automations_kind_check",
1435
+ "value": "\"junior_automations\".\"kind\" in ('scheduled', 'event')"
1436
+ },
1437
+ "junior_automations_status_check": {
1438
+ "name": "junior_automations_status_check",
1439
+ "value": "\"junior_automations\".\"status\" in ('active', 'blocked', 'paused', 'completed', 'deleted')"
1440
+ },
1441
+ "junior_automations_record_check": {
1442
+ "name": "junior_automations_record_check",
1443
+ "value": "jsonb_typeof(\"junior_automations\".\"record\") = 'object'"
1444
+ },
1445
+ "junior_automations_trigger_check": {
1446
+ "name": "junior_automations_trigger_check",
1447
+ "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')"
1448
+ }
1449
+ },
1450
+ "isRLSEnabled": false
1451
+ },
1452
+ "public.junior_code_changes": {
1453
+ "name": "junior_code_changes",
1454
+ "schema": "",
1455
+ "columns": {
1456
+ "id": {
1457
+ "name": "id",
1458
+ "type": "uuid",
1459
+ "primaryKey": true,
1460
+ "notNull": true
1461
+ },
1462
+ "closed_at": {
1463
+ "name": "closed_at",
1464
+ "type": "timestamp with time zone",
1465
+ "primaryKey": false,
1466
+ "notNull": false
1467
+ },
1468
+ "conversation_ids": {
1469
+ "name": "conversation_ids",
1470
+ "type": "text[]",
1471
+ "primaryKey": false,
1472
+ "notNull": true,
1473
+ "default": "ARRAY[]::text[]"
1474
+ },
1475
+ "merged_at": {
1476
+ "name": "merged_at",
1477
+ "type": "timestamp with time zone",
1478
+ "primaryKey": false,
1479
+ "notNull": false
1480
+ },
1481
+ "number": {
1482
+ "name": "number",
1483
+ "type": "integer",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ },
1487
+ "opened_at": {
1488
+ "name": "opened_at",
1489
+ "type": "timestamp with time zone",
1490
+ "primaryKey": false,
1491
+ "notNull": true
1492
+ },
1493
+ "provider": {
1494
+ "name": "provider",
1495
+ "type": "text",
1496
+ "primaryKey": false,
1497
+ "notNull": true
1498
+ },
1499
+ "provider_id": {
1500
+ "name": "provider_id",
1501
+ "type": "text",
1502
+ "primaryKey": false,
1503
+ "notNull": true
1504
+ },
1505
+ "repository_id": {
1506
+ "name": "repository_id",
1507
+ "type": "uuid",
1508
+ "primaryKey": false,
1509
+ "notNull": true
1510
+ },
1511
+ "state": {
1512
+ "name": "state",
1513
+ "type": "text",
1514
+ "primaryKey": false,
1515
+ "notNull": true
1516
+ },
1517
+ "title": {
1518
+ "name": "title",
1519
+ "type": "text",
1520
+ "primaryKey": false,
1521
+ "notNull": false
1522
+ },
1523
+ "updated_at": {
1524
+ "name": "updated_at",
1525
+ "type": "timestamp with time zone",
1526
+ "primaryKey": false,
1527
+ "notNull": true
1528
+ },
1529
+ "url": {
1530
+ "name": "url",
1531
+ "type": "text",
1532
+ "primaryKey": false,
1533
+ "notNull": false
1534
+ }
1535
+ },
1536
+ "indexes": {
1537
+ "junior_code_changes_provider_id_idx": {
1538
+ "name": "junior_code_changes_provider_id_idx",
1539
+ "columns": [
1540
+ {
1541
+ "expression": "provider",
1542
+ "isExpression": false,
1543
+ "asc": true,
1544
+ "nulls": "last"
1545
+ },
1546
+ {
1547
+ "expression": "provider_id",
1548
+ "isExpression": false,
1549
+ "asc": true,
1550
+ "nulls": "last"
1551
+ }
1552
+ ],
1553
+ "isUnique": true,
1554
+ "concurrently": false,
1555
+ "method": "btree",
1556
+ "with": {}
1557
+ },
1558
+ "junior_code_changes_opened_at_idx": {
1559
+ "name": "junior_code_changes_opened_at_idx",
1560
+ "columns": [
1561
+ {
1562
+ "expression": "opened_at",
1563
+ "isExpression": false,
1564
+ "asc": true,
1565
+ "nulls": "last"
1566
+ }
1567
+ ],
1568
+ "isUnique": false,
1569
+ "concurrently": false,
1570
+ "method": "btree",
1571
+ "with": {}
1572
+ },
1573
+ "junior_code_changes_merged_at_idx": {
1574
+ "name": "junior_code_changes_merged_at_idx",
1575
+ "columns": [
1576
+ {
1577
+ "expression": "merged_at",
1578
+ "isExpression": false,
1579
+ "asc": true,
1580
+ "nulls": "last"
1581
+ }
1582
+ ],
1583
+ "isUnique": false,
1584
+ "concurrently": false,
1585
+ "method": "btree",
1586
+ "with": {}
1587
+ },
1588
+ "junior_code_changes_closed_at_idx": {
1589
+ "name": "junior_code_changes_closed_at_idx",
1590
+ "columns": [
1591
+ {
1592
+ "expression": "closed_at",
1593
+ "isExpression": false,
1594
+ "asc": true,
1595
+ "nulls": "last"
1596
+ }
1597
+ ],
1598
+ "isUnique": false,
1599
+ "concurrently": false,
1600
+ "method": "btree",
1601
+ "with": {}
1602
+ },
1603
+ "junior_code_changes_open_idx": {
1604
+ "name": "junior_code_changes_open_idx",
1605
+ "columns": [
1606
+ {
1607
+ "expression": "id",
1608
+ "isExpression": false,
1609
+ "asc": true,
1610
+ "nulls": "last"
1611
+ }
1612
+ ],
1613
+ "isUnique": false,
1614
+ "where": "\"junior_code_changes\".\"state\" = 'open'",
1615
+ "concurrently": false,
1616
+ "method": "btree",
1617
+ "with": {}
1618
+ }
1619
+ },
1620
+ "foreignKeys": {
1621
+ "junior_code_changes_repository_id_junior_code_repositories_id_fk": {
1622
+ "name": "junior_code_changes_repository_id_junior_code_repositories_id_fk",
1623
+ "tableFrom": "junior_code_changes",
1624
+ "tableTo": "junior_code_repositories",
1625
+ "columnsFrom": [
1626
+ "repository_id"
1627
+ ],
1628
+ "columnsTo": [
1629
+ "id"
1630
+ ],
1631
+ "onDelete": "cascade",
1632
+ "onUpdate": "no action"
1633
+ }
1634
+ },
1635
+ "compositePrimaryKeys": {},
1636
+ "uniqueConstraints": {},
1637
+ "policies": {},
1638
+ "checkConstraints": {},
1639
+ "isRLSEnabled": false
1640
+ },
1641
+ "public.junior_code_repositories": {
1642
+ "name": "junior_code_repositories",
1643
+ "schema": "",
1644
+ "columns": {
1645
+ "id": {
1646
+ "name": "id",
1647
+ "type": "uuid",
1648
+ "primaryKey": true,
1649
+ "notNull": true
1650
+ },
1651
+ "name": {
1652
+ "name": "name",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": true
1656
+ },
1657
+ "provider": {
1658
+ "name": "provider",
1659
+ "type": "text",
1660
+ "primaryKey": false,
1661
+ "notNull": true
1662
+ },
1663
+ "provider_id": {
1664
+ "name": "provider_id",
1665
+ "type": "text",
1666
+ "primaryKey": false,
1667
+ "notNull": true
1668
+ },
1669
+ "url": {
1670
+ "name": "url",
1671
+ "type": "text",
1672
+ "primaryKey": false,
1673
+ "notNull": false
1674
+ },
1675
+ "updated_at": {
1676
+ "name": "updated_at",
1677
+ "type": "timestamp with time zone",
1678
+ "primaryKey": false,
1679
+ "notNull": true
1680
+ }
1681
+ },
1682
+ "indexes": {
1683
+ "junior_code_repositories_provider_id_idx": {
1684
+ "name": "junior_code_repositories_provider_id_idx",
1685
+ "columns": [
1686
+ {
1687
+ "expression": "provider",
1688
+ "isExpression": false,
1689
+ "asc": true,
1690
+ "nulls": "last"
1691
+ },
1692
+ {
1693
+ "expression": "provider_id",
1694
+ "isExpression": false,
1695
+ "asc": true,
1696
+ "nulls": "last"
1697
+ }
1698
+ ],
1699
+ "isUnique": true,
1700
+ "concurrently": false,
1701
+ "method": "btree",
1702
+ "with": {}
1703
+ }
1704
+ },
1705
+ "foreignKeys": {},
1706
+ "compositePrimaryKeys": {},
1707
+ "uniqueConstraints": {},
1708
+ "policies": {},
1709
+ "checkConstraints": {},
1710
+ "isRLSEnabled": false
1711
+ },
1712
+ "public.junior_conversation_annotations": {
1713
+ "name": "junior_conversation_annotations",
1714
+ "schema": "",
1715
+ "columns": {
1716
+ "conversation_id": {
1717
+ "name": "conversation_id",
1718
+ "type": "text",
1719
+ "primaryKey": false,
1720
+ "notNull": true
1721
+ },
1722
+ "plugin": {
1723
+ "name": "plugin",
1724
+ "type": "text",
1725
+ "primaryKey": false,
1726
+ "notNull": true
1727
+ },
1728
+ "kind": {
1729
+ "name": "kind",
1730
+ "type": "text",
1731
+ "primaryKey": false,
1732
+ "notNull": true
1733
+ },
1734
+ "key": {
1735
+ "name": "key",
1736
+ "type": "text",
1737
+ "primaryKey": false,
1738
+ "notNull": true
1739
+ },
1740
+ "annotation_json": {
1741
+ "name": "annotation_json",
1742
+ "type": "jsonb",
1743
+ "primaryKey": false,
1744
+ "notNull": true
1745
+ },
1746
+ "created_at": {
1747
+ "name": "created_at",
1748
+ "type": "timestamp with time zone",
1749
+ "primaryKey": false,
1750
+ "notNull": true
1751
+ },
1752
+ "updated_at": {
1753
+ "name": "updated_at",
1754
+ "type": "timestamp with time zone",
1755
+ "primaryKey": false,
1756
+ "notNull": true
1757
+ }
1758
+ },
1759
+ "indexes": {},
1760
+ "foreignKeys": {
1761
+ "junior_conversation_annotations_conversation_id_fk": {
1762
+ "name": "junior_conversation_annotations_conversation_id_fk",
1763
+ "tableFrom": "junior_conversation_annotations",
1764
+ "tableTo": "junior_conversations",
1765
+ "columnsFrom": [
1766
+ "conversation_id"
1767
+ ],
1768
+ "columnsTo": [
1769
+ "conversation_id"
1770
+ ],
1771
+ "onDelete": "cascade",
1772
+ "onUpdate": "no action"
1773
+ }
1774
+ },
1775
+ "compositePrimaryKeys": {
1776
+ "junior_conversation_annotations_pk": {
1777
+ "name": "junior_conversation_annotations_pk",
1778
+ "columns": [
1779
+ "conversation_id",
1780
+ "plugin",
1781
+ "kind",
1782
+ "key"
1783
+ ]
1784
+ }
1785
+ },
1786
+ "uniqueConstraints": {},
1787
+ "policies": {},
1788
+ "checkConstraints": {},
1789
+ "isRLSEnabled": false
1790
+ },
1791
+ "public.junior_conversation_bindings": {
1792
+ "name": "junior_conversation_bindings",
1793
+ "schema": "",
1794
+ "columns": {
1795
+ "conversation_id": {
1796
+ "name": "conversation_id",
1797
+ "type": "text",
1798
+ "primaryKey": false,
1799
+ "notNull": true
1800
+ },
1801
+ "provider": {
1802
+ "name": "provider",
1803
+ "type": "text",
1804
+ "primaryKey": false,
1805
+ "notNull": true
1806
+ },
1807
+ "provider_tenant_id": {
1808
+ "name": "provider_tenant_id",
1809
+ "type": "text",
1810
+ "primaryKey": false,
1811
+ "notNull": true,
1812
+ "default": "''"
1813
+ },
1814
+ "provider_destination_id": {
1815
+ "name": "provider_destination_id",
1816
+ "type": "text",
1817
+ "primaryKey": false,
1818
+ "notNull": true
1819
+ },
1820
+ "provider_conversation_id": {
1821
+ "name": "provider_conversation_id",
1822
+ "type": "text",
1823
+ "primaryKey": false,
1824
+ "notNull": true
1825
+ },
1826
+ "created_at": {
1827
+ "name": "created_at",
1828
+ "type": "timestamp with time zone",
1829
+ "primaryKey": false,
1830
+ "notNull": true
1831
+ }
1832
+ },
1833
+ "indexes": {
1834
+ "junior_conversation_bindings_conversation_idx": {
1835
+ "name": "junior_conversation_bindings_conversation_idx",
1836
+ "columns": [
1837
+ {
1838
+ "expression": "conversation_id",
1839
+ "isExpression": false,
1840
+ "asc": true,
1841
+ "nulls": "last"
1842
+ }
1843
+ ],
1844
+ "isUnique": false,
1845
+ "concurrently": false,
1846
+ "method": "btree",
1847
+ "with": {}
1848
+ }
1849
+ },
1850
+ "foreignKeys": {
1851
+ "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk": {
1852
+ "name": "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk",
1853
+ "tableFrom": "junior_conversation_bindings",
1854
+ "tableTo": "junior_conversations",
1855
+ "columnsFrom": [
1856
+ "conversation_id"
1857
+ ],
1858
+ "columnsTo": [
1859
+ "conversation_id"
1860
+ ],
1861
+ "onDelete": "no action",
1862
+ "onUpdate": "no action"
1863
+ }
1864
+ },
1865
+ "compositePrimaryKeys": {
1866
+ "junior_conversation_bindings_provider_conversation_pk": {
1867
+ "name": "junior_conversation_bindings_provider_conversation_pk",
1868
+ "columns": [
1869
+ "provider",
1870
+ "provider_tenant_id",
1871
+ "provider_destination_id",
1872
+ "provider_conversation_id"
1873
+ ]
1874
+ }
1875
+ },
1876
+ "uniqueConstraints": {},
1877
+ "policies": {},
1878
+ "checkConstraints": {},
1879
+ "isRLSEnabled": false
1880
+ },
1881
+ "public.junior_conversation_briefs": {
1882
+ "name": "junior_conversation_briefs",
1883
+ "schema": "",
1884
+ "columns": {
1885
+ "conversation_id": {
1886
+ "name": "conversation_id",
1887
+ "type": "text",
1888
+ "primaryKey": false,
1889
+ "notNull": true
1890
+ },
1891
+ "version": {
1892
+ "name": "version",
1893
+ "type": "integer",
1894
+ "primaryKey": false,
1895
+ "notNull": true
1896
+ },
1897
+ "turn_id": {
1898
+ "name": "turn_id",
1899
+ "type": "text",
1900
+ "primaryKey": false,
1901
+ "notNull": true
1902
+ },
1903
+ "through_seq": {
1904
+ "name": "through_seq",
1905
+ "type": "integer",
1906
+ "primaryKey": false,
1907
+ "notNull": true
1908
+ },
1909
+ "content": {
1910
+ "name": "content",
1911
+ "type": "jsonb",
1912
+ "primaryKey": false,
1913
+ "notNull": true
1914
+ },
1915
+ "search_text": {
1916
+ "name": "search_text",
1917
+ "type": "text",
1918
+ "primaryKey": false,
1919
+ "notNull": true
1920
+ },
1921
+ "model_id": {
1922
+ "name": "model_id",
1923
+ "type": "text",
1924
+ "primaryKey": false,
1925
+ "notNull": true
1926
+ },
1927
+ "cost_usd": {
1928
+ "name": "cost_usd",
1929
+ "type": "double precision",
1930
+ "primaryKey": false,
1931
+ "notNull": false
1932
+ },
1933
+ "created_at": {
1934
+ "name": "created_at",
1935
+ "type": "timestamp with time zone",
1936
+ "primaryKey": false,
1937
+ "notNull": true,
1938
+ "default": "now()"
1939
+ }
1940
+ },
1941
+ "indexes": {
1942
+ "junior_conversation_briefs_conversation_turn_idx": {
1943
+ "name": "junior_conversation_briefs_conversation_turn_idx",
1944
+ "columns": [
1945
+ {
1946
+ "expression": "conversation_id",
1947
+ "isExpression": false,
1948
+ "asc": true,
1949
+ "nulls": "last"
1950
+ },
1951
+ {
1952
+ "expression": "turn_id",
1953
+ "isExpression": false,
1954
+ "asc": true,
1955
+ "nulls": "last"
1956
+ }
1957
+ ],
1958
+ "isUnique": true,
1959
+ "concurrently": false,
1960
+ "method": "btree",
1961
+ "with": {}
1962
+ },
1963
+ "junior_conversation_briefs_conversation_version_idx": {
1964
+ "name": "junior_conversation_briefs_conversation_version_idx",
1965
+ "columns": [
1966
+ {
1967
+ "expression": "conversation_id",
1968
+ "isExpression": false,
1969
+ "asc": true,
1970
+ "nulls": "last"
1971
+ },
1972
+ {
1973
+ "expression": "version",
1974
+ "isExpression": false,
1975
+ "asc": false,
1976
+ "nulls": "last"
1977
+ }
1978
+ ],
1979
+ "isUnique": false,
1980
+ "concurrently": false,
1981
+ "method": "btree",
1982
+ "with": {}
1983
+ },
1984
+ "junior_conversation_briefs_search_idx": {
1985
+ "name": "junior_conversation_briefs_search_idx",
1986
+ "columns": [
1987
+ {
1988
+ "expression": "to_tsvector('english', \"search_text\")",
1989
+ "asc": true,
1990
+ "isExpression": true,
1991
+ "nulls": "last"
1992
+ }
1993
+ ],
1994
+ "isUnique": false,
1995
+ "concurrently": false,
1996
+ "method": "gin",
1997
+ "with": {}
1998
+ }
1999
+ },
2000
+ "foreignKeys": {
2001
+ "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk": {
2002
+ "name": "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk",
2003
+ "tableFrom": "junior_conversation_briefs",
2004
+ "tableTo": "junior_conversations",
2005
+ "columnsFrom": [
2006
+ "conversation_id"
2007
+ ],
2008
+ "columnsTo": [
2009
+ "conversation_id"
2010
+ ],
2011
+ "onDelete": "cascade",
2012
+ "onUpdate": "no action"
2013
+ }
2014
+ },
2015
+ "compositePrimaryKeys": {
2016
+ "junior_conversation_briefs_conversation_id_version_pk": {
2017
+ "name": "junior_conversation_briefs_conversation_id_version_pk",
2018
+ "columns": [
2019
+ "conversation_id",
2020
+ "version"
2021
+ ]
2022
+ }
2023
+ },
2024
+ "uniqueConstraints": {},
2025
+ "policies": {},
2026
+ "checkConstraints": {},
2027
+ "isRLSEnabled": false
2028
+ },
2029
+ "public.junior_conversation_events": {
2030
+ "name": "junior_conversation_events",
2031
+ "schema": "",
2032
+ "columns": {
2033
+ "conversation_id": {
2034
+ "name": "conversation_id",
2035
+ "type": "text",
2036
+ "primaryKey": false,
2037
+ "notNull": true
2038
+ },
2039
+ "seq": {
2040
+ "name": "seq",
2041
+ "type": "integer",
2042
+ "primaryKey": false,
2043
+ "notNull": true
2044
+ },
2045
+ "history_version": {
2046
+ "name": "history_version",
2047
+ "type": "integer",
2048
+ "primaryKey": false,
2049
+ "notNull": true
2050
+ },
2051
+ "schema_version": {
2052
+ "name": "schema_version",
2053
+ "type": "integer",
2054
+ "primaryKey": false,
2055
+ "notNull": true,
2056
+ "default": 1
2057
+ },
2058
+ "idempotency_key": {
2059
+ "name": "idempotency_key",
2060
+ "type": "text",
2061
+ "primaryKey": false,
2062
+ "notNull": false
2063
+ },
2064
+ "type": {
2065
+ "name": "type",
2066
+ "type": "text",
2067
+ "primaryKey": false,
2068
+ "notNull": true
2069
+ },
2070
+ "payload": {
2071
+ "name": "payload",
2072
+ "type": "jsonb",
2073
+ "primaryKey": false,
2074
+ "notNull": true
2075
+ },
2076
+ "actor_identity_id": {
2077
+ "name": "actor_identity_id",
2078
+ "type": "text",
2079
+ "primaryKey": false,
2080
+ "notNull": false
2081
+ },
2082
+ "created_at": {
2083
+ "name": "created_at",
2084
+ "type": "timestamp with time zone",
2085
+ "primaryKey": false,
2086
+ "notNull": true
2087
+ }
2088
+ },
2089
+ "indexes": {
2090
+ "junior_conversation_events_history_version_idx": {
2091
+ "name": "junior_conversation_events_history_version_idx",
2092
+ "columns": [
2093
+ {
2094
+ "expression": "conversation_id",
2095
+ "isExpression": false,
2096
+ "asc": true,
2097
+ "nulls": "last"
2098
+ },
2099
+ {
2100
+ "expression": "history_version",
2101
+ "isExpression": false,
2102
+ "asc": true,
2103
+ "nulls": "last"
2104
+ },
2105
+ {
2106
+ "expression": "seq",
2107
+ "isExpression": false,
2108
+ "asc": true,
2109
+ "nulls": "last"
2110
+ }
2111
+ ],
2112
+ "isUnique": false,
2113
+ "concurrently": false,
2114
+ "method": "btree",
2115
+ "with": {}
2116
+ },
2117
+ "junior_conversation_events_type_idx": {
2118
+ "name": "junior_conversation_events_type_idx",
2119
+ "columns": [
2120
+ {
2121
+ "expression": "conversation_id",
2122
+ "isExpression": false,
2123
+ "asc": true,
2124
+ "nulls": "last"
2125
+ },
2126
+ {
2127
+ "expression": "type",
2128
+ "isExpression": false,
2129
+ "asc": true,
2130
+ "nulls": "last"
2131
+ },
2132
+ {
2133
+ "expression": "seq",
2134
+ "isExpression": false,
2135
+ "asc": true,
2136
+ "nulls": "last"
2137
+ }
2138
+ ],
2139
+ "isUnique": false,
2140
+ "concurrently": false,
2141
+ "method": "btree",
2142
+ "with": {}
2143
+ },
2144
+ "junior_conversation_events_actor_identity_idx": {
2145
+ "name": "junior_conversation_events_actor_identity_idx",
2146
+ "columns": [
2147
+ {
2148
+ "expression": "actor_identity_id",
2149
+ "isExpression": false,
2150
+ "asc": true,
2151
+ "nulls": "last"
2152
+ },
2153
+ {
2154
+ "expression": "conversation_id",
2155
+ "isExpression": false,
2156
+ "asc": true,
2157
+ "nulls": "last"
2158
+ },
2159
+ {
2160
+ "expression": "seq",
2161
+ "isExpression": false,
2162
+ "asc": true,
2163
+ "nulls": "last"
2164
+ }
2165
+ ],
2166
+ "isUnique": false,
2167
+ "concurrently": false,
2168
+ "method": "btree",
2169
+ "with": {}
2170
+ },
2171
+ "junior_conversation_events_message_search_idx": {
2172
+ "name": "junior_conversation_events_message_search_idx",
2173
+ "columns": [
2174
+ {
2175
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
2176
+ "asc": true,
2177
+ "isExpression": true,
2178
+ "nulls": "last"
2179
+ }
2180
+ ],
2181
+ "isUnique": false,
2182
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2183
+ "concurrently": false,
2184
+ "method": "gin",
2185
+ "with": {}
2186
+ },
2187
+ "junior_conversation_events_idempotency_idx": {
2188
+ "name": "junior_conversation_events_idempotency_idx",
2189
+ "columns": [
2190
+ {
2191
+ "expression": "conversation_id",
2192
+ "isExpression": false,
2193
+ "asc": true,
2194
+ "nulls": "last"
2195
+ },
2196
+ {
2197
+ "expression": "idempotency_key",
2198
+ "isExpression": false,
2199
+ "asc": true,
2200
+ "nulls": "last"
2201
+ }
2202
+ ],
2203
+ "isUnique": true,
2204
+ "concurrently": false,
2205
+ "method": "btree",
2206
+ "with": {}
2207
+ }
2208
+ },
2209
+ "foreignKeys": {
2210
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
2211
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
2212
+ "tableFrom": "junior_conversation_events",
2213
+ "tableTo": "junior_identities",
2214
+ "columnsFrom": [
2215
+ "actor_identity_id"
2216
+ ],
2217
+ "columnsTo": [
2218
+ "id"
2219
+ ],
2220
+ "onDelete": "no action",
2221
+ "onUpdate": "no action"
2222
+ },
2223
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
2224
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
2225
+ "tableFrom": "junior_conversation_events",
2226
+ "tableTo": "junior_conversations",
2227
+ "columnsFrom": [
2228
+ "conversation_id"
2229
+ ],
2230
+ "columnsTo": [
2231
+ "conversation_id"
2232
+ ],
2233
+ "onDelete": "no action",
2234
+ "onUpdate": "no action"
2235
+ }
2236
+ },
2237
+ "compositePrimaryKeys": {
2238
+ "junior_conversation_events_conversation_id_seq_pk": {
2239
+ "name": "junior_conversation_events_conversation_id_seq_pk",
2240
+ "columns": [
2241
+ "conversation_id",
2242
+ "seq"
2243
+ ]
2244
+ }
2245
+ },
2246
+ "uniqueConstraints": {},
2247
+ "policies": {},
2248
+ "checkConstraints": {},
2249
+ "isRLSEnabled": false
2250
+ },
2251
+ "public.junior_conversation_metrics": {
2252
+ "name": "junior_conversation_metrics",
2253
+ "schema": "",
2254
+ "columns": {
2255
+ "conversation_id": {
2256
+ "name": "conversation_id",
2257
+ "type": "text",
2258
+ "primaryKey": false,
2259
+ "notNull": true
2260
+ },
2261
+ "run_id": {
2262
+ "name": "run_id",
2263
+ "type": "text",
2264
+ "primaryKey": false,
2265
+ "notNull": true
2266
+ },
2267
+ "metric": {
2268
+ "name": "metric",
2269
+ "type": "text",
2270
+ "primaryKey": false,
2271
+ "notNull": true
2272
+ },
2273
+ "value": {
2274
+ "name": "value",
2275
+ "type": "double precision",
2276
+ "primaryKey": false,
2277
+ "notNull": true
2278
+ },
2279
+ "occurred_at": {
2280
+ "name": "occurred_at",
2281
+ "type": "timestamp with time zone",
2282
+ "primaryKey": false,
2283
+ "notNull": true
2284
+ },
2285
+ "updated_at": {
2286
+ "name": "updated_at",
2287
+ "type": "timestamp with time zone",
2288
+ "primaryKey": false,
2289
+ "notNull": true
2290
+ }
2291
+ },
2292
+ "indexes": {
2293
+ "junior_conversation_metrics_occurred_at_metric_idx": {
2294
+ "name": "junior_conversation_metrics_occurred_at_metric_idx",
2295
+ "columns": [
2296
+ {
2297
+ "expression": "occurred_at",
2298
+ "isExpression": false,
2299
+ "asc": true,
2300
+ "nulls": "last"
2301
+ },
2302
+ {
2303
+ "expression": "metric",
2304
+ "isExpression": false,
2305
+ "asc": true,
2306
+ "nulls": "last"
2307
+ }
2308
+ ],
2309
+ "isUnique": false,
2310
+ "concurrently": false,
2311
+ "method": "btree",
2312
+ "with": {}
2313
+ }
2314
+ },
2315
+ "foreignKeys": {
2316
+ "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk": {
2317
+ "name": "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
2318
+ "tableFrom": "junior_conversation_metrics",
2319
+ "tableTo": "junior_conversations",
2320
+ "columnsFrom": [
2321
+ "conversation_id"
2322
+ ],
2323
+ "columnsTo": [
2324
+ "conversation_id"
2325
+ ],
2326
+ "onDelete": "no action",
2327
+ "onUpdate": "no action"
2328
+ }
2329
+ },
2330
+ "compositePrimaryKeys": {
2331
+ "junior_conversation_metrics_conversation_id_run_id_metric_pk": {
2332
+ "name": "junior_conversation_metrics_conversation_id_run_id_metric_pk",
2333
+ "columns": [
2334
+ "conversation_id",
2335
+ "run_id",
2336
+ "metric"
2337
+ ]
2338
+ }
2339
+ },
2340
+ "uniqueConstraints": {},
2341
+ "policies": {},
2342
+ "checkConstraints": {},
2343
+ "isRLSEnabled": false
2344
+ },
2345
+ "public.junior_conversation_participants": {
2346
+ "name": "junior_conversation_participants",
2347
+ "schema": "",
2348
+ "columns": {
2349
+ "user_id": {
2350
+ "name": "user_id",
2351
+ "type": "text",
2352
+ "primaryKey": false,
2353
+ "notNull": true
2354
+ },
2355
+ "root_conversation_id": {
2356
+ "name": "root_conversation_id",
2357
+ "type": "text",
2358
+ "primaryKey": false,
2359
+ "notNull": true
2360
+ },
2361
+ "last_message_at": {
2362
+ "name": "last_message_at",
2363
+ "type": "timestamp with time zone",
2364
+ "primaryKey": false,
2365
+ "notNull": true
2366
+ },
2367
+ "archived_at": {
2368
+ "name": "archived_at",
2369
+ "type": "timestamp with time zone",
2370
+ "primaryKey": false,
2371
+ "notNull": false
2372
+ }
2373
+ },
2374
+ "indexes": {
2375
+ "junior_conversation_participants_user_activity_idx": {
2376
+ "name": "junior_conversation_participants_user_activity_idx",
2377
+ "columns": [
2378
+ {
2379
+ "expression": "user_id",
2380
+ "isExpression": false,
2381
+ "asc": true,
2382
+ "nulls": "last"
2383
+ },
2384
+ {
2385
+ "expression": "last_message_at",
2386
+ "isExpression": false,
2387
+ "asc": false,
2388
+ "nulls": "last"
2389
+ }
2390
+ ],
2391
+ "isUnique": false,
2392
+ "concurrently": false,
2393
+ "method": "btree",
2394
+ "with": {}
2395
+ },
2396
+ "junior_conversation_participants_root_idx": {
2397
+ "name": "junior_conversation_participants_root_idx",
2398
+ "columns": [
2399
+ {
2400
+ "expression": "root_conversation_id",
2401
+ "isExpression": false,
2402
+ "asc": true,
2403
+ "nulls": "last"
2404
+ }
2405
+ ],
2406
+ "isUnique": false,
2407
+ "concurrently": false,
2408
+ "method": "btree",
2409
+ "with": {}
2410
+ }
2411
+ },
2412
+ "foreignKeys": {
2413
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
2414
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
2415
+ "tableFrom": "junior_conversation_participants",
2416
+ "tableTo": "junior_users",
2417
+ "columnsFrom": [
2418
+ "user_id"
2419
+ ],
2420
+ "columnsTo": [
2421
+ "id"
2422
+ ],
2423
+ "onDelete": "no action",
2424
+ "onUpdate": "no action"
2425
+ },
2426
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
2427
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
2428
+ "tableFrom": "junior_conversation_participants",
2429
+ "tableTo": "junior_conversations",
2430
+ "columnsFrom": [
2431
+ "root_conversation_id"
2432
+ ],
2433
+ "columnsTo": [
2434
+ "conversation_id"
2435
+ ],
2436
+ "onDelete": "no action",
2437
+ "onUpdate": "no action"
2438
+ }
2439
+ },
2440
+ "compositePrimaryKeys": {
2441
+ "junior_conversation_participants_user_root_pk": {
2442
+ "name": "junior_conversation_participants_user_root_pk",
2443
+ "columns": [
2444
+ "user_id",
2445
+ "root_conversation_id"
2446
+ ]
2447
+ }
2448
+ },
2449
+ "uniqueConstraints": {},
2450
+ "policies": {},
2451
+ "checkConstraints": {},
2452
+ "isRLSEnabled": false
2453
+ },
2454
+ "public.junior_conversations": {
2455
+ "name": "junior_conversations",
2456
+ "schema": "",
2457
+ "columns": {
2458
+ "conversation_id": {
2459
+ "name": "conversation_id",
2460
+ "type": "text",
2461
+ "primaryKey": true,
2462
+ "notNull": true
2463
+ },
2464
+ "schema_version": {
2465
+ "name": "schema_version",
2466
+ "type": "integer",
2467
+ "primaryKey": false,
2468
+ "notNull": true,
2469
+ "default": 1
2470
+ },
2471
+ "source": {
2472
+ "name": "source",
2473
+ "type": "text",
2474
+ "primaryKey": false,
2475
+ "notNull": false
2476
+ },
2477
+ "source_json": {
2478
+ "name": "source_json",
2479
+ "type": "jsonb",
2480
+ "primaryKey": false,
2481
+ "notNull": false
2482
+ },
2483
+ "origin_type": {
2484
+ "name": "origin_type",
2485
+ "type": "text",
2486
+ "primaryKey": false,
2487
+ "notNull": false
2488
+ },
2489
+ "origin_id": {
2490
+ "name": "origin_id",
2491
+ "type": "text",
2492
+ "primaryKey": false,
2493
+ "notNull": false
2494
+ },
2495
+ "origin_run_id": {
2496
+ "name": "origin_run_id",
2497
+ "type": "text",
2498
+ "primaryKey": false,
2499
+ "notNull": false
2500
+ },
2501
+ "location_json": {
2502
+ "name": "location_json",
2503
+ "type": "jsonb",
2504
+ "primaryKey": false,
2505
+ "notNull": false
2506
+ },
2507
+ "destination_id": {
2508
+ "name": "destination_id",
2509
+ "type": "text",
2510
+ "primaryKey": false,
2511
+ "notNull": false
2512
+ },
2513
+ "destination_json": {
2514
+ "name": "destination_json",
2515
+ "type": "jsonb",
2516
+ "primaryKey": false,
2517
+ "notNull": false
2518
+ },
2519
+ "actor_identity_id": {
2520
+ "name": "actor_identity_id",
2521
+ "type": "text",
2522
+ "primaryKey": false,
2523
+ "notNull": false
2524
+ },
2525
+ "creator_identity_id": {
2526
+ "name": "creator_identity_id",
2527
+ "type": "text",
2528
+ "primaryKey": false,
2529
+ "notNull": false
2530
+ },
2531
+ "credential_subject_identity_id": {
2532
+ "name": "credential_subject_identity_id",
2533
+ "type": "text",
2534
+ "primaryKey": false,
2535
+ "notNull": false
2536
+ },
2537
+ "actor_json": {
2538
+ "name": "actor_json",
2539
+ "type": "jsonb",
2540
+ "primaryKey": false,
2541
+ "notNull": false
2542
+ },
2543
+ "channel_name": {
2544
+ "name": "channel_name",
2545
+ "type": "text",
2546
+ "primaryKey": false,
2547
+ "notNull": false
2548
+ },
2549
+ "title": {
2550
+ "name": "title",
2551
+ "type": "text",
2552
+ "primaryKey": false,
2553
+ "notNull": false
2554
+ },
2555
+ "created_at": {
2556
+ "name": "created_at",
2557
+ "type": "timestamp with time zone",
2558
+ "primaryKey": false,
2559
+ "notNull": true
2560
+ },
2561
+ "last_activity_at": {
2562
+ "name": "last_activity_at",
2563
+ "type": "timestamp with time zone",
2564
+ "primaryKey": false,
2565
+ "notNull": true
2566
+ },
2567
+ "updated_at": {
2568
+ "name": "updated_at",
2569
+ "type": "timestamp with time zone",
2570
+ "primaryKey": false,
2571
+ "notNull": true
2572
+ },
2573
+ "execution_updated_at": {
2574
+ "name": "execution_updated_at",
2575
+ "type": "timestamp with time zone",
2576
+ "primaryKey": false,
2577
+ "notNull": false
2578
+ },
2579
+ "execution_status": {
2580
+ "name": "execution_status",
2581
+ "type": "text",
2582
+ "primaryKey": false,
2583
+ "notNull": true
2584
+ },
2585
+ "run_id": {
2586
+ "name": "run_id",
2587
+ "type": "text",
2588
+ "primaryKey": false,
2589
+ "notNull": false
2590
+ },
2591
+ "last_checkpoint_at": {
2592
+ "name": "last_checkpoint_at",
2593
+ "type": "timestamp with time zone",
2594
+ "primaryKey": false,
2595
+ "notNull": false
2596
+ },
2597
+ "last_enqueued_at": {
2598
+ "name": "last_enqueued_at",
2599
+ "type": "timestamp with time zone",
2600
+ "primaryKey": false,
2601
+ "notNull": false
2602
+ },
2603
+ "parent_conversation_id": {
2604
+ "name": "parent_conversation_id",
2605
+ "type": "text",
2606
+ "primaryKey": false,
2607
+ "notNull": false
2608
+ },
2609
+ "forked_from_conversation_id": {
2610
+ "name": "forked_from_conversation_id",
2611
+ "type": "text",
2612
+ "primaryKey": false,
2613
+ "notNull": false
2614
+ },
2615
+ "root_conversation_id": {
2616
+ "name": "root_conversation_id",
2617
+ "type": "text",
2618
+ "primaryKey": false,
2619
+ "notNull": false
2620
+ },
2621
+ "transcript_purged_at": {
2622
+ "name": "transcript_purged_at",
2623
+ "type": "timestamp with time zone",
2624
+ "primaryKey": false,
2625
+ "notNull": false
2626
+ },
2627
+ "stopped_at": {
2628
+ "name": "stopped_at",
2629
+ "type": "timestamp with time zone",
2630
+ "primaryKey": false,
2631
+ "notNull": false
2632
+ },
2633
+ "duration_ms": {
2634
+ "name": "duration_ms",
2635
+ "type": "integer",
2636
+ "primaryKey": false,
2637
+ "notNull": true,
2638
+ "default": 0
2639
+ },
2640
+ "usage_json": {
2641
+ "name": "usage_json",
2642
+ "type": "jsonb",
2643
+ "primaryKey": false,
2644
+ "notNull": false
2645
+ },
2646
+ "execution_duration_ms": {
2647
+ "name": "execution_duration_ms",
2648
+ "type": "integer",
2649
+ "primaryKey": false,
2650
+ "notNull": true,
2651
+ "default": 0
2652
+ },
2653
+ "execution_usage_json": {
2654
+ "name": "execution_usage_json",
2655
+ "type": "jsonb",
2656
+ "primaryKey": false,
2657
+ "notNull": false
2658
+ },
2659
+ "metric_run_id": {
2660
+ "name": "metric_run_id",
2661
+ "type": "text",
2662
+ "primaryKey": false,
2663
+ "notNull": false
2664
+ },
2665
+ "archived_at": {
2666
+ "name": "archived_at",
2667
+ "type": "timestamp with time zone",
2668
+ "primaryKey": false,
2669
+ "notNull": false
2670
+ }
2671
+ },
2672
+ "indexes": {
2673
+ "junior_conversations_last_activity_idx": {
2674
+ "name": "junior_conversations_last_activity_idx",
2675
+ "columns": [
2676
+ {
2677
+ "expression": "last_activity_at",
2678
+ "isExpression": false,
2679
+ "asc": false,
2680
+ "nulls": "last"
2681
+ },
2682
+ {
2683
+ "expression": "conversation_id",
2684
+ "isExpression": false,
2685
+ "asc": true,
2686
+ "nulls": "last"
2687
+ }
2688
+ ],
2689
+ "isUnique": false,
2690
+ "concurrently": false,
2691
+ "method": "btree",
2692
+ "with": {}
2693
+ },
2694
+ "junior_conversations_active_idx": {
2695
+ "name": "junior_conversations_active_idx",
2696
+ "columns": [
2697
+ {
2698
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
2699
+ "asc": true,
2700
+ "isExpression": true,
2701
+ "nulls": "last"
2702
+ },
2703
+ {
2704
+ "expression": "conversation_id",
2705
+ "isExpression": false,
2706
+ "asc": true,
2707
+ "nulls": "last"
2708
+ }
2709
+ ],
2710
+ "isUnique": false,
2711
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
2712
+ "concurrently": false,
2713
+ "method": "btree",
2714
+ "with": {}
2715
+ },
2716
+ "junior_conversations_destination_activity_idx": {
2717
+ "name": "junior_conversations_destination_activity_idx",
2718
+ "columns": [
2719
+ {
2720
+ "expression": "destination_id",
2721
+ "isExpression": false,
2722
+ "asc": true,
2723
+ "nulls": "last"
2724
+ },
2725
+ {
2726
+ "expression": "last_activity_at",
2727
+ "isExpression": false,
2728
+ "asc": false,
2729
+ "nulls": "last"
2730
+ }
2731
+ ],
2732
+ "isUnique": false,
2733
+ "concurrently": false,
2734
+ "method": "btree",
2735
+ "with": {}
2736
+ },
2737
+ "junior_conversations_actor_activity_idx": {
2738
+ "name": "junior_conversations_actor_activity_idx",
2739
+ "columns": [
2740
+ {
2741
+ "expression": "actor_identity_id",
2742
+ "isExpression": false,
2743
+ "asc": true,
2744
+ "nulls": "last"
2745
+ },
2746
+ {
2747
+ "expression": "last_activity_at",
2748
+ "isExpression": false,
2749
+ "asc": false,
2750
+ "nulls": "last"
2751
+ }
2752
+ ],
2753
+ "isUnique": false,
2754
+ "concurrently": false,
2755
+ "method": "btree",
2756
+ "with": {}
2757
+ },
2758
+ "junior_conversations_origin_idx": {
2759
+ "name": "junior_conversations_origin_idx",
2760
+ "columns": [
2761
+ {
2762
+ "expression": "origin_type",
2763
+ "isExpression": false,
2764
+ "asc": true,
2765
+ "nulls": "last"
2766
+ },
2767
+ {
2768
+ "expression": "origin_id",
2769
+ "isExpression": false,
2770
+ "asc": true,
2771
+ "nulls": "last"
2772
+ },
2773
+ {
2774
+ "expression": "last_activity_at",
2775
+ "isExpression": false,
2776
+ "asc": false,
2777
+ "nulls": "last"
2778
+ }
2779
+ ],
2780
+ "isUnique": false,
2781
+ "concurrently": false,
2782
+ "method": "btree",
2783
+ "with": {}
2784
+ },
2785
+ "junior_conversations_parent_idx": {
2786
+ "name": "junior_conversations_parent_idx",
2787
+ "columns": [
2788
+ {
2789
+ "expression": "parent_conversation_id",
2790
+ "isExpression": false,
2791
+ "asc": true,
2792
+ "nulls": "last"
2793
+ }
2794
+ ],
2795
+ "isUnique": false,
2796
+ "concurrently": false,
2797
+ "method": "btree",
2798
+ "with": {}
2799
+ },
2800
+ "junior_conversations_forked_from_idx": {
2801
+ "name": "junior_conversations_forked_from_idx",
2802
+ "columns": [
2803
+ {
2804
+ "expression": "forked_from_conversation_id",
2805
+ "isExpression": false,
2806
+ "asc": true,
2807
+ "nulls": "last"
2808
+ }
2809
+ ],
2810
+ "isUnique": false,
2811
+ "concurrently": false,
2812
+ "method": "btree",
2813
+ "with": {}
2814
+ },
2815
+ "junior_conversations_root_idx": {
2816
+ "name": "junior_conversations_root_idx",
2817
+ "columns": [
2818
+ {
2819
+ "expression": "root_conversation_id",
2820
+ "isExpression": false,
2821
+ "asc": true,
2822
+ "nulls": "last"
2823
+ }
2824
+ ],
2825
+ "isUnique": false,
2826
+ "concurrently": false,
2827
+ "method": "btree",
2828
+ "with": {}
2829
+ }
2830
+ },
2831
+ "foreignKeys": {
2832
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
2833
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
2834
+ "tableFrom": "junior_conversations",
2835
+ "tableTo": "junior_destinations",
2836
+ "columnsFrom": [
2837
+ "destination_id"
2838
+ ],
2839
+ "columnsTo": [
2840
+ "id"
2841
+ ],
2842
+ "onDelete": "no action",
2843
+ "onUpdate": "no action"
2844
+ },
2845
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
2846
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
2847
+ "tableFrom": "junior_conversations",
2848
+ "tableTo": "junior_identities",
2849
+ "columnsFrom": [
2850
+ "actor_identity_id"
2851
+ ],
2852
+ "columnsTo": [
2853
+ "id"
2854
+ ],
2855
+ "onDelete": "no action",
2856
+ "onUpdate": "no action"
2857
+ },
2858
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
2859
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
2860
+ "tableFrom": "junior_conversations",
2861
+ "tableTo": "junior_identities",
2862
+ "columnsFrom": [
2863
+ "creator_identity_id"
2864
+ ],
2865
+ "columnsTo": [
2866
+ "id"
2867
+ ],
2868
+ "onDelete": "no action",
2869
+ "onUpdate": "no action"
2870
+ },
2871
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
2872
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
2873
+ "tableFrom": "junior_conversations",
2874
+ "tableTo": "junior_identities",
2875
+ "columnsFrom": [
2876
+ "credential_subject_identity_id"
2877
+ ],
2878
+ "columnsTo": [
2879
+ "id"
2880
+ ],
2881
+ "onDelete": "no action",
2882
+ "onUpdate": "no action"
2883
+ },
2884
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
2885
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
2886
+ "tableFrom": "junior_conversations",
2887
+ "tableTo": "junior_conversations",
2888
+ "columnsFrom": [
2889
+ "parent_conversation_id"
2890
+ ],
2891
+ "columnsTo": [
2892
+ "conversation_id"
2893
+ ],
2894
+ "onDelete": "no action",
2895
+ "onUpdate": "no action"
2896
+ },
2897
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
2898
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
2899
+ "tableFrom": "junior_conversations",
2900
+ "tableTo": "junior_conversations",
2901
+ "columnsFrom": [
2902
+ "forked_from_conversation_id"
2903
+ ],
2904
+ "columnsTo": [
2905
+ "conversation_id"
2906
+ ],
2907
+ "onDelete": "set null",
2908
+ "onUpdate": "no action"
2909
+ },
2910
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
2911
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
2912
+ "tableFrom": "junior_conversations",
2913
+ "tableTo": "junior_conversations",
2914
+ "columnsFrom": [
2915
+ "root_conversation_id"
2916
+ ],
2917
+ "columnsTo": [
2918
+ "conversation_id"
2919
+ ],
2920
+ "onDelete": "no action",
2921
+ "onUpdate": "no action"
2922
+ }
2923
+ },
2924
+ "compositePrimaryKeys": {},
2925
+ "uniqueConstraints": {},
2926
+ "policies": {},
2927
+ "checkConstraints": {},
2928
+ "isRLSEnabled": false
2929
+ },
2930
+ "public.junior_destinations": {
2931
+ "name": "junior_destinations",
2932
+ "schema": "",
2933
+ "columns": {
2934
+ "id": {
2935
+ "name": "id",
2936
+ "type": "text",
2937
+ "primaryKey": true,
2938
+ "notNull": true
2939
+ },
2940
+ "provider": {
2941
+ "name": "provider",
2942
+ "type": "text",
2943
+ "primaryKey": false,
2944
+ "notNull": true
2945
+ },
2946
+ "provider_tenant_id": {
2947
+ "name": "provider_tenant_id",
2948
+ "type": "text",
2949
+ "primaryKey": false,
2950
+ "notNull": true,
2951
+ "default": "''"
2952
+ },
2953
+ "provider_destination_id": {
2954
+ "name": "provider_destination_id",
2955
+ "type": "text",
2956
+ "primaryKey": false,
2957
+ "notNull": true
2958
+ },
2959
+ "kind": {
2960
+ "name": "kind",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": true
2964
+ },
2965
+ "parent_destination_id": {
2966
+ "name": "parent_destination_id",
2967
+ "type": "text",
2968
+ "primaryKey": false,
2969
+ "notNull": false
2970
+ },
2971
+ "display_name": {
2972
+ "name": "display_name",
2973
+ "type": "text",
2974
+ "primaryKey": false,
2975
+ "notNull": false
2976
+ },
2977
+ "visibility": {
2978
+ "name": "visibility",
2979
+ "type": "text",
2980
+ "primaryKey": false,
2981
+ "notNull": true,
2982
+ "default": "'unknown'"
2983
+ },
2984
+ "metadata_json": {
2985
+ "name": "metadata_json",
2986
+ "type": "jsonb",
2987
+ "primaryKey": false,
2988
+ "notNull": false
2989
+ },
2990
+ "created_at": {
2991
+ "name": "created_at",
2992
+ "type": "timestamp with time zone",
2993
+ "primaryKey": false,
2994
+ "notNull": true
2995
+ },
2996
+ "updated_at": {
2997
+ "name": "updated_at",
2998
+ "type": "timestamp with time zone",
2999
+ "primaryKey": false,
3000
+ "notNull": true
3001
+ }
3002
+ },
3003
+ "indexes": {
3004
+ "junior_destinations_provider_destination_uidx": {
3005
+ "name": "junior_destinations_provider_destination_uidx",
3006
+ "columns": [
3007
+ {
3008
+ "expression": "provider",
3009
+ "isExpression": false,
3010
+ "asc": true,
3011
+ "nulls": "last"
3012
+ },
3013
+ {
3014
+ "expression": "provider_tenant_id",
3015
+ "isExpression": false,
3016
+ "asc": true,
3017
+ "nulls": "last"
3018
+ },
3019
+ {
3020
+ "expression": "provider_destination_id",
3021
+ "isExpression": false,
3022
+ "asc": true,
3023
+ "nulls": "last"
3024
+ }
3025
+ ],
3026
+ "isUnique": true,
3027
+ "concurrently": false,
3028
+ "method": "btree",
3029
+ "with": {}
3030
+ },
3031
+ "junior_destinations_provider_kind_idx": {
3032
+ "name": "junior_destinations_provider_kind_idx",
3033
+ "columns": [
3034
+ {
3035
+ "expression": "provider",
3036
+ "isExpression": false,
3037
+ "asc": true,
3038
+ "nulls": "last"
3039
+ },
3040
+ {
3041
+ "expression": "kind",
3042
+ "isExpression": false,
3043
+ "asc": true,
3044
+ "nulls": "last"
3045
+ }
3046
+ ],
3047
+ "isUnique": false,
3048
+ "concurrently": false,
3049
+ "method": "btree",
3050
+ "with": {}
3051
+ }
3052
+ },
3053
+ "foreignKeys": {},
3054
+ "compositePrimaryKeys": {},
3055
+ "uniqueConstraints": {},
3056
+ "policies": {},
3057
+ "checkConstraints": {},
3058
+ "isRLSEnabled": false
3059
+ },
3060
+ "public.junior_event_tasks": {
3061
+ "name": "junior_event_tasks",
3062
+ "schema": "",
3063
+ "columns": {
3064
+ "id": {
3065
+ "name": "id",
3066
+ "type": "text",
3067
+ "primaryKey": true,
3068
+ "notNull": true
3069
+ },
3070
+ "team_id": {
3071
+ "name": "team_id",
3072
+ "type": "text",
3073
+ "primaryKey": false,
3074
+ "notNull": true
3075
+ },
3076
+ "namespace": {
3077
+ "name": "namespace",
3078
+ "type": "text",
3079
+ "primaryKey": false,
3080
+ "notNull": true
3081
+ },
3082
+ "identifier": {
3083
+ "name": "identifier",
3084
+ "type": "text",
3085
+ "primaryKey": false,
3086
+ "notNull": true
3087
+ },
3088
+ "created_at_ms": {
3089
+ "name": "created_at_ms",
3090
+ "type": "bigint",
3091
+ "primaryKey": false,
3092
+ "notNull": true
3093
+ },
3094
+ "status": {
3095
+ "name": "status",
3096
+ "type": "text",
3097
+ "primaryKey": false,
3098
+ "notNull": true,
3099
+ "default": "'active'"
3100
+ },
3101
+ "status_reason": {
3102
+ "name": "status_reason",
3103
+ "type": "text",
3104
+ "primaryKey": false,
3105
+ "notNull": false
3106
+ },
3107
+ "title": {
3108
+ "name": "title",
3109
+ "type": "text",
3110
+ "primaryKey": false,
3111
+ "notNull": false
3112
+ },
3113
+ "task_json": {
3114
+ "name": "task_json",
3115
+ "type": "jsonb",
3116
+ "primaryKey": false,
3117
+ "notNull": true
3118
+ }
3119
+ },
3120
+ "indexes": {
3121
+ "junior_event_tasks_team_idx": {
3122
+ "name": "junior_event_tasks_team_idx",
3123
+ "columns": [
3124
+ {
3125
+ "expression": "team_id",
3126
+ "isExpression": false,
3127
+ "asc": true,
3128
+ "nulls": "last"
3129
+ },
3130
+ {
3131
+ "expression": "created_at_ms",
3132
+ "isExpression": false,
3133
+ "asc": true,
3134
+ "nulls": "last"
3135
+ },
3136
+ {
3137
+ "expression": "id",
3138
+ "isExpression": false,
3139
+ "asc": true,
3140
+ "nulls": "last"
3141
+ }
3142
+ ],
3143
+ "isUnique": false,
3144
+ "where": "\"junior_event_tasks\".\"status\" <> 'deleted'",
3145
+ "concurrently": false,
3146
+ "method": "btree",
3147
+ "with": {}
3148
+ },
3149
+ "junior_event_tasks_match_idx": {
3150
+ "name": "junior_event_tasks_match_idx",
3151
+ "columns": [
3152
+ {
3153
+ "expression": "namespace",
3154
+ "isExpression": false,
3155
+ "asc": true,
3156
+ "nulls": "last"
3157
+ },
3158
+ {
3159
+ "expression": "identifier",
3160
+ "isExpression": false,
3161
+ "asc": true,
3162
+ "nulls": "last"
3163
+ },
3164
+ {
3165
+ "expression": "created_at_ms",
3166
+ "isExpression": false,
3167
+ "asc": true,
3168
+ "nulls": "last"
3169
+ },
3170
+ {
3171
+ "expression": "id",
3172
+ "isExpression": false,
3173
+ "asc": true,
3174
+ "nulls": "last"
3175
+ }
3176
+ ],
3177
+ "isUnique": false,
3178
+ "where": "\"junior_event_tasks\".\"status\" <> 'deleted'",
3179
+ "concurrently": false,
3180
+ "method": "btree",
3181
+ "with": {}
3182
+ }
3183
+ },
3184
+ "foreignKeys": {},
3185
+ "compositePrimaryKeys": {},
3186
+ "uniqueConstraints": {},
3187
+ "policies": {},
3188
+ "checkConstraints": {},
3189
+ "isRLSEnabled": false
3190
+ },
3191
+ "public.junior_identities": {
3192
+ "name": "junior_identities",
3193
+ "schema": "",
3194
+ "columns": {
3195
+ "id": {
3196
+ "name": "id",
3197
+ "type": "text",
3198
+ "primaryKey": true,
3199
+ "notNull": true
3200
+ },
3201
+ "kind": {
3202
+ "name": "kind",
3203
+ "type": "text",
3204
+ "primaryKey": false,
3205
+ "notNull": true
3206
+ },
3207
+ "provider": {
3208
+ "name": "provider",
3209
+ "type": "text",
3210
+ "primaryKey": false,
3211
+ "notNull": true
3212
+ },
3213
+ "provider_tenant_id": {
3214
+ "name": "provider_tenant_id",
3215
+ "type": "text",
3216
+ "primaryKey": false,
3217
+ "notNull": true,
3218
+ "default": "''"
3219
+ },
3220
+ "provider_subject_id": {
3221
+ "name": "provider_subject_id",
3222
+ "type": "text",
3223
+ "primaryKey": false,
3224
+ "notNull": true
3225
+ },
3226
+ "display_name": {
3227
+ "name": "display_name",
3228
+ "type": "text",
3229
+ "primaryKey": false,
3230
+ "notNull": false
3231
+ },
3232
+ "handle": {
3233
+ "name": "handle",
3234
+ "type": "text",
3235
+ "primaryKey": false,
3236
+ "notNull": false
3237
+ },
3238
+ "email": {
3239
+ "name": "email",
3240
+ "type": "text",
3241
+ "primaryKey": false,
3242
+ "notNull": false
3243
+ },
3244
+ "avatar_url": {
3245
+ "name": "avatar_url",
3246
+ "type": "text",
3247
+ "primaryKey": false,
3248
+ "notNull": false
3249
+ },
3250
+ "metadata_json": {
3251
+ "name": "metadata_json",
3252
+ "type": "jsonb",
3253
+ "primaryKey": false,
3254
+ "notNull": false
3255
+ },
3256
+ "created_at": {
3257
+ "name": "created_at",
3258
+ "type": "timestamp with time zone",
3259
+ "primaryKey": false,
3260
+ "notNull": true
3261
+ },
3262
+ "updated_at": {
3263
+ "name": "updated_at",
3264
+ "type": "timestamp with time zone",
3265
+ "primaryKey": false,
3266
+ "notNull": true
3267
+ },
3268
+ "user_id": {
3269
+ "name": "user_id",
3270
+ "type": "text",
3271
+ "primaryKey": false,
3272
+ "notNull": false
3273
+ },
3274
+ "email_normalized": {
3275
+ "name": "email_normalized",
3276
+ "type": "text",
3277
+ "primaryKey": false,
3278
+ "notNull": false
3279
+ },
3280
+ "email_verified": {
3281
+ "name": "email_verified",
3282
+ "type": "boolean",
3283
+ "primaryKey": false,
3284
+ "notNull": true,
3285
+ "default": false
3286
+ }
3287
+ },
3288
+ "indexes": {
3289
+ "junior_identities_provider_subject_uidx": {
3290
+ "name": "junior_identities_provider_subject_uidx",
3291
+ "columns": [
3292
+ {
3293
+ "expression": "provider",
3294
+ "isExpression": false,
3295
+ "asc": true,
3296
+ "nulls": "last"
3297
+ },
3298
+ {
3299
+ "expression": "provider_tenant_id",
3300
+ "isExpression": false,
3301
+ "asc": true,
3302
+ "nulls": "last"
3303
+ },
3304
+ {
3305
+ "expression": "provider_subject_id",
3306
+ "isExpression": false,
3307
+ "asc": true,
3308
+ "nulls": "last"
3309
+ }
3310
+ ],
3311
+ "isUnique": true,
3312
+ "concurrently": false,
3313
+ "method": "btree",
3314
+ "with": {}
3315
+ },
3316
+ "junior_identities_user_idx": {
3317
+ "name": "junior_identities_user_idx",
3318
+ "columns": [
3319
+ {
3320
+ "expression": "user_id",
3321
+ "isExpression": false,
3322
+ "asc": true,
3323
+ "nulls": "last"
3324
+ }
3325
+ ],
3326
+ "isUnique": false,
3327
+ "concurrently": false,
3328
+ "method": "btree",
3329
+ "with": {}
3330
+ },
3331
+ "junior_identities_verified_email_idx": {
3332
+ "name": "junior_identities_verified_email_idx",
3333
+ "columns": [
3334
+ {
3335
+ "expression": "email_normalized",
3336
+ "isExpression": false,
3337
+ "asc": true,
3338
+ "nulls": "last"
3339
+ }
3340
+ ],
3341
+ "isUnique": false,
3342
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
3343
+ "concurrently": false,
3344
+ "method": "btree",
3345
+ "with": {}
3346
+ },
3347
+ "junior_identities_kind_provider_idx": {
3348
+ "name": "junior_identities_kind_provider_idx",
3349
+ "columns": [
3350
+ {
3351
+ "expression": "kind",
3352
+ "isExpression": false,
3353
+ "asc": true,
3354
+ "nulls": "last"
3355
+ },
3356
+ {
3357
+ "expression": "provider",
3358
+ "isExpression": false,
3359
+ "asc": true,
3360
+ "nulls": "last"
3361
+ }
3362
+ ],
3363
+ "isUnique": false,
3364
+ "concurrently": false,
3365
+ "method": "btree",
3366
+ "with": {}
3367
+ }
3368
+ },
3369
+ "foreignKeys": {
3370
+ "junior_identities_user_id_junior_users_id_fk": {
3371
+ "name": "junior_identities_user_id_junior_users_id_fk",
3372
+ "tableFrom": "junior_identities",
3373
+ "tableTo": "junior_users",
3374
+ "columnsFrom": [
3375
+ "user_id"
3376
+ ],
3377
+ "columnsTo": [
3378
+ "id"
3379
+ ],
3380
+ "onDelete": "no action",
3381
+ "onUpdate": "no action"
3382
+ }
3383
+ },
3384
+ "compositePrimaryKeys": {},
3385
+ "uniqueConstraints": {},
3386
+ "policies": {},
3387
+ "checkConstraints": {},
3388
+ "isRLSEnabled": false
3389
+ },
3390
+ "public.junior_location_configurations": {
3391
+ "name": "junior_location_configurations",
3392
+ "schema": "",
3393
+ "columns": {
3394
+ "location_id": {
3395
+ "name": "location_id",
3396
+ "type": "text",
3397
+ "primaryKey": false,
3398
+ "notNull": true
3399
+ },
3400
+ "key": {
3401
+ "name": "key",
3402
+ "type": "text",
3403
+ "primaryKey": false,
3404
+ "notNull": true
3405
+ },
3406
+ "value": {
3407
+ "name": "value",
3408
+ "type": "text",
3409
+ "primaryKey": false,
3410
+ "notNull": true
3411
+ },
3412
+ "updated_at": {
3413
+ "name": "updated_at",
3414
+ "type": "timestamp with time zone",
3415
+ "primaryKey": false,
3416
+ "notNull": true
3417
+ },
3418
+ "updated_by": {
3419
+ "name": "updated_by",
3420
+ "type": "text",
3421
+ "primaryKey": false,
3422
+ "notNull": false
3423
+ },
3424
+ "source": {
3425
+ "name": "source",
3426
+ "type": "text",
3427
+ "primaryKey": false,
3428
+ "notNull": false
3429
+ },
3430
+ "expires_at": {
3431
+ "name": "expires_at",
3432
+ "type": "text",
3433
+ "primaryKey": false,
3434
+ "notNull": false
3435
+ }
3436
+ },
3437
+ "indexes": {},
3438
+ "foreignKeys": {
3439
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3440
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3441
+ "tableFrom": "junior_location_configurations",
3442
+ "tableTo": "junior_destinations",
3443
+ "columnsFrom": [
3444
+ "location_id"
3445
+ ],
3446
+ "columnsTo": [
3447
+ "id"
3448
+ ],
3449
+ "onDelete": "cascade",
3450
+ "onUpdate": "no action"
3451
+ }
3452
+ },
3453
+ "compositePrimaryKeys": {
3454
+ "junior_location_configurations_location_id_key_pk": {
3455
+ "name": "junior_location_configurations_location_id_key_pk",
3456
+ "columns": [
3457
+ "location_id",
3458
+ "key"
3459
+ ]
3460
+ }
3461
+ },
3462
+ "uniqueConstraints": {},
3463
+ "policies": {},
3464
+ "checkConstraints": {},
3465
+ "isRLSEnabled": false
3466
+ },
3467
+ "public.junior_scheduler_runs": {
3468
+ "name": "junior_scheduler_runs",
3469
+ "schema": "",
3470
+ "columns": {
3471
+ "id": {
3472
+ "name": "id",
3473
+ "type": "text",
3474
+ "primaryKey": true,
3475
+ "notNull": true
3476
+ },
3477
+ "task_id": {
3478
+ "name": "task_id",
3479
+ "type": "text",
3480
+ "primaryKey": false,
3481
+ "notNull": true
3482
+ },
3483
+ "status": {
3484
+ "name": "status",
3485
+ "type": "text",
3486
+ "primaryKey": false,
3487
+ "notNull": true
3488
+ },
3489
+ "scheduled_for_ms": {
3490
+ "name": "scheduled_for_ms",
3491
+ "type": "bigint",
3492
+ "primaryKey": false,
3493
+ "notNull": true
3494
+ },
3495
+ "record": {
3496
+ "name": "record",
3497
+ "type": "jsonb",
3498
+ "primaryKey": false,
3499
+ "notNull": true
3500
+ }
3501
+ },
3502
+ "indexes": {
3503
+ "junior_scheduler_runs_task_status_idx": {
3504
+ "name": "junior_scheduler_runs_task_status_idx",
3505
+ "columns": [
3506
+ {
3507
+ "expression": "task_id",
3508
+ "isExpression": false,
3509
+ "asc": true,
3510
+ "nulls": "last"
3511
+ },
3512
+ {
3513
+ "expression": "status",
3514
+ "isExpression": false,
3515
+ "asc": true,
3516
+ "nulls": "last"
3517
+ },
3518
+ {
3519
+ "expression": "scheduled_for_ms",
3520
+ "isExpression": false,
3521
+ "asc": true,
3522
+ "nulls": "last"
3523
+ }
3524
+ ],
3525
+ "isUnique": false,
3526
+ "concurrently": false,
3527
+ "method": "btree",
3528
+ "with": {}
3529
+ },
3530
+ "junior_scheduler_runs_status_idx": {
3531
+ "name": "junior_scheduler_runs_status_idx",
3532
+ "columns": [
3533
+ {
3534
+ "expression": "status",
3535
+ "isExpression": false,
3536
+ "asc": true,
3537
+ "nulls": "last"
3538
+ },
3539
+ {
3540
+ "expression": "scheduled_for_ms",
3541
+ "isExpression": false,
3542
+ "asc": true,
3543
+ "nulls": "last"
3544
+ }
3545
+ ],
3546
+ "isUnique": false,
3547
+ "concurrently": false,
3548
+ "method": "btree",
3549
+ "with": {}
3550
+ }
3551
+ },
3552
+ "foreignKeys": {},
3553
+ "compositePrimaryKeys": {},
3554
+ "uniqueConstraints": {},
3555
+ "policies": {},
3556
+ "checkConstraints": {},
3557
+ "isRLSEnabled": false
3558
+ },
3559
+ "public.junior_scheduler_tasks": {
3560
+ "name": "junior_scheduler_tasks",
3561
+ "schema": "",
3562
+ "columns": {
3563
+ "id": {
3564
+ "name": "id",
3565
+ "type": "text",
3566
+ "primaryKey": true,
3567
+ "notNull": true
3568
+ },
3569
+ "team_id": {
3570
+ "name": "team_id",
3571
+ "type": "text",
3572
+ "primaryKey": false,
3573
+ "notNull": true
3574
+ },
3575
+ "creator_slack_user_id": {
3576
+ "name": "creator_slack_user_id",
3577
+ "type": "text",
3578
+ "primaryKey": false,
3579
+ "notNull": false
3580
+ },
3581
+ "creator_identity_id": {
3582
+ "name": "creator_identity_id",
3583
+ "type": "text",
3584
+ "primaryKey": false,
3585
+ "notNull": false
3586
+ },
3587
+ "status": {
3588
+ "name": "status",
3589
+ "type": "text",
3590
+ "primaryKey": false,
3591
+ "notNull": true
3592
+ },
3593
+ "next_run_at_ms": {
3594
+ "name": "next_run_at_ms",
3595
+ "type": "bigint",
3596
+ "primaryKey": false,
3597
+ "notNull": false
3598
+ },
3599
+ "run_now_at_ms": {
3600
+ "name": "run_now_at_ms",
3601
+ "type": "bigint",
3602
+ "primaryKey": false,
3603
+ "notNull": false
3604
+ },
3605
+ "created_at_ms": {
3606
+ "name": "created_at_ms",
3607
+ "type": "bigint",
3608
+ "primaryKey": false,
3609
+ "notNull": true
3610
+ },
3611
+ "title": {
3612
+ "name": "title",
3613
+ "type": "text",
3614
+ "primaryKey": false,
3615
+ "notNull": false
3616
+ },
3617
+ "record": {
3618
+ "name": "record",
3619
+ "type": "jsonb",
3620
+ "primaryKey": false,
3621
+ "notNull": true
3622
+ }
3623
+ },
3624
+ "indexes": {
3625
+ "junior_scheduler_tasks_creator_idx": {
3626
+ "name": "junior_scheduler_tasks_creator_idx",
3627
+ "columns": [
3628
+ {
3629
+ "expression": "team_id",
3630
+ "isExpression": false,
3631
+ "asc": true,
3632
+ "nulls": "last"
3633
+ },
3634
+ {
3635
+ "expression": "creator_slack_user_id",
3636
+ "isExpression": false,
3637
+ "asc": true,
3638
+ "nulls": "last"
3639
+ },
3640
+ {
3641
+ "expression": "created_at_ms",
3642
+ "isExpression": false,
3643
+ "asc": true,
3644
+ "nulls": "last"
3645
+ },
3646
+ {
3647
+ "expression": "id",
3648
+ "isExpression": false,
3649
+ "asc": true,
3650
+ "nulls": "last"
3651
+ }
3652
+ ],
3653
+ "isUnique": false,
3654
+ "where": "\"junior_scheduler_tasks\".\"status\" <> 'deleted'",
3655
+ "concurrently": false,
3656
+ "method": "btree",
3657
+ "with": {}
3658
+ },
3659
+ "junior_scheduler_tasks_creator_identity_idx": {
3660
+ "name": "junior_scheduler_tasks_creator_identity_idx",
3661
+ "columns": [
3662
+ {
3663
+ "expression": "creator_identity_id",
3664
+ "isExpression": false,
3665
+ "asc": true,
3666
+ "nulls": "last"
3667
+ },
3668
+ {
3669
+ "expression": "created_at_ms",
3670
+ "isExpression": false,
3671
+ "asc": true,
3672
+ "nulls": "last"
3673
+ },
3674
+ {
3675
+ "expression": "id",
3676
+ "isExpression": false,
3677
+ "asc": true,
3678
+ "nulls": "last"
3679
+ }
3680
+ ],
3681
+ "isUnique": false,
3682
+ "where": "\"junior_scheduler_tasks\".\"status\" <> 'deleted' AND \"junior_scheduler_tasks\".\"creator_identity_id\" IS NOT NULL",
3683
+ "concurrently": false,
3684
+ "method": "btree",
3685
+ "with": {}
3686
+ },
3687
+ "junior_scheduler_tasks_team_status_idx": {
3688
+ "name": "junior_scheduler_tasks_team_status_idx",
3689
+ "columns": [
3690
+ {
3691
+ "expression": "team_id",
3692
+ "isExpression": false,
3693
+ "asc": true,
3694
+ "nulls": "last"
3695
+ },
3696
+ {
3697
+ "expression": "created_at_ms",
3698
+ "isExpression": false,
3699
+ "asc": true,
3700
+ "nulls": "last"
3701
+ },
3702
+ {
3703
+ "expression": "id",
3704
+ "isExpression": false,
3705
+ "asc": true,
3706
+ "nulls": "last"
3707
+ }
3708
+ ],
3709
+ "isUnique": false,
3710
+ "where": "\"junior_scheduler_tasks\".\"status\" <> 'deleted'",
3711
+ "concurrently": false,
3712
+ "method": "btree",
3713
+ "with": {}
3714
+ },
3715
+ "junior_scheduler_tasks_run_now_due_idx": {
3716
+ "name": "junior_scheduler_tasks_run_now_due_idx",
3717
+ "columns": [
3718
+ {
3719
+ "expression": "run_now_at_ms",
3720
+ "isExpression": false,
3721
+ "asc": true,
3722
+ "nulls": "last"
3723
+ },
3724
+ {
3725
+ "expression": "created_at_ms",
3726
+ "isExpression": false,
3727
+ "asc": true,
3728
+ "nulls": "last"
3729
+ },
3730
+ {
3731
+ "expression": "id",
3732
+ "isExpression": false,
3733
+ "asc": true,
3734
+ "nulls": "last"
3735
+ }
3736
+ ],
3737
+ "isUnique": false,
3738
+ "where": "\"junior_scheduler_tasks\".\"status\" = 'active' AND \"junior_scheduler_tasks\".\"run_now_at_ms\" IS NOT NULL",
3739
+ "concurrently": false,
3740
+ "method": "btree",
3741
+ "with": {}
3742
+ },
3743
+ "junior_scheduler_tasks_next_run_due_idx": {
3744
+ "name": "junior_scheduler_tasks_next_run_due_idx",
3745
+ "columns": [
3746
+ {
3747
+ "expression": "next_run_at_ms",
3748
+ "isExpression": false,
3749
+ "asc": true,
3750
+ "nulls": "last"
3751
+ },
3752
+ {
3753
+ "expression": "created_at_ms",
3754
+ "isExpression": false,
3755
+ "asc": true,
3756
+ "nulls": "last"
3757
+ },
3758
+ {
3759
+ "expression": "id",
3760
+ "isExpression": false,
3761
+ "asc": true,
3762
+ "nulls": "last"
3763
+ }
3764
+ ],
3765
+ "isUnique": false,
3766
+ "where": "\"junior_scheduler_tasks\".\"status\" = 'active' AND \"junior_scheduler_tasks\".\"next_run_at_ms\" IS NOT NULL",
3767
+ "concurrently": false,
3768
+ "method": "btree",
3769
+ "with": {}
3770
+ }
3771
+ },
3772
+ "foreignKeys": {},
3773
+ "compositePrimaryKeys": {},
3774
+ "uniqueConstraints": {},
3775
+ "policies": {},
3776
+ "checkConstraints": {},
3777
+ "isRLSEnabled": false
3778
+ },
3779
+ "public.junior_snapshots": {
3780
+ "name": "junior_snapshots",
3781
+ "schema": "",
3782
+ "columns": {
3783
+ "id": {
3784
+ "name": "id",
3785
+ "type": "text",
3786
+ "primaryKey": true,
3787
+ "notNull": true
3788
+ },
3789
+ "workspace_id": {
3790
+ "name": "workspace_id",
3791
+ "type": "text",
3792
+ "primaryKey": false,
3793
+ "notNull": true
3794
+ },
3795
+ "profile_hash": {
3796
+ "name": "profile_hash",
3797
+ "type": "text",
3798
+ "primaryKey": false,
3799
+ "notNull": true
3800
+ },
3801
+ "status": {
3802
+ "name": "status",
3803
+ "type": "text",
3804
+ "primaryKey": false,
3805
+ "notNull": true
3806
+ },
3807
+ "snapshot_id": {
3808
+ "name": "snapshot_id",
3809
+ "type": "text",
3810
+ "primaryKey": false,
3811
+ "notNull": false
3812
+ },
3813
+ "build_duration_ms": {
3814
+ "name": "build_duration_ms",
3815
+ "type": "integer",
3816
+ "primaryKey": false,
3817
+ "notNull": false
3818
+ },
3819
+ "size_bytes": {
3820
+ "name": "size_bytes",
3821
+ "type": "bigint",
3822
+ "primaryKey": false,
3823
+ "notNull": false
3824
+ },
3825
+ "generated_at": {
3826
+ "name": "generated_at",
3827
+ "type": "timestamp with time zone",
3828
+ "primaryKey": false,
3829
+ "notNull": false
3830
+ },
3831
+ "build_started_at": {
3832
+ "name": "build_started_at",
3833
+ "type": "timestamp with time zone",
3834
+ "primaryKey": false,
3835
+ "notNull": false
3836
+ },
3837
+ "build_phase": {
3838
+ "name": "build_phase",
3839
+ "type": "text",
3840
+ "primaryKey": false,
3841
+ "notNull": false
3842
+ },
3843
+ "build_sandbox_name": {
3844
+ "name": "build_sandbox_name",
3845
+ "type": "text",
3846
+ "primaryKey": false,
3847
+ "notNull": false
3848
+ },
3849
+ "build_command_id": {
3850
+ "name": "build_command_id",
3851
+ "type": "text",
3852
+ "primaryKey": false,
3853
+ "notNull": false
3854
+ },
3855
+ "build_error": {
3856
+ "name": "build_error",
3857
+ "type": "text",
3858
+ "primaryKey": false,
3859
+ "notNull": false
3860
+ },
3861
+ "created_at": {
3862
+ "name": "created_at",
3863
+ "type": "timestamp with time zone",
3864
+ "primaryKey": false,
3865
+ "notNull": true
3866
+ },
3867
+ "updated_at": {
3868
+ "name": "updated_at",
3869
+ "type": "timestamp with time zone",
3870
+ "primaryKey": false,
3871
+ "notNull": true
3872
+ }
3873
+ },
3874
+ "indexes": {
3875
+ "junior_snapshots_snapshot_id_uidx": {
3876
+ "name": "junior_snapshots_snapshot_id_uidx",
3877
+ "columns": [
3878
+ {
3879
+ "expression": "snapshot_id",
3880
+ "isExpression": false,
3881
+ "asc": true,
3882
+ "nulls": "last"
3883
+ }
3884
+ ],
3885
+ "isUnique": true,
3886
+ "concurrently": false,
3887
+ "method": "btree",
3888
+ "with": {}
3889
+ },
3890
+ "junior_snapshots_workspace_idx": {
3891
+ "name": "junior_snapshots_workspace_idx",
3892
+ "columns": [
3893
+ {
3894
+ "expression": "workspace_id",
3895
+ "isExpression": false,
3896
+ "asc": true,
3897
+ "nulls": "last"
3898
+ }
3899
+ ],
3900
+ "isUnique": false,
3901
+ "concurrently": false,
3902
+ "method": "btree",
3903
+ "with": {}
3904
+ },
3905
+ "junior_snapshots_workspace_profile_status_idx": {
3906
+ "name": "junior_snapshots_workspace_profile_status_idx",
3907
+ "columns": [
3908
+ {
3909
+ "expression": "workspace_id",
3910
+ "isExpression": false,
3911
+ "asc": true,
3912
+ "nulls": "last"
3913
+ },
3914
+ {
3915
+ "expression": "profile_hash",
3916
+ "isExpression": false,
3917
+ "asc": true,
3918
+ "nulls": "last"
3919
+ },
3920
+ {
3921
+ "expression": "status",
3922
+ "isExpression": false,
3923
+ "asc": true,
3924
+ "nulls": "last"
3925
+ }
3926
+ ],
3927
+ "isUnique": false,
3928
+ "concurrently": false,
3929
+ "method": "btree",
3930
+ "with": {}
3931
+ },
3932
+ "junior_snapshots_active_build_uidx": {
3933
+ "name": "junior_snapshots_active_build_uidx",
3934
+ "columns": [
3935
+ {
3936
+ "expression": "workspace_id",
3937
+ "isExpression": false,
3938
+ "asc": true,
3939
+ "nulls": "last"
3940
+ },
3941
+ {
3942
+ "expression": "profile_hash",
3943
+ "isExpression": false,
3944
+ "asc": true,
3945
+ "nulls": "last"
3946
+ }
3947
+ ],
3948
+ "isUnique": true,
3949
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
3950
+ "concurrently": false,
3951
+ "method": "btree",
3952
+ "with": {}
3953
+ },
3954
+ "junior_snapshots_workspace_status_idx": {
3955
+ "name": "junior_snapshots_workspace_status_idx",
3956
+ "columns": [
3957
+ {
3958
+ "expression": "workspace_id",
3959
+ "isExpression": false,
3960
+ "asc": true,
3961
+ "nulls": "last"
3962
+ },
3963
+ {
3964
+ "expression": "status",
3965
+ "isExpression": false,
3966
+ "asc": true,
3967
+ "nulls": "last"
3968
+ }
3969
+ ],
3970
+ "isUnique": false,
3971
+ "concurrently": false,
3972
+ "method": "btree",
3973
+ "with": {}
3974
+ }
3975
+ },
3976
+ "foreignKeys": {
3977
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
3978
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
3979
+ "tableFrom": "junior_snapshots",
3980
+ "tableTo": "junior_workspaces",
3981
+ "columnsFrom": [
3982
+ "workspace_id"
3983
+ ],
3984
+ "columnsTo": [
3985
+ "id"
3986
+ ],
3987
+ "onDelete": "cascade",
3988
+ "onUpdate": "no action"
3989
+ }
3990
+ },
3991
+ "compositePrimaryKeys": {},
3992
+ "uniqueConstraints": {},
3993
+ "policies": {},
3994
+ "checkConstraints": {
3995
+ "junior_snapshots_status_check": {
3996
+ "name": "junior_snapshots_status_check",
3997
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
3998
+ },
3999
+ "junior_snapshots_build_phase_check": {
4000
+ "name": "junior_snapshots_build_phase_check",
4001
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
4002
+ },
4003
+ "junior_snapshots_ready_fields_check": {
4004
+ "name": "junior_snapshots_ready_fields_check",
4005
+ "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)"
4006
+ },
4007
+ "junior_snapshots_build_fields_check": {
4008
+ "name": "junior_snapshots_build_fields_check",
4009
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
4010
+ },
4011
+ "junior_snapshots_build_duration_check": {
4012
+ "name": "junior_snapshots_build_duration_check",
4013
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
4014
+ },
4015
+ "junior_snapshots_size_bytes_check": {
4016
+ "name": "junior_snapshots_size_bytes_check",
4017
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
4018
+ }
4019
+ },
4020
+ "isRLSEnabled": false
4021
+ },
4022
+ "public.junior_stats": {
4023
+ "name": "junior_stats",
4024
+ "schema": "",
4025
+ "columns": {
4026
+ "date": {
4027
+ "name": "date",
4028
+ "type": "date",
4029
+ "primaryKey": false,
4030
+ "notNull": true
4031
+ },
4032
+ "namespace": {
4033
+ "name": "namespace",
4034
+ "type": "text",
4035
+ "primaryKey": false,
4036
+ "notNull": true
4037
+ },
4038
+ "metric": {
4039
+ "name": "metric",
4040
+ "type": "text",
4041
+ "primaryKey": false,
4042
+ "notNull": true
4043
+ },
4044
+ "name": {
4045
+ "name": "name",
4046
+ "type": "text",
4047
+ "primaryKey": false,
4048
+ "notNull": true
4049
+ },
4050
+ "count": {
4051
+ "name": "count",
4052
+ "type": "integer",
4053
+ "primaryKey": false,
4054
+ "notNull": true,
4055
+ "default": 0
4056
+ }
4057
+ },
4058
+ "indexes": {},
4059
+ "foreignKeys": {},
4060
+ "compositePrimaryKeys": {
4061
+ "junior_stats_date_namespace_metric_name_pk": {
4062
+ "name": "junior_stats_date_namespace_metric_name_pk",
4063
+ "columns": [
4064
+ "date",
4065
+ "namespace",
4066
+ "metric",
4067
+ "name"
4068
+ ]
4069
+ }
4070
+ },
4071
+ "uniqueConstraints": {},
4072
+ "policies": {},
4073
+ "checkConstraints": {},
4074
+ "isRLSEnabled": false
4075
+ },
4076
+ "public.junior_users": {
4077
+ "name": "junior_users",
4078
+ "schema": "",
4079
+ "columns": {
4080
+ "id": {
4081
+ "name": "id",
4082
+ "type": "text",
4083
+ "primaryKey": true,
4084
+ "notNull": true
4085
+ },
4086
+ "primary_email": {
4087
+ "name": "primary_email",
4088
+ "type": "text",
4089
+ "primaryKey": false,
4090
+ "notNull": true
4091
+ },
4092
+ "primary_email_normalized": {
4093
+ "name": "primary_email_normalized",
4094
+ "type": "text",
4095
+ "primaryKey": false,
4096
+ "notNull": true
4097
+ },
4098
+ "display_name": {
4099
+ "name": "display_name",
4100
+ "type": "text",
4101
+ "primaryKey": false,
4102
+ "notNull": false
4103
+ },
4104
+ "timezone": {
4105
+ "name": "timezone",
4106
+ "type": "text",
4107
+ "primaryKey": false,
4108
+ "notNull": false
4109
+ },
4110
+ "is_admin": {
4111
+ "name": "is_admin",
4112
+ "type": "boolean",
4113
+ "primaryKey": false,
4114
+ "notNull": true,
4115
+ "default": false
4116
+ },
4117
+ "created_at": {
4118
+ "name": "created_at",
4119
+ "type": "timestamp with time zone",
4120
+ "primaryKey": false,
4121
+ "notNull": true
4122
+ },
4123
+ "updated_at": {
4124
+ "name": "updated_at",
4125
+ "type": "timestamp with time zone",
4126
+ "primaryKey": false,
4127
+ "notNull": true
4128
+ }
4129
+ },
4130
+ "indexes": {
4131
+ "junior_users_primary_email_normalized_uidx": {
4132
+ "name": "junior_users_primary_email_normalized_uidx",
4133
+ "columns": [
4134
+ {
4135
+ "expression": "primary_email_normalized",
4136
+ "isExpression": false,
4137
+ "asc": true,
4138
+ "nulls": "last"
4139
+ }
4140
+ ],
4141
+ "isUnique": true,
4142
+ "concurrently": false,
4143
+ "method": "btree",
4144
+ "with": {}
4145
+ }
4146
+ },
4147
+ "foreignKeys": {},
4148
+ "compositePrimaryKeys": {},
4149
+ "uniqueConstraints": {},
4150
+ "policies": {},
4151
+ "checkConstraints": {},
4152
+ "isRLSEnabled": false
4153
+ },
4154
+ "public.junior_workspace_repos": {
4155
+ "name": "junior_workspace_repos",
4156
+ "schema": "",
4157
+ "columns": {
4158
+ "workspace_id": {
4159
+ "name": "workspace_id",
4160
+ "type": "text",
4161
+ "primaryKey": false,
4162
+ "notNull": true
4163
+ },
4164
+ "provider": {
4165
+ "name": "provider",
4166
+ "type": "text",
4167
+ "primaryKey": false,
4168
+ "notNull": true
4169
+ },
4170
+ "repo": {
4171
+ "name": "repo",
4172
+ "type": "text",
4173
+ "primaryKey": false,
4174
+ "notNull": true
4175
+ }
4176
+ },
4177
+ "indexes": {},
4178
+ "foreignKeys": {
4179
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
4180
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
4181
+ "tableFrom": "junior_workspace_repos",
4182
+ "tableTo": "junior_workspaces",
4183
+ "columnsFrom": [
4184
+ "workspace_id"
4185
+ ],
4186
+ "columnsTo": [
4187
+ "id"
4188
+ ],
4189
+ "onDelete": "cascade",
4190
+ "onUpdate": "no action"
4191
+ }
4192
+ },
4193
+ "compositePrimaryKeys": {
4194
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
4195
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
4196
+ "columns": [
4197
+ "workspace_id",
4198
+ "provider",
4199
+ "repo"
4200
+ ]
4201
+ }
4202
+ },
4203
+ "uniqueConstraints": {},
4204
+ "policies": {},
4205
+ "checkConstraints": {},
4206
+ "isRLSEnabled": false
4207
+ },
4208
+ "public.junior_workspaces": {
4209
+ "name": "junior_workspaces",
4210
+ "schema": "",
4211
+ "columns": {
4212
+ "id": {
4213
+ "name": "id",
4214
+ "type": "text",
4215
+ "primaryKey": true,
4216
+ "notNull": true
4217
+ },
4218
+ "name": {
4219
+ "name": "name",
4220
+ "type": "text",
4221
+ "primaryKey": false,
4222
+ "notNull": true
4223
+ },
4224
+ "setup_script": {
4225
+ "name": "setup_script",
4226
+ "type": "text",
4227
+ "primaryKey": false,
4228
+ "notNull": true,
4229
+ "default": "''"
4230
+ },
4231
+ "created_at": {
4232
+ "name": "created_at",
4233
+ "type": "timestamp with time zone",
4234
+ "primaryKey": false,
4235
+ "notNull": true
4236
+ },
4237
+ "updated_at": {
4238
+ "name": "updated_at",
4239
+ "type": "timestamp with time zone",
4240
+ "primaryKey": false,
4241
+ "notNull": true
4242
+ }
4243
+ },
4244
+ "indexes": {
4245
+ "junior_workspaces_name_idx": {
4246
+ "name": "junior_workspaces_name_idx",
4247
+ "columns": [
4248
+ {
4249
+ "expression": "name",
4250
+ "isExpression": false,
4251
+ "asc": true,
4252
+ "nulls": "last"
4253
+ }
4254
+ ],
4255
+ "isUnique": true,
4256
+ "concurrently": false,
4257
+ "method": "btree",
4258
+ "with": {}
4259
+ }
4260
+ },
4261
+ "foreignKeys": {},
4262
+ "compositePrimaryKeys": {},
4263
+ "uniqueConstraints": {},
4264
+ "policies": {},
4265
+ "checkConstraints": {},
4266
+ "isRLSEnabled": false
4267
+ }
4268
+ },
4269
+ "enums": {},
4270
+ "schemas": {},
4271
+ "sequences": {},
4272
+ "roles": {},
4273
+ "policies": {},
4274
+ "views": {},
4275
+ "_meta": {
4276
+ "columns": {},
4277
+ "schemas": {},
4278
+ "tables": {}
4279
+ }
4280
+ }