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