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