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