@sentry/junior 0.287.0 → 0.289.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 (79) hide show
  1. package/dist/{adapter-CL-HUKgd.js → adapter-tE1wnl0T.js} +1 -1
  2. package/dist/{admin-C9urXVfi.js → admin-BmsPbmO_.js} +2 -2
  3. package/dist/{agent-runner-Bfnw551N.js → agent-runner-bvl8U5uH.js} +489 -165
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +7 -7
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +628 -238
  8. package/dist/{app-DBY5TnfY.d.ts → app-Cu454FXq.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +550 -71
  11. package/dist/assistant-reply-1N9oxyyb.js +58 -0
  12. package/dist/{automation-DksGNDRO.js → automation-DWbjJltM.js} +2 -2
  13. package/dist/{background-compaction-queue-CYI909P5.js → background-compaction-queue-D36oCldp.js} +161 -90
  14. package/dist/{briefs-DaXiMWzT.js → briefs-CV-1qkXa.js} +3 -3
  15. package/dist/{catalog-runtime-BCIuBe4d.js → catalog-runtime-BNK4uJVZ.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{config-CkHcUMN7.js → config-DHAy7XlP.js} +363 -8
  24. package/dist/{connections-BnIj0wtx.js → connections-C3VmH3cf.js} +7 -129
  25. package/dist/{conversation-E7ZPJx2H.js → conversation-CwC8K3RZ.js} +22 -5
  26. package/dist/{conversation-pending-messages-DVch6YQw.js → conversation-pending-messages-B0cuLReP.js} +1 -1
  27. package/dist/{conversation-privacy-DF1hW0ja.js → conversation-privacy-Bky_veSp.js} +1 -1
  28. package/dist/{credential-sync-CzMar9hq.js → credential-sync-dY9o0YSj.js} +28 -20
  29. package/dist/{db-DJ11eZqq.js → db-BS2Kql3j.js} +81 -46
  30. package/dist/{db-YDKKDxlh.d.ts → db-BebRmhsH.d.ts} +10 -2
  31. package/dist/{executor-BY9TB31g.js → executor-cc4nH86C.js} +125 -18
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{logging-BO5zU6Mt.js → logging-CtCJmt9p.js} +3 -2
  34. package/dist/{media-Cz1ZiV1U.js → media-BepyEUNm.js} +5 -1
  35. package/dist/{message-CsUbuEc8.js → message-C5VuRcP9.js} +9 -9
  36. package/dist/nitro.d.ts +1 -1
  37. package/dist/nitro.js +19 -41
  38. package/dist/{oauth-callback-server-hiDKK0_n.js → oauth-callback-server-KRrYUZ35.js} +2 -2
  39. package/dist/{projection-CL_YWeGf.js → projection-BFJG58TG.js} +448 -721
  40. package/dist/{prompt-BHOEQSmf.js → prompt-D15oftoL.js} +5 -5
  41. package/dist/{registry-BriFLnaJ.js → registry-C_JrgqUz.js} +1 -1
  42. package/dist/{resolve-Bt6GgAiA.js → resolve-Cn_7JfP-.js} +3 -3
  43. package/dist/{result-Bo1TZu0Q.js → result-CIbQFLp6.js} +16 -10
  44. package/dist/{runner-D3YeCQgt.js → runner-BwmaMJVO.js} +8 -8
  45. package/dist/{sandbox-egress-signals-CcnSPP4S.js → sandbox-egress-signals-BOQ8gn7i.js} +1 -1
  46. package/dist/{schedule-BTp__wrw.js → schedule-cP0AACm1.js} +11 -2
  47. package/dist/{schema-BWE3RJEB.js → schema-Bptz19Ja.js} +72 -14
  48. package/dist/{schema-C6fsEwjo.d.ts → schema-DQaFSkZZ.d.ts} +122 -3
  49. package/dist/{service-account-DiQQuuw7.js → service-account-AGw_pANb.js} +3 -3
  50. package/dist/{service-account-r6fl0b-9.js → service-account-CLZfF8O1.js} +3 -3
  51. package/dist/{session-stop-B2Nut40V.js → session-stop-CbzKf7UI.js} +84 -31
  52. package/dist/{skills-CD5aJdzg.js → skills-CcAJBquq.js} +2 -2
  53. package/dist/{spawn-CalgZQiu.js → spawn-BvAk2vTI.js} +5 -5
  54. package/dist/{stop-kujZLbi0.js → stop-BQU4u7la.js} +893 -519
  55. package/dist/{store-DdIEUL1q.js → store-DE7NJOvQ.js} +4 -16
  56. package/dist/{task-runner-D_RDr2Hu.js → task-runner-Q_7duP_T.js} +31 -27
  57. package/dist/{turn-failure-response-B5nV1Er-.js → turn-failure-response-aWZLfUM8.js} +18 -9
  58. package/dist/{validation-K4pqwoVZ.js → validation-BOoPeIJR.js} +1 -1
  59. package/dist/{version-DBvhk1X9.js → version-Db0MFy61.js} +1 -1
  60. package/dist/version.js +1 -1
  61. package/dist/{viewer-DrMmFUul.js → viewer-FFEFu9In.js} +4 -4
  62. package/dist/warmup-DDzrA9Gv.js +967 -0
  63. package/dist/{work-ljRoODGu.js → work-BBJK458E.js} +16 -15
  64. package/dist/{worker-CYO1Q0Js.js → worker-2iU5RFyq.js} +7 -31
  65. package/migrations/0089_conversation_paused_status.sql +3 -0
  66. package/migrations/0090_guardian_review_time_index.sql +20 -0
  67. package/migrations/0091_conversation_participant_unsubscribed_index.sql +20 -0
  68. package/migrations/0092_turn_metric_actor.sql +12 -0
  69. package/migrations/0093_participant_root_actor_backfill.sql +18 -0
  70. package/migrations/0094_conversation_delivery_paused_at.sql +1 -0
  71. package/migrations/meta/0089_snapshot.json +4372 -0
  72. package/migrations/meta/0090_snapshot.json +4388 -0
  73. package/migrations/meta/0091_snapshot.json +4410 -0
  74. package/migrations/meta/0092_snapshot.json +4446 -0
  75. package/migrations/meta/0093_snapshot.json +4446 -0
  76. package/migrations/meta/0094_snapshot.json +4452 -0
  77. package/migrations/meta/_journal.json +42 -0
  78. package/package.json +6 -5
  79. package/dist/assistant-reply-u_PRYzuz.js +0 -65
@@ -0,0 +1,4410 @@
1
+ {
2
+ "id": "be363a2e-1f8a-40a9-ad69-f730726e0d0f",
3
+ "prevId": "18db4963-3b83-4524-8556-767eb2da7571",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.junior_agent_bindings": {
8
+ "name": "junior_agent_bindings",
9
+ "schema": "",
10
+ "columns": {
11
+ "parent_conversation_id": {
12
+ "name": "parent_conversation_id",
13
+ "type": "text",
14
+ "primaryKey": false,
15
+ "notNull": true
16
+ },
17
+ "name": {
18
+ "name": "name",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "child_conversation_id": {
24
+ "name": "child_conversation_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ }
29
+ },
30
+ "indexes": {
31
+ "junior_agent_bindings_child_idx": {
32
+ "name": "junior_agent_bindings_child_idx",
33
+ "columns": [
34
+ {
35
+ "expression": "child_conversation_id",
36
+ "isExpression": false,
37
+ "asc": true,
38
+ "nulls": "last"
39
+ }
40
+ ],
41
+ "isUnique": true,
42
+ "concurrently": false,
43
+ "method": "btree",
44
+ "with": {}
45
+ }
46
+ },
47
+ "foreignKeys": {
48
+ "junior_agent_bindings_parent_conversation_id_junior_conversations_conversation_id_fk": {
49
+ "name": "junior_agent_bindings_parent_conversation_id_junior_conversations_conversation_id_fk",
50
+ "tableFrom": "junior_agent_bindings",
51
+ "tableTo": "junior_conversations",
52
+ "columnsFrom": ["parent_conversation_id"],
53
+ "columnsTo": ["conversation_id"],
54
+ "onDelete": "no action",
55
+ "onUpdate": "no action"
56
+ },
57
+ "junior_agent_bindings_child_conversation_id_junior_conversations_conversation_id_fk": {
58
+ "name": "junior_agent_bindings_child_conversation_id_junior_conversations_conversation_id_fk",
59
+ "tableFrom": "junior_agent_bindings",
60
+ "tableTo": "junior_conversations",
61
+ "columnsFrom": ["child_conversation_id"],
62
+ "columnsTo": ["conversation_id"],
63
+ "onDelete": "no action",
64
+ "onUpdate": "no action"
65
+ }
66
+ },
67
+ "compositePrimaryKeys": {
68
+ "junior_agent_bindings_parent_conversation_id_name_pk": {
69
+ "name": "junior_agent_bindings_parent_conversation_id_name_pk",
70
+ "columns": ["parent_conversation_id", "name"]
71
+ }
72
+ },
73
+ "uniqueConstraints": {},
74
+ "policies": {},
75
+ "checkConstraints": {},
76
+ "isRLSEnabled": false
77
+ },
78
+ "public.junior_agent_invocations": {
79
+ "name": "junior_agent_invocations",
80
+ "schema": "",
81
+ "columns": {
82
+ "invocation_id": {
83
+ "name": "invocation_id",
84
+ "type": "text",
85
+ "primaryKey": true,
86
+ "notNull": true
87
+ },
88
+ "parent_conversation_id": {
89
+ "name": "parent_conversation_id",
90
+ "type": "text",
91
+ "primaryKey": false,
92
+ "notNull": true
93
+ },
94
+ "child_conversation_id": {
95
+ "name": "child_conversation_id",
96
+ "type": "text",
97
+ "primaryKey": false,
98
+ "notNull": true
99
+ },
100
+ "agent_name": {
101
+ "name": "agent_name",
102
+ "type": "text",
103
+ "primaryKey": false,
104
+ "notNull": false
105
+ },
106
+ "input": {
107
+ "name": "input",
108
+ "type": "text",
109
+ "primaryKey": false,
110
+ "notNull": true
111
+ },
112
+ "title": {
113
+ "name": "title",
114
+ "type": "text",
115
+ "primaryKey": false,
116
+ "notNull": false
117
+ },
118
+ "actor_json": {
119
+ "name": "actor_json",
120
+ "type": "jsonb",
121
+ "primaryKey": false,
122
+ "notNull": true
123
+ },
124
+ "credential_context_json": {
125
+ "name": "credential_context_json",
126
+ "type": "jsonb",
127
+ "primaryKey": false,
128
+ "notNull": false
129
+ },
130
+ "source_json": {
131
+ "name": "source_json",
132
+ "type": "jsonb",
133
+ "primaryKey": false,
134
+ "notNull": true
135
+ },
136
+ "destination_json": {
137
+ "name": "destination_json",
138
+ "type": "jsonb",
139
+ "primaryKey": false,
140
+ "notNull": true
141
+ },
142
+ "destination_visibility": {
143
+ "name": "destination_visibility",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": false
147
+ },
148
+ "agent_type": {
149
+ "name": "agent_type",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": false
153
+ },
154
+ "reasoning_level": {
155
+ "name": "reasoning_level",
156
+ "type": "text",
157
+ "primaryKey": false,
158
+ "notNull": false
159
+ },
160
+ "parent_tool_call_id": {
161
+ "name": "parent_tool_call_id",
162
+ "type": "text",
163
+ "primaryKey": false,
164
+ "notNull": false
165
+ },
166
+ "status": {
167
+ "name": "status",
168
+ "type": "text",
169
+ "primaryKey": false,
170
+ "notNull": true
171
+ },
172
+ "mailbox_status": {
173
+ "name": "mailbox_status",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": true
177
+ },
178
+ "parent_mailbox_status": {
179
+ "name": "parent_mailbox_status",
180
+ "type": "text",
181
+ "primaryKey": false,
182
+ "notNull": false
183
+ },
184
+ "result": {
185
+ "name": "result",
186
+ "type": "text",
187
+ "primaryKey": false,
188
+ "notNull": false
189
+ },
190
+ "error_message": {
191
+ "name": "error_message",
192
+ "type": "text",
193
+ "primaryKey": false,
194
+ "notNull": false
195
+ },
196
+ "created_at": {
197
+ "name": "created_at",
198
+ "type": "timestamp with time zone",
199
+ "primaryKey": false,
200
+ "notNull": true
201
+ },
202
+ "updated_at": {
203
+ "name": "updated_at",
204
+ "type": "timestamp with time zone",
205
+ "primaryKey": false,
206
+ "notNull": true
207
+ },
208
+ "terminal_at": {
209
+ "name": "terminal_at",
210
+ "type": "timestamp with time zone",
211
+ "primaryKey": false,
212
+ "notNull": false
213
+ }
214
+ },
215
+ "indexes": {
216
+ "junior_agent_invocations_child_idx": {
217
+ "name": "junior_agent_invocations_child_idx",
218
+ "columns": [
219
+ {
220
+ "expression": "child_conversation_id",
221
+ "isExpression": false,
222
+ "asc": true,
223
+ "nulls": "last"
224
+ }
225
+ ],
226
+ "isUnique": false,
227
+ "concurrently": false,
228
+ "method": "btree",
229
+ "with": {}
230
+ },
231
+ "junior_agent_invocations_mailbox_idx": {
232
+ "name": "junior_agent_invocations_mailbox_idx",
233
+ "columns": [
234
+ {
235
+ "expression": "mailbox_status",
236
+ "isExpression": false,
237
+ "asc": true,
238
+ "nulls": "last"
239
+ },
240
+ {
241
+ "expression": "created_at",
242
+ "isExpression": false,
243
+ "asc": true,
244
+ "nulls": "last"
245
+ }
246
+ ],
247
+ "isUnique": false,
248
+ "concurrently": false,
249
+ "method": "btree",
250
+ "with": {}
251
+ },
252
+ "junior_agent_invocations_parent_mailbox_idx": {
253
+ "name": "junior_agent_invocations_parent_mailbox_idx",
254
+ "columns": [
255
+ {
256
+ "expression": "parent_mailbox_status",
257
+ "isExpression": false,
258
+ "asc": true,
259
+ "nulls": "last"
260
+ },
261
+ {
262
+ "expression": "terminal_at",
263
+ "isExpression": false,
264
+ "asc": true,
265
+ "nulls": "last"
266
+ }
267
+ ],
268
+ "isUnique": false,
269
+ "concurrently": false,
270
+ "method": "btree",
271
+ "with": {}
272
+ }
273
+ },
274
+ "foreignKeys": {
275
+ "junior_agent_invocations_parent_conversation_id_junior_conversations_conversation_id_fk": {
276
+ "name": "junior_agent_invocations_parent_conversation_id_junior_conversations_conversation_id_fk",
277
+ "tableFrom": "junior_agent_invocations",
278
+ "tableTo": "junior_conversations",
279
+ "columnsFrom": ["parent_conversation_id"],
280
+ "columnsTo": ["conversation_id"],
281
+ "onDelete": "no action",
282
+ "onUpdate": "no action"
283
+ },
284
+ "junior_agent_invocations_child_conversation_id_junior_conversations_conversation_id_fk": {
285
+ "name": "junior_agent_invocations_child_conversation_id_junior_conversations_conversation_id_fk",
286
+ "tableFrom": "junior_agent_invocations",
287
+ "tableTo": "junior_conversations",
288
+ "columnsFrom": ["child_conversation_id"],
289
+ "columnsTo": ["conversation_id"],
290
+ "onDelete": "no action",
291
+ "onUpdate": "no action"
292
+ }
293
+ },
294
+ "compositePrimaryKeys": {},
295
+ "uniqueConstraints": {},
296
+ "policies": {},
297
+ "checkConstraints": {},
298
+ "isRLSEnabled": false
299
+ },
300
+ "public.junior_api_tokens": {
301
+ "name": "junior_api_tokens",
302
+ "schema": "",
303
+ "columns": {
304
+ "id": {
305
+ "name": "id",
306
+ "type": "text",
307
+ "primaryKey": true,
308
+ "notNull": true
309
+ },
310
+ "owner_email_normalized": {
311
+ "name": "owner_email_normalized",
312
+ "type": "text",
313
+ "primaryKey": false,
314
+ "notNull": true
315
+ },
316
+ "name": {
317
+ "name": "name",
318
+ "type": "text",
319
+ "primaryKey": false,
320
+ "notNull": true
321
+ },
322
+ "token_hash": {
323
+ "name": "token_hash",
324
+ "type": "text",
325
+ "primaryKey": false,
326
+ "notNull": true
327
+ },
328
+ "token_suffix": {
329
+ "name": "token_suffix",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": true
333
+ },
334
+ "created_at": {
335
+ "name": "created_at",
336
+ "type": "timestamp with time zone",
337
+ "primaryKey": false,
338
+ "notNull": true
339
+ },
340
+ "expires_at": {
341
+ "name": "expires_at",
342
+ "type": "timestamp with time zone",
343
+ "primaryKey": false,
344
+ "notNull": true
345
+ },
346
+ "last_used_at": {
347
+ "name": "last_used_at",
348
+ "type": "timestamp with time zone",
349
+ "primaryKey": false,
350
+ "notNull": false
351
+ },
352
+ "revoked_at": {
353
+ "name": "revoked_at",
354
+ "type": "timestamp with time zone",
355
+ "primaryKey": false,
356
+ "notNull": false
357
+ }
358
+ },
359
+ "indexes": {
360
+ "junior_api_tokens_token_hash_uidx": {
361
+ "name": "junior_api_tokens_token_hash_uidx",
362
+ "columns": [
363
+ {
364
+ "expression": "token_hash",
365
+ "isExpression": false,
366
+ "asc": true,
367
+ "nulls": "last"
368
+ }
369
+ ],
370
+ "isUnique": true,
371
+ "concurrently": false,
372
+ "method": "btree",
373
+ "with": {}
374
+ },
375
+ "junior_api_tokens_owner_email_idx": {
376
+ "name": "junior_api_tokens_owner_email_idx",
377
+ "columns": [
378
+ {
379
+ "expression": "owner_email_normalized",
380
+ "isExpression": false,
381
+ "asc": true,
382
+ "nulls": "last"
383
+ }
384
+ ],
385
+ "isUnique": false,
386
+ "concurrently": false,
387
+ "method": "btree",
388
+ "with": {}
389
+ }
390
+ },
391
+ "foreignKeys": {},
392
+ "compositePrimaryKeys": {},
393
+ "uniqueConstraints": {},
394
+ "policies": {},
395
+ "checkConstraints": {},
396
+ "isRLSEnabled": false
397
+ },
398
+ "public.junior_artifacts": {
399
+ "name": "junior_artifacts",
400
+ "schema": "",
401
+ "columns": {
402
+ "id": {
403
+ "name": "id",
404
+ "type": "text",
405
+ "primaryKey": true,
406
+ "notNull": true
407
+ },
408
+ "conversation_id": {
409
+ "name": "conversation_id",
410
+ "type": "text",
411
+ "primaryKey": false,
412
+ "notNull": true
413
+ },
414
+ "sha256": {
415
+ "name": "sha256",
416
+ "type": "text",
417
+ "primaryKey": false,
418
+ "notNull": true
419
+ },
420
+ "ext": {
421
+ "name": "ext",
422
+ "type": "text",
423
+ "primaryKey": false,
424
+ "notNull": true
425
+ },
426
+ "storage_key": {
427
+ "name": "storage_key",
428
+ "type": "text",
429
+ "primaryKey": false,
430
+ "notNull": true
431
+ },
432
+ "content_type": {
433
+ "name": "content_type",
434
+ "type": "text",
435
+ "primaryKey": false,
436
+ "notNull": true
437
+ },
438
+ "bytes": {
439
+ "name": "bytes",
440
+ "type": "integer",
441
+ "primaryKey": false,
442
+ "notNull": true
443
+ },
444
+ "public": {
445
+ "name": "public",
446
+ "type": "boolean",
447
+ "primaryKey": false,
448
+ "notNull": true
449
+ },
450
+ "created_at": {
451
+ "name": "created_at",
452
+ "type": "timestamp with time zone",
453
+ "primaryKey": false,
454
+ "notNull": true
455
+ },
456
+ "delete_requested_at": {
457
+ "name": "delete_requested_at",
458
+ "type": "timestamp with time zone",
459
+ "primaryKey": false,
460
+ "notNull": false
461
+ }
462
+ },
463
+ "indexes": {
464
+ "junior_artifacts_conversation_sha_uidx": {
465
+ "name": "junior_artifacts_conversation_sha_uidx",
466
+ "columns": [
467
+ {
468
+ "expression": "conversation_id",
469
+ "isExpression": false,
470
+ "asc": true,
471
+ "nulls": "last"
472
+ },
473
+ {
474
+ "expression": "sha256",
475
+ "isExpression": false,
476
+ "asc": true,
477
+ "nulls": "last"
478
+ }
479
+ ],
480
+ "isUnique": true,
481
+ "concurrently": false,
482
+ "method": "btree",
483
+ "with": {}
484
+ },
485
+ "junior_artifacts_gc_idx": {
486
+ "name": "junior_artifacts_gc_idx",
487
+ "columns": [
488
+ {
489
+ "expression": "delete_requested_at",
490
+ "isExpression": false,
491
+ "asc": true,
492
+ "nulls": "last"
493
+ },
494
+ {
495
+ "expression": "created_at",
496
+ "isExpression": false,
497
+ "asc": true,
498
+ "nulls": "last"
499
+ }
500
+ ],
501
+ "isUnique": false,
502
+ "concurrently": false,
503
+ "method": "btree",
504
+ "with": {}
505
+ },
506
+ "junior_artifacts_conversation_idx": {
507
+ "name": "junior_artifacts_conversation_idx",
508
+ "columns": [
509
+ {
510
+ "expression": "conversation_id",
511
+ "isExpression": false,
512
+ "asc": true,
513
+ "nulls": "last"
514
+ }
515
+ ],
516
+ "isUnique": false,
517
+ "concurrently": false,
518
+ "method": "btree",
519
+ "with": {}
520
+ }
521
+ },
522
+ "foreignKeys": {},
523
+ "compositePrimaryKeys": {},
524
+ "uniqueConstraints": {},
525
+ "policies": {},
526
+ "checkConstraints": {},
527
+ "isRLSEnabled": false
528
+ },
529
+ "public.junior_attachments": {
530
+ "name": "junior_attachments",
531
+ "schema": "",
532
+ "columns": {
533
+ "id": {
534
+ "name": "id",
535
+ "type": "text",
536
+ "primaryKey": true,
537
+ "notNull": true
538
+ },
539
+ "conversation_id": {
540
+ "name": "conversation_id",
541
+ "type": "text",
542
+ "primaryKey": false,
543
+ "notNull": true
544
+ },
545
+ "storage_provider": {
546
+ "name": "storage_provider",
547
+ "type": "text",
548
+ "primaryKey": false,
549
+ "notNull": true
550
+ },
551
+ "storage_key": {
552
+ "name": "storage_key",
553
+ "type": "text",
554
+ "primaryKey": false,
555
+ "notNull": true
556
+ },
557
+ "provider": {
558
+ "name": "provider",
559
+ "type": "text",
560
+ "primaryKey": false,
561
+ "notNull": false
562
+ },
563
+ "provider_id": {
564
+ "name": "provider_id",
565
+ "type": "text",
566
+ "primaryKey": false,
567
+ "notNull": false
568
+ },
569
+ "filename": {
570
+ "name": "filename",
571
+ "type": "text",
572
+ "primaryKey": false,
573
+ "notNull": true
574
+ },
575
+ "content_type": {
576
+ "name": "content_type",
577
+ "type": "text",
578
+ "primaryKey": false,
579
+ "notNull": true
580
+ },
581
+ "bytes": {
582
+ "name": "bytes",
583
+ "type": "integer",
584
+ "primaryKey": false,
585
+ "notNull": true
586
+ },
587
+ "sha256": {
588
+ "name": "sha256",
589
+ "type": "text",
590
+ "primaryKey": false,
591
+ "notNull": true
592
+ },
593
+ "vision_summary": {
594
+ "name": "vision_summary",
595
+ "type": "text",
596
+ "primaryKey": false,
597
+ "notNull": false
598
+ },
599
+ "created_at": {
600
+ "name": "created_at",
601
+ "type": "timestamp with time zone",
602
+ "primaryKey": false,
603
+ "notNull": true
604
+ },
605
+ "delete_requested_at": {
606
+ "name": "delete_requested_at",
607
+ "type": "timestamp with time zone",
608
+ "primaryKey": false,
609
+ "notNull": false
610
+ }
611
+ },
612
+ "indexes": {
613
+ "junior_attachments_conversation_idx": {
614
+ "name": "junior_attachments_conversation_idx",
615
+ "columns": [
616
+ {
617
+ "expression": "conversation_id",
618
+ "isExpression": false,
619
+ "asc": true,
620
+ "nulls": "last"
621
+ }
622
+ ],
623
+ "isUnique": false,
624
+ "concurrently": false,
625
+ "method": "btree",
626
+ "with": {}
627
+ },
628
+ "junior_attachments_provider_idx": {
629
+ "name": "junior_attachments_provider_idx",
630
+ "columns": [
631
+ {
632
+ "expression": "conversation_id",
633
+ "isExpression": false,
634
+ "asc": true,
635
+ "nulls": "last"
636
+ },
637
+ {
638
+ "expression": "provider",
639
+ "isExpression": false,
640
+ "asc": true,
641
+ "nulls": "last"
642
+ },
643
+ {
644
+ "expression": "provider_id",
645
+ "isExpression": false,
646
+ "asc": true,
647
+ "nulls": "last"
648
+ }
649
+ ],
650
+ "isUnique": false,
651
+ "concurrently": false,
652
+ "method": "btree",
653
+ "with": {}
654
+ },
655
+ "junior_attachments_gc_idx": {
656
+ "name": "junior_attachments_gc_idx",
657
+ "columns": [
658
+ {
659
+ "expression": "storage_provider",
660
+ "isExpression": false,
661
+ "asc": true,
662
+ "nulls": "last"
663
+ },
664
+ {
665
+ "expression": "delete_requested_at",
666
+ "isExpression": false,
667
+ "asc": true,
668
+ "nulls": "last"
669
+ },
670
+ {
671
+ "expression": "created_at",
672
+ "isExpression": false,
673
+ "asc": true,
674
+ "nulls": "last"
675
+ }
676
+ ],
677
+ "isUnique": false,
678
+ "concurrently": false,
679
+ "method": "btree",
680
+ "with": {}
681
+ }
682
+ },
683
+ "foreignKeys": {
684
+ "junior_attachments_conversation_id_junior_conversations_conversation_id_fk": {
685
+ "name": "junior_attachments_conversation_id_junior_conversations_conversation_id_fk",
686
+ "tableFrom": "junior_attachments",
687
+ "tableTo": "junior_conversations",
688
+ "columnsFrom": ["conversation_id"],
689
+ "columnsTo": ["conversation_id"],
690
+ "onDelete": "cascade",
691
+ "onUpdate": "no action"
692
+ }
693
+ },
694
+ "compositePrimaryKeys": {},
695
+ "uniqueConstraints": {},
696
+ "policies": {},
697
+ "checkConstraints": {},
698
+ "isRLSEnabled": false
699
+ },
700
+ "public.junior_automation_runs": {
701
+ "name": "junior_automation_runs",
702
+ "schema": "",
703
+ "columns": {
704
+ "id": {
705
+ "name": "id",
706
+ "type": "text",
707
+ "primaryKey": true,
708
+ "notNull": true
709
+ },
710
+ "automation_id": {
711
+ "name": "automation_id",
712
+ "type": "text",
713
+ "primaryKey": false,
714
+ "notNull": true
715
+ },
716
+ "conversation_id": {
717
+ "name": "conversation_id",
718
+ "type": "text",
719
+ "primaryKey": false,
720
+ "notNull": false
721
+ },
722
+ "status": {
723
+ "name": "status",
724
+ "type": "text",
725
+ "primaryKey": false,
726
+ "notNull": true
727
+ },
728
+ "automation_version": {
729
+ "name": "automation_version",
730
+ "type": "integer",
731
+ "primaryKey": false,
732
+ "notNull": false
733
+ },
734
+ "scheduled_for_ms": {
735
+ "name": "scheduled_for_ms",
736
+ "type": "bigint",
737
+ "primaryKey": false,
738
+ "notNull": false
739
+ },
740
+ "attempt": {
741
+ "name": "attempt",
742
+ "type": "integer",
743
+ "primaryKey": false,
744
+ "notNull": false
745
+ },
746
+ "claimed_at_ms": {
747
+ "name": "claimed_at_ms",
748
+ "type": "bigint",
749
+ "primaryKey": false,
750
+ "notNull": false
751
+ },
752
+ "dispatch_id": {
753
+ "name": "dispatch_id",
754
+ "type": "text",
755
+ "primaryKey": false,
756
+ "notNull": false
757
+ },
758
+ "started_at_ms": {
759
+ "name": "started_at_ms",
760
+ "type": "bigint",
761
+ "primaryKey": false,
762
+ "notNull": false
763
+ },
764
+ "completed_at_ms": {
765
+ "name": "completed_at_ms",
766
+ "type": "bigint",
767
+ "primaryKey": false,
768
+ "notNull": false
769
+ },
770
+ "error_message": {
771
+ "name": "error_message",
772
+ "type": "text",
773
+ "primaryKey": false,
774
+ "notNull": false
775
+ },
776
+ "result_message_ts": {
777
+ "name": "result_message_ts",
778
+ "type": "text",
779
+ "primaryKey": false,
780
+ "notNull": false
781
+ }
782
+ },
783
+ "indexes": {
784
+ "junior_automation_runs_automation_idx": {
785
+ "name": "junior_automation_runs_automation_idx",
786
+ "columns": [
787
+ {
788
+ "expression": "automation_id",
789
+ "isExpression": false,
790
+ "asc": true,
791
+ "nulls": "last"
792
+ },
793
+ {
794
+ "expression": "completed_at_ms",
795
+ "isExpression": false,
796
+ "asc": true,
797
+ "nulls": "last"
798
+ }
799
+ ],
800
+ "isUnique": false,
801
+ "concurrently": false,
802
+ "method": "btree",
803
+ "with": {}
804
+ },
805
+ "junior_automation_runs_completed_idx": {
806
+ "name": "junior_automation_runs_completed_idx",
807
+ "columns": [
808
+ {
809
+ "expression": "completed_at_ms",
810
+ "isExpression": false,
811
+ "asc": true,
812
+ "nulls": "last"
813
+ }
814
+ ],
815
+ "isUnique": false,
816
+ "concurrently": false,
817
+ "method": "btree",
818
+ "with": {}
819
+ },
820
+ "junior_automation_runs_incomplete_idx": {
821
+ "name": "junior_automation_runs_incomplete_idx",
822
+ "columns": [
823
+ {
824
+ "expression": "automation_id",
825
+ "isExpression": false,
826
+ "asc": true,
827
+ "nulls": "last"
828
+ },
829
+ {
830
+ "expression": "scheduled_for_ms",
831
+ "isExpression": false,
832
+ "asc": true,
833
+ "nulls": "last"
834
+ }
835
+ ],
836
+ "isUnique": false,
837
+ "where": "\"junior_automation_runs\".\"status\" in ('pending', 'running')",
838
+ "concurrently": false,
839
+ "method": "btree",
840
+ "with": {}
841
+ }
842
+ },
843
+ "foreignKeys": {
844
+ "junior_automation_runs_automation_id_junior_automations_id_fk": {
845
+ "name": "junior_automation_runs_automation_id_junior_automations_id_fk",
846
+ "tableFrom": "junior_automation_runs",
847
+ "tableTo": "junior_automations",
848
+ "columnsFrom": ["automation_id"],
849
+ "columnsTo": ["id"],
850
+ "onDelete": "cascade",
851
+ "onUpdate": "no action"
852
+ },
853
+ "junior_automation_runs_conversation_id_junior_conversations_conversation_id_fk": {
854
+ "name": "junior_automation_runs_conversation_id_junior_conversations_conversation_id_fk",
855
+ "tableFrom": "junior_automation_runs",
856
+ "tableTo": "junior_conversations",
857
+ "columnsFrom": ["conversation_id"],
858
+ "columnsTo": ["conversation_id"],
859
+ "onDelete": "no action",
860
+ "onUpdate": "no action"
861
+ },
862
+ "junior_automation_runs_automation_version_fk": {
863
+ "name": "junior_automation_runs_automation_version_fk",
864
+ "tableFrom": "junior_automation_runs",
865
+ "tableTo": "junior_automation_versions",
866
+ "columnsFrom": ["automation_id", "automation_version"],
867
+ "columnsTo": ["automation_id", "version"],
868
+ "onDelete": "no action",
869
+ "onUpdate": "no action"
870
+ }
871
+ },
872
+ "compositePrimaryKeys": {},
873
+ "uniqueConstraints": {
874
+ "junior_automation_runs_conversation_id_unique": {
875
+ "name": "junior_automation_runs_conversation_id_unique",
876
+ "nullsNotDistinct": false,
877
+ "columns": ["conversation_id"]
878
+ }
879
+ },
880
+ "policies": {},
881
+ "checkConstraints": {
882
+ "junior_automation_runs_status_check": {
883
+ "name": "junior_automation_runs_status_check",
884
+ "value": "\"junior_automation_runs\".\"status\" in ('pending', 'running', 'completed', 'failed', 'blocked', 'skipped')"
885
+ }
886
+ },
887
+ "isRLSEnabled": false
888
+ },
889
+ "public.junior_automation_versions": {
890
+ "name": "junior_automation_versions",
891
+ "schema": "",
892
+ "columns": {
893
+ "automation_id": {
894
+ "name": "automation_id",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": true
898
+ },
899
+ "version": {
900
+ "name": "version",
901
+ "type": "integer",
902
+ "primaryKey": false,
903
+ "notNull": true
904
+ },
905
+ "created_at_ms": {
906
+ "name": "created_at_ms",
907
+ "type": "bigint",
908
+ "primaryKey": false,
909
+ "notNull": true
910
+ },
911
+ "edited_by": {
912
+ "name": "edited_by",
913
+ "type": "jsonb",
914
+ "primaryKey": false,
915
+ "notNull": false
916
+ },
917
+ "definition": {
918
+ "name": "definition",
919
+ "type": "jsonb",
920
+ "primaryKey": false,
921
+ "notNull": true
922
+ }
923
+ },
924
+ "indexes": {},
925
+ "foreignKeys": {
926
+ "junior_automation_versions_automation_id_fk": {
927
+ "name": "junior_automation_versions_automation_id_fk",
928
+ "tableFrom": "junior_automation_versions",
929
+ "tableTo": "junior_automations",
930
+ "columnsFrom": ["automation_id"],
931
+ "columnsTo": ["id"],
932
+ "onDelete": "cascade",
933
+ "onUpdate": "no action"
934
+ }
935
+ },
936
+ "compositePrimaryKeys": {
937
+ "junior_automation_versions_pk": {
938
+ "name": "junior_automation_versions_pk",
939
+ "columns": ["automation_id", "version"]
940
+ }
941
+ },
942
+ "uniqueConstraints": {},
943
+ "policies": {},
944
+ "checkConstraints": {},
945
+ "isRLSEnabled": false
946
+ },
947
+ "public.junior_automations": {
948
+ "name": "junior_automations",
949
+ "schema": "",
950
+ "columns": {
951
+ "id": {
952
+ "name": "id",
953
+ "type": "text",
954
+ "primaryKey": true,
955
+ "notNull": true
956
+ },
957
+ "kind": {
958
+ "name": "kind",
959
+ "type": "text",
960
+ "primaryKey": false,
961
+ "notNull": true
962
+ },
963
+ "team_id": {
964
+ "name": "team_id",
965
+ "type": "text",
966
+ "primaryKey": false,
967
+ "notNull": true
968
+ },
969
+ "channel_id": {
970
+ "name": "channel_id",
971
+ "type": "text",
972
+ "primaryKey": false,
973
+ "notNull": true
974
+ },
975
+ "creator_slack_user_id": {
976
+ "name": "creator_slack_user_id",
977
+ "type": "text",
978
+ "primaryKey": false,
979
+ "notNull": true
980
+ },
981
+ "creator_identity_id": {
982
+ "name": "creator_identity_id",
983
+ "type": "text",
984
+ "primaryKey": false,
985
+ "notNull": true
986
+ },
987
+ "status": {
988
+ "name": "status",
989
+ "type": "text",
990
+ "primaryKey": false,
991
+ "notNull": true
992
+ },
993
+ "status_reason": {
994
+ "name": "status_reason",
995
+ "type": "text",
996
+ "primaryKey": false,
997
+ "notNull": false
998
+ },
999
+ "title": {
1000
+ "name": "title",
1001
+ "type": "text",
1002
+ "primaryKey": false,
1003
+ "notNull": false
1004
+ },
1005
+ "instruction": {
1006
+ "name": "instruction",
1007
+ "type": "text",
1008
+ "primaryKey": false,
1009
+ "notNull": 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
+ "where": "\"junior_automations\".\"status\" <> 'deleted'",
1073
+ "concurrently": false,
1074
+ "method": "btree",
1075
+ "with": {}
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
+ "concurrently": false,
1101
+ "method": "btree",
1102
+ "with": {}
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
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"run_now_at_ms\" IS NOT NULL",
1128
+ "concurrently": false,
1129
+ "method": "btree",
1130
+ "with": {}
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
+ "where": "\"junior_automations\".\"status\" = 'active' AND \"junior_automations\".\"next_run_at_ms\" IS NOT NULL",
1156
+ "concurrently": false,
1157
+ "method": "btree",
1158
+ "with": {}
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
+ "where": "\"junior_automations\".\"status\" <> 'deleted'",
1190
+ "concurrently": false,
1191
+ "method": "btree",
1192
+ "with": {}
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
+ "tableTo": "junior_identities",
1200
+ "columnsFrom": ["creator_identity_id"],
1201
+ "columnsTo": ["id"],
1202
+ "onDelete": "no action",
1203
+ "onUpdate": "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
+ "concurrently": false,
1332
+ "method": "btree",
1333
+ "with": {}
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
+ "concurrently": false,
1347
+ "method": "btree",
1348
+ "with": {}
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
+ "concurrently": false,
1362
+ "method": "btree",
1363
+ "with": {}
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
+ "concurrently": false,
1377
+ "method": "btree",
1378
+ "with": {}
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
+ "where": "\"junior_code_changes\".\"state\" = 'open'",
1392
+ "concurrently": false,
1393
+ "method": "btree",
1394
+ "with": {}
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
+ "tableTo": "junior_code_repositories",
1402
+ "columnsFrom": ["repository_id"],
1403
+ "columnsTo": ["id"],
1404
+ "onDelete": "cascade",
1405
+ "onUpdate": "no action"
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
+ "concurrently": false,
1474
+ "method": "btree",
1475
+ "with": {}
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
+ "tableTo": "junior_conversations",
1538
+ "columnsFrom": ["conversation_id"],
1539
+ "columnsTo": ["conversation_id"],
1540
+ "onDelete": "cascade",
1541
+ "onUpdate": "no action"
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
+ "concurrently": false,
1610
+ "method": "btree",
1611
+ "with": {}
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
+ "tableTo": "junior_conversations",
1619
+ "columnsFrom": ["conversation_id"],
1620
+ "columnsTo": ["conversation_id"],
1621
+ "onDelete": "no action",
1622
+ "onUpdate": "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
+ "concurrently": false,
1720
+ "method": "btree",
1721
+ "with": {}
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
+ "concurrently": false,
1741
+ "method": "btree",
1742
+ "with": {}
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
+ "asc": true,
1750
+ "isExpression": true,
1751
+ "nulls": "last"
1752
+ }
1753
+ ],
1754
+ "isUnique": false,
1755
+ "concurrently": false,
1756
+ "method": "gin",
1757
+ "with": {}
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
+ "tableTo": "junior_conversations",
1765
+ "columnsFrom": ["conversation_id"],
1766
+ "columnsTo": ["conversation_id"],
1767
+ "onDelete": "cascade",
1768
+ "onUpdate": "no action"
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
+ "concurrently": false,
1867
+ "method": "btree",
1868
+ "with": {}
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
+ "concurrently": false,
1894
+ "method": "btree",
1895
+ "with": {}
1896
+ },
1897
+ "junior_conversation_events_plugin_report_idx": {
1898
+ "name": "junior_conversation_events_plugin_report_idx",
1899
+ "columns": [
1900
+ {
1901
+ "expression": "(\"payload\"->>'namespace')",
1902
+ "asc": true,
1903
+ "isExpression": true,
1904
+ "nulls": "last"
1905
+ },
1906
+ {
1907
+ "expression": "(\"payload\"->>'name')",
1908
+ "asc": true,
1909
+ "isExpression": 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
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
1921
+ "concurrently": false,
1922
+ "method": "btree",
1923
+ "with": {}
1924
+ },
1925
+ "junior_conversation_events_guardian_review_time_idx": {
1926
+ "name": "junior_conversation_events_guardian_review_time_idx",
1927
+ "columns": [
1928
+ {
1929
+ "expression": "created_at",
1930
+ "isExpression": false,
1931
+ "asc": true,
1932
+ "nulls": "last"
1933
+ }
1934
+ ],
1935
+ "isUnique": false,
1936
+ "where": "\"junior_conversation_events\".\"type\" = 'guardian_action_reviewed'",
1937
+ "concurrently": false,
1938
+ "method": "btree",
1939
+ "with": {}
1940
+ },
1941
+ "junior_conversation_events_plugin_conversation_idx": {
1942
+ "name": "junior_conversation_events_plugin_conversation_idx",
1943
+ "columns": [
1944
+ {
1945
+ "expression": "conversation_id",
1946
+ "isExpression": false,
1947
+ "asc": true,
1948
+ "nulls": "last"
1949
+ },
1950
+ {
1951
+ "expression": "(\"payload\"->>'namespace')",
1952
+ "asc": true,
1953
+ "isExpression": true,
1954
+ "nulls": "last"
1955
+ },
1956
+ {
1957
+ "expression": "(\"payload\"->>'name')",
1958
+ "asc": true,
1959
+ "isExpression": true,
1960
+ "nulls": "last"
1961
+ },
1962
+ {
1963
+ "expression": "seq",
1964
+ "isExpression": false,
1965
+ "asc": true,
1966
+ "nulls": "last"
1967
+ }
1968
+ ],
1969
+ "isUnique": false,
1970
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
1971
+ "concurrently": false,
1972
+ "method": "btree",
1973
+ "with": {}
1974
+ },
1975
+ "junior_conversation_events_actor_identity_idx": {
1976
+ "name": "junior_conversation_events_actor_identity_idx",
1977
+ "columns": [
1978
+ {
1979
+ "expression": "actor_identity_id",
1980
+ "isExpression": false,
1981
+ "asc": true,
1982
+ "nulls": "last"
1983
+ },
1984
+ {
1985
+ "expression": "conversation_id",
1986
+ "isExpression": false,
1987
+ "asc": true,
1988
+ "nulls": "last"
1989
+ },
1990
+ {
1991
+ "expression": "seq",
1992
+ "isExpression": false,
1993
+ "asc": true,
1994
+ "nulls": "last"
1995
+ }
1996
+ ],
1997
+ "isUnique": false,
1998
+ "concurrently": false,
1999
+ "method": "btree",
2000
+ "with": {}
2001
+ },
2002
+ "junior_conversation_events_author_idx": {
2003
+ "name": "junior_conversation_events_author_idx",
2004
+ "columns": [
2005
+ {
2006
+ "expression": "conversation_id",
2007
+ "isExpression": false,
2008
+ "asc": true,
2009
+ "nulls": "last"
2010
+ },
2011
+ {
2012
+ "expression": "actor_identity_id",
2013
+ "isExpression": false,
2014
+ "asc": true,
2015
+ "nulls": "last"
2016
+ },
2017
+ {
2018
+ "expression": "seq",
2019
+ "isExpression": false,
2020
+ "asc": true,
2021
+ "nulls": "last"
2022
+ }
2023
+ ],
2024
+ "isUnique": false,
2025
+ "where": "\"junior_conversation_events\".\"actor_identity_id\" is not null",
2026
+ "concurrently": false,
2027
+ "method": "btree",
2028
+ "with": {}
2029
+ },
2030
+ "junior_conversation_events_message_role_idx": {
2031
+ "name": "junior_conversation_events_message_role_idx",
2032
+ "columns": [
2033
+ {
2034
+ "expression": "conversation_id",
2035
+ "isExpression": false,
2036
+ "asc": true,
2037
+ "nulls": "last"
2038
+ },
2039
+ {
2040
+ "expression": "(\"payload\"->>'role')",
2041
+ "asc": true,
2042
+ "isExpression": true,
2043
+ "nulls": "last"
2044
+ },
2045
+ {
2046
+ "expression": "created_at",
2047
+ "isExpression": false,
2048
+ "asc": true,
2049
+ "nulls": "last"
2050
+ },
2051
+ {
2052
+ "expression": "seq",
2053
+ "isExpression": false,
2054
+ "asc": true,
2055
+ "nulls": "last"
2056
+ }
2057
+ ],
2058
+ "isUnique": false,
2059
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2060
+ "concurrently": false,
2061
+ "method": "btree",
2062
+ "with": {}
2063
+ },
2064
+ "junior_conversation_events_user_message_time_idx": {
2065
+ "name": "junior_conversation_events_user_message_time_idx",
2066
+ "columns": [
2067
+ {
2068
+ "expression": "conversation_id",
2069
+ "isExpression": false,
2070
+ "asc": true,
2071
+ "nulls": "last"
2072
+ },
2073
+ {
2074
+ "expression": "created_at",
2075
+ "isExpression": false,
2076
+ "asc": true,
2077
+ "nulls": "last"
2078
+ },
2079
+ {
2080
+ "expression": "seq",
2081
+ "isExpression": false,
2082
+ "asc": true,
2083
+ "nulls": "last"
2084
+ }
2085
+ ],
2086
+ "isUnique": false,
2087
+ "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')",
2088
+ "concurrently": false,
2089
+ "method": "btree",
2090
+ "with": {}
2091
+ },
2092
+ "junior_conversation_events_message_search_idx": {
2093
+ "name": "junior_conversation_events_message_search_idx",
2094
+ "columns": [
2095
+ {
2096
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
2097
+ "asc": true,
2098
+ "isExpression": true,
2099
+ "nulls": "last"
2100
+ }
2101
+ ],
2102
+ "isUnique": false,
2103
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2104
+ "concurrently": false,
2105
+ "method": "gin",
2106
+ "with": {}
2107
+ },
2108
+ "junior_conversation_events_idempotency_idx": {
2109
+ "name": "junior_conversation_events_idempotency_idx",
2110
+ "columns": [
2111
+ {
2112
+ "expression": "conversation_id",
2113
+ "isExpression": false,
2114
+ "asc": true,
2115
+ "nulls": "last"
2116
+ },
2117
+ {
2118
+ "expression": "idempotency_key",
2119
+ "isExpression": false,
2120
+ "asc": true,
2121
+ "nulls": "last"
2122
+ }
2123
+ ],
2124
+ "isUnique": true,
2125
+ "concurrently": false,
2126
+ "method": "btree",
2127
+ "with": {}
2128
+ }
2129
+ },
2130
+ "foreignKeys": {
2131
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
2132
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
2133
+ "tableFrom": "junior_conversation_events",
2134
+ "tableTo": "junior_identities",
2135
+ "columnsFrom": ["actor_identity_id"],
2136
+ "columnsTo": ["id"],
2137
+ "onDelete": "no action",
2138
+ "onUpdate": "no action"
2139
+ },
2140
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
2141
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
2142
+ "tableFrom": "junior_conversation_events",
2143
+ "tableTo": "junior_conversations",
2144
+ "columnsFrom": ["conversation_id"],
2145
+ "columnsTo": ["conversation_id"],
2146
+ "onDelete": "no action",
2147
+ "onUpdate": "no action"
2148
+ }
2149
+ },
2150
+ "compositePrimaryKeys": {
2151
+ "junior_conversation_events_conversation_id_seq_pk": {
2152
+ "name": "junior_conversation_events_conversation_id_seq_pk",
2153
+ "columns": ["conversation_id", "seq"]
2154
+ }
2155
+ },
2156
+ "uniqueConstraints": {},
2157
+ "policies": {},
2158
+ "checkConstraints": {},
2159
+ "isRLSEnabled": false
2160
+ },
2161
+ "public.junior_conversation_metrics": {
2162
+ "name": "junior_conversation_metrics",
2163
+ "schema": "",
2164
+ "columns": {
2165
+ "conversation_id": {
2166
+ "name": "conversation_id",
2167
+ "type": "text",
2168
+ "primaryKey": false,
2169
+ "notNull": true
2170
+ },
2171
+ "run_id": {
2172
+ "name": "run_id",
2173
+ "type": "text",
2174
+ "primaryKey": false,
2175
+ "notNull": true
2176
+ },
2177
+ "metric": {
2178
+ "name": "metric",
2179
+ "type": "text",
2180
+ "primaryKey": false,
2181
+ "notNull": true
2182
+ },
2183
+ "value": {
2184
+ "name": "value",
2185
+ "type": "double precision",
2186
+ "primaryKey": false,
2187
+ "notNull": true
2188
+ },
2189
+ "occurred_at": {
2190
+ "name": "occurred_at",
2191
+ "type": "timestamp with time zone",
2192
+ "primaryKey": false,
2193
+ "notNull": true
2194
+ },
2195
+ "updated_at": {
2196
+ "name": "updated_at",
2197
+ "type": "timestamp with time zone",
2198
+ "primaryKey": false,
2199
+ "notNull": true
2200
+ }
2201
+ },
2202
+ "indexes": {
2203
+ "junior_conversation_metrics_occurred_at_metric_idx": {
2204
+ "name": "junior_conversation_metrics_occurred_at_metric_idx",
2205
+ "columns": [
2206
+ {
2207
+ "expression": "occurred_at",
2208
+ "isExpression": false,
2209
+ "asc": true,
2210
+ "nulls": "last"
2211
+ },
2212
+ {
2213
+ "expression": "metric",
2214
+ "isExpression": false,
2215
+ "asc": true,
2216
+ "nulls": "last"
2217
+ }
2218
+ ],
2219
+ "isUnique": false,
2220
+ "concurrently": false,
2221
+ "method": "btree",
2222
+ "with": {}
2223
+ }
2224
+ },
2225
+ "foreignKeys": {
2226
+ "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk": {
2227
+ "name": "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
2228
+ "tableFrom": "junior_conversation_metrics",
2229
+ "tableTo": "junior_conversations",
2230
+ "columnsFrom": ["conversation_id"],
2231
+ "columnsTo": ["conversation_id"],
2232
+ "onDelete": "no action",
2233
+ "onUpdate": "no action"
2234
+ }
2235
+ },
2236
+ "compositePrimaryKeys": {
2237
+ "junior_conversation_metrics_conversation_id_run_id_metric_pk": {
2238
+ "name": "junior_conversation_metrics_conversation_id_run_id_metric_pk",
2239
+ "columns": ["conversation_id", "run_id", "metric"]
2240
+ }
2241
+ },
2242
+ "uniqueConstraints": {},
2243
+ "policies": {},
2244
+ "checkConstraints": {},
2245
+ "isRLSEnabled": false
2246
+ },
2247
+ "public.junior_conversation_participants": {
2248
+ "name": "junior_conversation_participants",
2249
+ "schema": "",
2250
+ "columns": {
2251
+ "user_id": {
2252
+ "name": "user_id",
2253
+ "type": "text",
2254
+ "primaryKey": false,
2255
+ "notNull": true
2256
+ },
2257
+ "root_conversation_id": {
2258
+ "name": "root_conversation_id",
2259
+ "type": "text",
2260
+ "primaryKey": false,
2261
+ "notNull": true
2262
+ },
2263
+ "last_message_at": {
2264
+ "name": "last_message_at",
2265
+ "type": "timestamp with time zone",
2266
+ "primaryKey": false,
2267
+ "notNull": true
2268
+ },
2269
+ "archived_at": {
2270
+ "name": "archived_at",
2271
+ "type": "timestamp with time zone",
2272
+ "primaryKey": false,
2273
+ "notNull": false
2274
+ },
2275
+ "pinned_at": {
2276
+ "name": "pinned_at",
2277
+ "type": "timestamp with time zone",
2278
+ "primaryKey": false,
2279
+ "notNull": false
2280
+ },
2281
+ "pin_position": {
2282
+ "name": "pin_position",
2283
+ "type": "integer",
2284
+ "primaryKey": false,
2285
+ "notNull": false
2286
+ },
2287
+ "auto_archive": {
2288
+ "name": "auto_archive",
2289
+ "type": "boolean",
2290
+ "primaryKey": false,
2291
+ "notNull": false
2292
+ },
2293
+ "unsubscribed_at": {
2294
+ "name": "unsubscribed_at",
2295
+ "type": "timestamp with time zone",
2296
+ "primaryKey": false,
2297
+ "notNull": false
2298
+ }
2299
+ },
2300
+ "indexes": {
2301
+ "junior_conversation_participants_user_activity_idx": {
2302
+ "name": "junior_conversation_participants_user_activity_idx",
2303
+ "columns": [
2304
+ {
2305
+ "expression": "user_id",
2306
+ "isExpression": false,
2307
+ "asc": true,
2308
+ "nulls": "last"
2309
+ },
2310
+ {
2311
+ "expression": "last_message_at",
2312
+ "isExpression": false,
2313
+ "asc": false,
2314
+ "nulls": "last"
2315
+ }
2316
+ ],
2317
+ "isUnique": false,
2318
+ "concurrently": false,
2319
+ "method": "btree",
2320
+ "with": {}
2321
+ },
2322
+ "junior_conversation_participants_root_idx": {
2323
+ "name": "junior_conversation_participants_root_idx",
2324
+ "columns": [
2325
+ {
2326
+ "expression": "root_conversation_id",
2327
+ "isExpression": false,
2328
+ "asc": true,
2329
+ "nulls": "last"
2330
+ }
2331
+ ],
2332
+ "isUnique": false,
2333
+ "concurrently": false,
2334
+ "method": "btree",
2335
+ "with": {}
2336
+ },
2337
+ "junior_conversation_participants_auto_archive_idx": {
2338
+ "name": "junior_conversation_participants_auto_archive_idx",
2339
+ "columns": [
2340
+ {
2341
+ "expression": "user_id",
2342
+ "isExpression": false,
2343
+ "asc": true,
2344
+ "nulls": "last"
2345
+ }
2346
+ ],
2347
+ "isUnique": false,
2348
+ "where": "\"junior_conversation_participants\".\"auto_archive\"",
2349
+ "concurrently": false,
2350
+ "method": "btree",
2351
+ "with": {}
2352
+ },
2353
+ "junior_conversation_participants_unsubscribed_idx": {
2354
+ "name": "junior_conversation_participants_unsubscribed_idx",
2355
+ "columns": [
2356
+ {
2357
+ "expression": "user_id",
2358
+ "isExpression": false,
2359
+ "asc": true,
2360
+ "nulls": "last"
2361
+ },
2362
+ {
2363
+ "expression": "root_conversation_id",
2364
+ "isExpression": false,
2365
+ "asc": true,
2366
+ "nulls": "last"
2367
+ }
2368
+ ],
2369
+ "isUnique": false,
2370
+ "where": "\"junior_conversation_participants\".\"unsubscribed_at\" is not null",
2371
+ "concurrently": false,
2372
+ "method": "btree",
2373
+ "with": {}
2374
+ }
2375
+ },
2376
+ "foreignKeys": {
2377
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
2378
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
2379
+ "tableFrom": "junior_conversation_participants",
2380
+ "tableTo": "junior_users",
2381
+ "columnsFrom": ["user_id"],
2382
+ "columnsTo": ["id"],
2383
+ "onDelete": "no action",
2384
+ "onUpdate": "no action"
2385
+ },
2386
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
2387
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
2388
+ "tableFrom": "junior_conversation_participants",
2389
+ "tableTo": "junior_conversations",
2390
+ "columnsFrom": ["root_conversation_id"],
2391
+ "columnsTo": ["conversation_id"],
2392
+ "onDelete": "no action",
2393
+ "onUpdate": "no action"
2394
+ }
2395
+ },
2396
+ "compositePrimaryKeys": {
2397
+ "junior_conversation_participants_user_root_pk": {
2398
+ "name": "junior_conversation_participants_user_root_pk",
2399
+ "columns": ["user_id", "root_conversation_id"]
2400
+ }
2401
+ },
2402
+ "uniqueConstraints": {},
2403
+ "policies": {},
2404
+ "checkConstraints": {},
2405
+ "isRLSEnabled": false
2406
+ },
2407
+ "public.junior_conversation_read_positions": {
2408
+ "name": "junior_conversation_read_positions",
2409
+ "schema": "",
2410
+ "columns": {
2411
+ "user_id": {
2412
+ "name": "user_id",
2413
+ "type": "text",
2414
+ "primaryKey": false,
2415
+ "notNull": true
2416
+ },
2417
+ "conversation_id": {
2418
+ "name": "conversation_id",
2419
+ "type": "text",
2420
+ "primaryKey": false,
2421
+ "notNull": true
2422
+ },
2423
+ "last_read_seq": {
2424
+ "name": "last_read_seq",
2425
+ "type": "integer",
2426
+ "primaryKey": false,
2427
+ "notNull": true
2428
+ },
2429
+ "updated_at": {
2430
+ "name": "updated_at",
2431
+ "type": "timestamp with time zone",
2432
+ "primaryKey": false,
2433
+ "notNull": true
2434
+ }
2435
+ },
2436
+ "indexes": {},
2437
+ "foreignKeys": {
2438
+ "junior_conversation_read_positions_user_id_junior_users_id_fk": {
2439
+ "name": "junior_conversation_read_positions_user_id_junior_users_id_fk",
2440
+ "tableFrom": "junior_conversation_read_positions",
2441
+ "tableTo": "junior_users",
2442
+ "columnsFrom": ["user_id"],
2443
+ "columnsTo": ["id"],
2444
+ "onDelete": "no action",
2445
+ "onUpdate": "no action"
2446
+ },
2447
+ "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk": {
2448
+ "name": "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk",
2449
+ "tableFrom": "junior_conversation_read_positions",
2450
+ "tableTo": "junior_conversations",
2451
+ "columnsFrom": ["conversation_id"],
2452
+ "columnsTo": ["conversation_id"],
2453
+ "onDelete": "no action",
2454
+ "onUpdate": "no action"
2455
+ }
2456
+ },
2457
+ "compositePrimaryKeys": {
2458
+ "junior_conversation_read_positions_user_conversation_pk": {
2459
+ "name": "junior_conversation_read_positions_user_conversation_pk",
2460
+ "columns": ["user_id", "conversation_id"]
2461
+ }
2462
+ },
2463
+ "uniqueConstraints": {},
2464
+ "policies": {},
2465
+ "checkConstraints": {},
2466
+ "isRLSEnabled": false
2467
+ },
2468
+ "public.junior_conversations": {
2469
+ "name": "junior_conversations",
2470
+ "schema": "",
2471
+ "columns": {
2472
+ "conversation_id": {
2473
+ "name": "conversation_id",
2474
+ "type": "text",
2475
+ "primaryKey": true,
2476
+ "notNull": true
2477
+ },
2478
+ "schema_version": {
2479
+ "name": "schema_version",
2480
+ "type": "integer",
2481
+ "primaryKey": false,
2482
+ "notNull": true,
2483
+ "default": 1
2484
+ },
2485
+ "source": {
2486
+ "name": "source",
2487
+ "type": "text",
2488
+ "primaryKey": false,
2489
+ "notNull": false
2490
+ },
2491
+ "source_json": {
2492
+ "name": "source_json",
2493
+ "type": "jsonb",
2494
+ "primaryKey": false,
2495
+ "notNull": false
2496
+ },
2497
+ "location_json": {
2498
+ "name": "location_json",
2499
+ "type": "jsonb",
2500
+ "primaryKey": false,
2501
+ "notNull": false
2502
+ },
2503
+ "destination_id": {
2504
+ "name": "destination_id",
2505
+ "type": "text",
2506
+ "primaryKey": false,
2507
+ "notNull": false
2508
+ },
2509
+ "destination_json": {
2510
+ "name": "destination_json",
2511
+ "type": "jsonb",
2512
+ "primaryKey": false,
2513
+ "notNull": false
2514
+ },
2515
+ "actor_identity_id": {
2516
+ "name": "actor_identity_id",
2517
+ "type": "text",
2518
+ "primaryKey": false,
2519
+ "notNull": false
2520
+ },
2521
+ "creator_identity_id": {
2522
+ "name": "creator_identity_id",
2523
+ "type": "text",
2524
+ "primaryKey": false,
2525
+ "notNull": false
2526
+ },
2527
+ "credential_subject_identity_id": {
2528
+ "name": "credential_subject_identity_id",
2529
+ "type": "text",
2530
+ "primaryKey": false,
2531
+ "notNull": false
2532
+ },
2533
+ "actor_json": {
2534
+ "name": "actor_json",
2535
+ "type": "jsonb",
2536
+ "primaryKey": false,
2537
+ "notNull": false
2538
+ },
2539
+ "channel_name": {
2540
+ "name": "channel_name",
2541
+ "type": "text",
2542
+ "primaryKey": false,
2543
+ "notNull": false
2544
+ },
2545
+ "title": {
2546
+ "name": "title",
2547
+ "type": "text",
2548
+ "primaryKey": false,
2549
+ "notNull": false
2550
+ },
2551
+ "created_at": {
2552
+ "name": "created_at",
2553
+ "type": "timestamp with time zone",
2554
+ "primaryKey": false,
2555
+ "notNull": true
2556
+ },
2557
+ "last_activity_at": {
2558
+ "name": "last_activity_at",
2559
+ "type": "timestamp with time zone",
2560
+ "primaryKey": false,
2561
+ "notNull": true
2562
+ },
2563
+ "updated_at": {
2564
+ "name": "updated_at",
2565
+ "type": "timestamp with time zone",
2566
+ "primaryKey": false,
2567
+ "notNull": true
2568
+ },
2569
+ "execution_updated_at": {
2570
+ "name": "execution_updated_at",
2571
+ "type": "timestamp with time zone",
2572
+ "primaryKey": false,
2573
+ "notNull": false
2574
+ },
2575
+ "execution_status": {
2576
+ "name": "execution_status",
2577
+ "type": "text",
2578
+ "primaryKey": false,
2579
+ "notNull": true
2580
+ },
2581
+ "run_id": {
2582
+ "name": "run_id",
2583
+ "type": "text",
2584
+ "primaryKey": false,
2585
+ "notNull": false
2586
+ },
2587
+ "last_checkpoint_at": {
2588
+ "name": "last_checkpoint_at",
2589
+ "type": "timestamp with time zone",
2590
+ "primaryKey": false,
2591
+ "notNull": false
2592
+ },
2593
+ "last_enqueued_at": {
2594
+ "name": "last_enqueued_at",
2595
+ "type": "timestamp with time zone",
2596
+ "primaryKey": false,
2597
+ "notNull": false
2598
+ },
2599
+ "parent_conversation_id": {
2600
+ "name": "parent_conversation_id",
2601
+ "type": "text",
2602
+ "primaryKey": false,
2603
+ "notNull": false
2604
+ },
2605
+ "kind": {
2606
+ "name": "kind",
2607
+ "type": "text",
2608
+ "primaryKey": false,
2609
+ "notNull": false
2610
+ },
2611
+ "archived_at": {
2612
+ "name": "archived_at",
2613
+ "type": "timestamp with time zone",
2614
+ "primaryKey": false,
2615
+ "notNull": false
2616
+ },
2617
+ "child_archived_at": {
2618
+ "name": "child_archived_at",
2619
+ "type": "timestamp with time zone",
2620
+ "primaryKey": false,
2621
+ "notNull": false
2622
+ },
2623
+ "forked_from_conversation_id": {
2624
+ "name": "forked_from_conversation_id",
2625
+ "type": "text",
2626
+ "primaryKey": false,
2627
+ "notNull": false
2628
+ },
2629
+ "quick_question_at": {
2630
+ "name": "quick_question_at",
2631
+ "type": "timestamp with time zone",
2632
+ "primaryKey": false,
2633
+ "notNull": false
2634
+ },
2635
+ "root_conversation_id": {
2636
+ "name": "root_conversation_id",
2637
+ "type": "text",
2638
+ "primaryKey": false,
2639
+ "notNull": false
2640
+ },
2641
+ "transcript_purged_at": {
2642
+ "name": "transcript_purged_at",
2643
+ "type": "timestamp with time zone",
2644
+ "primaryKey": false,
2645
+ "notNull": false
2646
+ },
2647
+ "stopped_at": {
2648
+ "name": "stopped_at",
2649
+ "type": "timestamp with time zone",
2650
+ "primaryKey": false,
2651
+ "notNull": false
2652
+ },
2653
+ "duration_ms": {
2654
+ "name": "duration_ms",
2655
+ "type": "integer",
2656
+ "primaryKey": false,
2657
+ "notNull": true,
2658
+ "default": 0
2659
+ },
2660
+ "usage_json": {
2661
+ "name": "usage_json",
2662
+ "type": "jsonb",
2663
+ "primaryKey": false,
2664
+ "notNull": false
2665
+ },
2666
+ "execution_duration_ms": {
2667
+ "name": "execution_duration_ms",
2668
+ "type": "integer",
2669
+ "primaryKey": false,
2670
+ "notNull": true,
2671
+ "default": 0
2672
+ },
2673
+ "execution_usage_json": {
2674
+ "name": "execution_usage_json",
2675
+ "type": "jsonb",
2676
+ "primaryKey": false,
2677
+ "notNull": false
2678
+ },
2679
+ "metric_run_id": {
2680
+ "name": "metric_run_id",
2681
+ "type": "text",
2682
+ "primaryKey": false,
2683
+ "notNull": false
2684
+ },
2685
+ "detail_version": {
2686
+ "name": "detail_version",
2687
+ "type": "integer",
2688
+ "primaryKey": false,
2689
+ "notNull": true,
2690
+ "default": 0
2691
+ }
2692
+ },
2693
+ "indexes": {
2694
+ "junior_conversations_last_activity_idx": {
2695
+ "name": "junior_conversations_last_activity_idx",
2696
+ "columns": [
2697
+ {
2698
+ "expression": "last_activity_at",
2699
+ "isExpression": false,
2700
+ "asc": false,
2701
+ "nulls": "last"
2702
+ },
2703
+ {
2704
+ "expression": "conversation_id",
2705
+ "isExpression": false,
2706
+ "asc": true,
2707
+ "nulls": "last"
2708
+ }
2709
+ ],
2710
+ "isUnique": false,
2711
+ "concurrently": false,
2712
+ "method": "btree",
2713
+ "with": {}
2714
+ },
2715
+ "junior_conversations_active_idx": {
2716
+ "name": "junior_conversations_active_idx",
2717
+ "columns": [
2718
+ {
2719
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
2720
+ "asc": true,
2721
+ "isExpression": true,
2722
+ "nulls": "last"
2723
+ },
2724
+ {
2725
+ "expression": "conversation_id",
2726
+ "isExpression": false,
2727
+ "asc": true,
2728
+ "nulls": "last"
2729
+ }
2730
+ ],
2731
+ "isUnique": false,
2732
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
2733
+ "concurrently": false,
2734
+ "method": "btree",
2735
+ "with": {}
2736
+ },
2737
+ "junior_conversations_destination_activity_idx": {
2738
+ "name": "junior_conversations_destination_activity_idx",
2739
+ "columns": [
2740
+ {
2741
+ "expression": "destination_id",
2742
+ "isExpression": false,
2743
+ "asc": true,
2744
+ "nulls": "last"
2745
+ },
2746
+ {
2747
+ "expression": "last_activity_at",
2748
+ "isExpression": false,
2749
+ "asc": false,
2750
+ "nulls": "last"
2751
+ }
2752
+ ],
2753
+ "isUnique": false,
2754
+ "concurrently": false,
2755
+ "method": "btree",
2756
+ "with": {}
2757
+ },
2758
+ "junior_conversations_actor_activity_idx": {
2759
+ "name": "junior_conversations_actor_activity_idx",
2760
+ "columns": [
2761
+ {
2762
+ "expression": "actor_identity_id",
2763
+ "isExpression": false,
2764
+ "asc": true,
2765
+ "nulls": "last"
2766
+ },
2767
+ {
2768
+ "expression": "last_activity_at",
2769
+ "isExpression": false,
2770
+ "asc": false,
2771
+ "nulls": "last"
2772
+ }
2773
+ ],
2774
+ "isUnique": false,
2775
+ "concurrently": false,
2776
+ "method": "btree",
2777
+ "with": {}
2778
+ },
2779
+ "junior_conversations_parent_idx": {
2780
+ "name": "junior_conversations_parent_idx",
2781
+ "columns": [
2782
+ {
2783
+ "expression": "parent_conversation_id",
2784
+ "isExpression": false,
2785
+ "asc": true,
2786
+ "nulls": "last"
2787
+ }
2788
+ ],
2789
+ "isUnique": false,
2790
+ "concurrently": false,
2791
+ "method": "btree",
2792
+ "with": {}
2793
+ },
2794
+ "junior_conversations_forked_from_idx": {
2795
+ "name": "junior_conversations_forked_from_idx",
2796
+ "columns": [
2797
+ {
2798
+ "expression": "forked_from_conversation_id",
2799
+ "isExpression": false,
2800
+ "asc": true,
2801
+ "nulls": "last"
2802
+ }
2803
+ ],
2804
+ "isUnique": false,
2805
+ "concurrently": false,
2806
+ "method": "btree",
2807
+ "with": {}
2808
+ },
2809
+ "junior_conversations_root_idx": {
2810
+ "name": "junior_conversations_root_idx",
2811
+ "columns": [
2812
+ {
2813
+ "expression": "root_conversation_id",
2814
+ "isExpression": false,
2815
+ "asc": true,
2816
+ "nulls": "last"
2817
+ }
2818
+ ],
2819
+ "isUnique": false,
2820
+ "concurrently": false,
2821
+ "method": "btree",
2822
+ "with": {}
2823
+ }
2824
+ },
2825
+ "foreignKeys": {
2826
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
2827
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
2828
+ "tableFrom": "junior_conversations",
2829
+ "tableTo": "junior_destinations",
2830
+ "columnsFrom": ["destination_id"],
2831
+ "columnsTo": ["id"],
2832
+ "onDelete": "no action",
2833
+ "onUpdate": "no action"
2834
+ },
2835
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
2836
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
2837
+ "tableFrom": "junior_conversations",
2838
+ "tableTo": "junior_identities",
2839
+ "columnsFrom": ["actor_identity_id"],
2840
+ "columnsTo": ["id"],
2841
+ "onDelete": "no action",
2842
+ "onUpdate": "no action"
2843
+ },
2844
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
2845
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
2846
+ "tableFrom": "junior_conversations",
2847
+ "tableTo": "junior_identities",
2848
+ "columnsFrom": ["creator_identity_id"],
2849
+ "columnsTo": ["id"],
2850
+ "onDelete": "no action",
2851
+ "onUpdate": "no action"
2852
+ },
2853
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
2854
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
2855
+ "tableFrom": "junior_conversations",
2856
+ "tableTo": "junior_identities",
2857
+ "columnsFrom": ["credential_subject_identity_id"],
2858
+ "columnsTo": ["id"],
2859
+ "onDelete": "no action",
2860
+ "onUpdate": "no action"
2861
+ },
2862
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
2863
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
2864
+ "tableFrom": "junior_conversations",
2865
+ "tableTo": "junior_conversations",
2866
+ "columnsFrom": ["parent_conversation_id"],
2867
+ "columnsTo": ["conversation_id"],
2868
+ "onDelete": "no action",
2869
+ "onUpdate": "no action"
2870
+ },
2871
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
2872
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
2873
+ "tableFrom": "junior_conversations",
2874
+ "tableTo": "junior_conversations",
2875
+ "columnsFrom": ["forked_from_conversation_id"],
2876
+ "columnsTo": ["conversation_id"],
2877
+ "onDelete": "set null",
2878
+ "onUpdate": "no action"
2879
+ },
2880
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
2881
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
2882
+ "tableFrom": "junior_conversations",
2883
+ "tableTo": "junior_conversations",
2884
+ "columnsFrom": ["root_conversation_id"],
2885
+ "columnsTo": ["conversation_id"],
2886
+ "onDelete": "no action",
2887
+ "onUpdate": "no action"
2888
+ }
2889
+ },
2890
+ "compositePrimaryKeys": {},
2891
+ "uniqueConstraints": {},
2892
+ "policies": {},
2893
+ "checkConstraints": {
2894
+ "junior_conversations_kind_check": {
2895
+ "name": "junior_conversations_kind_check",
2896
+ "value": "\"junior_conversations\".\"kind\" in ('root', 'thread', 'task')"
2897
+ },
2898
+ "junior_conversations_kind_parent_check": {
2899
+ "name": "junior_conversations_kind_parent_check",
2900
+ "value": "\"junior_conversations\".\"kind\" is null or ((\"junior_conversations\".\"kind\" = 'root') = (\"junior_conversations\".\"parent_conversation_id\" is null))"
2901
+ }
2902
+ },
2903
+ "isRLSEnabled": false
2904
+ },
2905
+ "public.junior_destinations": {
2906
+ "name": "junior_destinations",
2907
+ "schema": "",
2908
+ "columns": {
2909
+ "id": {
2910
+ "name": "id",
2911
+ "type": "text",
2912
+ "primaryKey": true,
2913
+ "notNull": true
2914
+ },
2915
+ "provider": {
2916
+ "name": "provider",
2917
+ "type": "text",
2918
+ "primaryKey": false,
2919
+ "notNull": true
2920
+ },
2921
+ "provider_tenant_id": {
2922
+ "name": "provider_tenant_id",
2923
+ "type": "text",
2924
+ "primaryKey": false,
2925
+ "notNull": true,
2926
+ "default": "''"
2927
+ },
2928
+ "provider_destination_id": {
2929
+ "name": "provider_destination_id",
2930
+ "type": "text",
2931
+ "primaryKey": false,
2932
+ "notNull": true
2933
+ },
2934
+ "kind": {
2935
+ "name": "kind",
2936
+ "type": "text",
2937
+ "primaryKey": false,
2938
+ "notNull": true
2939
+ },
2940
+ "parent_destination_id": {
2941
+ "name": "parent_destination_id",
2942
+ "type": "text",
2943
+ "primaryKey": false,
2944
+ "notNull": false
2945
+ },
2946
+ "display_name": {
2947
+ "name": "display_name",
2948
+ "type": "text",
2949
+ "primaryKey": false,
2950
+ "notNull": false
2951
+ },
2952
+ "visibility": {
2953
+ "name": "visibility",
2954
+ "type": "text",
2955
+ "primaryKey": false,
2956
+ "notNull": true,
2957
+ "default": "'unknown'"
2958
+ },
2959
+ "metadata_json": {
2960
+ "name": "metadata_json",
2961
+ "type": "jsonb",
2962
+ "primaryKey": false,
2963
+ "notNull": false
2964
+ },
2965
+ "created_at": {
2966
+ "name": "created_at",
2967
+ "type": "timestamp with time zone",
2968
+ "primaryKey": false,
2969
+ "notNull": true
2970
+ },
2971
+ "updated_at": {
2972
+ "name": "updated_at",
2973
+ "type": "timestamp with time zone",
2974
+ "primaryKey": false,
2975
+ "notNull": true
2976
+ }
2977
+ },
2978
+ "indexes": {
2979
+ "junior_destinations_provider_destination_uidx": {
2980
+ "name": "junior_destinations_provider_destination_uidx",
2981
+ "columns": [
2982
+ {
2983
+ "expression": "provider",
2984
+ "isExpression": false,
2985
+ "asc": true,
2986
+ "nulls": "last"
2987
+ },
2988
+ {
2989
+ "expression": "provider_tenant_id",
2990
+ "isExpression": false,
2991
+ "asc": true,
2992
+ "nulls": "last"
2993
+ },
2994
+ {
2995
+ "expression": "provider_destination_id",
2996
+ "isExpression": false,
2997
+ "asc": true,
2998
+ "nulls": "last"
2999
+ }
3000
+ ],
3001
+ "isUnique": true,
3002
+ "concurrently": false,
3003
+ "method": "btree",
3004
+ "with": {}
3005
+ },
3006
+ "junior_destinations_provider_kind_idx": {
3007
+ "name": "junior_destinations_provider_kind_idx",
3008
+ "columns": [
3009
+ {
3010
+ "expression": "provider",
3011
+ "isExpression": false,
3012
+ "asc": true,
3013
+ "nulls": "last"
3014
+ },
3015
+ {
3016
+ "expression": "kind",
3017
+ "isExpression": false,
3018
+ "asc": true,
3019
+ "nulls": "last"
3020
+ }
3021
+ ],
3022
+ "isUnique": false,
3023
+ "concurrently": false,
3024
+ "method": "btree",
3025
+ "with": {}
3026
+ }
3027
+ },
3028
+ "foreignKeys": {},
3029
+ "compositePrimaryKeys": {},
3030
+ "uniqueConstraints": {},
3031
+ "policies": {},
3032
+ "checkConstraints": {},
3033
+ "isRLSEnabled": false
3034
+ },
3035
+ "public.junior_identities": {
3036
+ "name": "junior_identities",
3037
+ "schema": "",
3038
+ "columns": {
3039
+ "id": {
3040
+ "name": "id",
3041
+ "type": "text",
3042
+ "primaryKey": true,
3043
+ "notNull": true
3044
+ },
3045
+ "kind": {
3046
+ "name": "kind",
3047
+ "type": "text",
3048
+ "primaryKey": false,
3049
+ "notNull": true
3050
+ },
3051
+ "provider": {
3052
+ "name": "provider",
3053
+ "type": "text",
3054
+ "primaryKey": false,
3055
+ "notNull": true
3056
+ },
3057
+ "provider_tenant_id": {
3058
+ "name": "provider_tenant_id",
3059
+ "type": "text",
3060
+ "primaryKey": false,
3061
+ "notNull": true,
3062
+ "default": "''"
3063
+ },
3064
+ "provider_subject_id": {
3065
+ "name": "provider_subject_id",
3066
+ "type": "text",
3067
+ "primaryKey": false,
3068
+ "notNull": true
3069
+ },
3070
+ "display_name": {
3071
+ "name": "display_name",
3072
+ "type": "text",
3073
+ "primaryKey": false,
3074
+ "notNull": false
3075
+ },
3076
+ "handle": {
3077
+ "name": "handle",
3078
+ "type": "text",
3079
+ "primaryKey": false,
3080
+ "notNull": false
3081
+ },
3082
+ "email": {
3083
+ "name": "email",
3084
+ "type": "text",
3085
+ "primaryKey": false,
3086
+ "notNull": false
3087
+ },
3088
+ "avatar_url": {
3089
+ "name": "avatar_url",
3090
+ "type": "text",
3091
+ "primaryKey": false,
3092
+ "notNull": false
3093
+ },
3094
+ "metadata_json": {
3095
+ "name": "metadata_json",
3096
+ "type": "jsonb",
3097
+ "primaryKey": false,
3098
+ "notNull": false
3099
+ },
3100
+ "created_at": {
3101
+ "name": "created_at",
3102
+ "type": "timestamp with time zone",
3103
+ "primaryKey": false,
3104
+ "notNull": true
3105
+ },
3106
+ "updated_at": {
3107
+ "name": "updated_at",
3108
+ "type": "timestamp with time zone",
3109
+ "primaryKey": false,
3110
+ "notNull": true
3111
+ },
3112
+ "user_id": {
3113
+ "name": "user_id",
3114
+ "type": "text",
3115
+ "primaryKey": false,
3116
+ "notNull": false
3117
+ },
3118
+ "email_normalized": {
3119
+ "name": "email_normalized",
3120
+ "type": "text",
3121
+ "primaryKey": false,
3122
+ "notNull": false
3123
+ },
3124
+ "email_verified": {
3125
+ "name": "email_verified",
3126
+ "type": "boolean",
3127
+ "primaryKey": false,
3128
+ "notNull": true,
3129
+ "default": false
3130
+ },
3131
+ "signed_in_at": {
3132
+ "name": "signed_in_at",
3133
+ "type": "timestamp with time zone",
3134
+ "primaryKey": false,
3135
+ "notNull": false
3136
+ }
3137
+ },
3138
+ "indexes": {
3139
+ "junior_identities_provider_subject_uidx": {
3140
+ "name": "junior_identities_provider_subject_uidx",
3141
+ "columns": [
3142
+ {
3143
+ "expression": "provider",
3144
+ "isExpression": false,
3145
+ "asc": true,
3146
+ "nulls": "last"
3147
+ },
3148
+ {
3149
+ "expression": "provider_tenant_id",
3150
+ "isExpression": false,
3151
+ "asc": true,
3152
+ "nulls": "last"
3153
+ },
3154
+ {
3155
+ "expression": "provider_subject_id",
3156
+ "isExpression": false,
3157
+ "asc": true,
3158
+ "nulls": "last"
3159
+ }
3160
+ ],
3161
+ "isUnique": true,
3162
+ "concurrently": false,
3163
+ "method": "btree",
3164
+ "with": {}
3165
+ },
3166
+ "junior_identities_user_idx": {
3167
+ "name": "junior_identities_user_idx",
3168
+ "columns": [
3169
+ {
3170
+ "expression": "user_id",
3171
+ "isExpression": false,
3172
+ "asc": true,
3173
+ "nulls": "last"
3174
+ }
3175
+ ],
3176
+ "isUnique": false,
3177
+ "concurrently": false,
3178
+ "method": "btree",
3179
+ "with": {}
3180
+ },
3181
+ "junior_identities_verified_email_idx": {
3182
+ "name": "junior_identities_verified_email_idx",
3183
+ "columns": [
3184
+ {
3185
+ "expression": "email_normalized",
3186
+ "isExpression": false,
3187
+ "asc": true,
3188
+ "nulls": "last"
3189
+ }
3190
+ ],
3191
+ "isUnique": false,
3192
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
3193
+ "concurrently": false,
3194
+ "method": "btree",
3195
+ "with": {}
3196
+ },
3197
+ "junior_identities_kind_provider_idx": {
3198
+ "name": "junior_identities_kind_provider_idx",
3199
+ "columns": [
3200
+ {
3201
+ "expression": "kind",
3202
+ "isExpression": false,
3203
+ "asc": true,
3204
+ "nulls": "last"
3205
+ },
3206
+ {
3207
+ "expression": "provider",
3208
+ "isExpression": false,
3209
+ "asc": true,
3210
+ "nulls": "last"
3211
+ }
3212
+ ],
3213
+ "isUnique": false,
3214
+ "concurrently": false,
3215
+ "method": "btree",
3216
+ "with": {}
3217
+ }
3218
+ },
3219
+ "foreignKeys": {
3220
+ "junior_identities_user_id_junior_users_id_fk": {
3221
+ "name": "junior_identities_user_id_junior_users_id_fk",
3222
+ "tableFrom": "junior_identities",
3223
+ "tableTo": "junior_users",
3224
+ "columnsFrom": ["user_id"],
3225
+ "columnsTo": ["id"],
3226
+ "onDelete": "no action",
3227
+ "onUpdate": "no action"
3228
+ }
3229
+ },
3230
+ "compositePrimaryKeys": {},
3231
+ "uniqueConstraints": {},
3232
+ "policies": {},
3233
+ "checkConstraints": {},
3234
+ "isRLSEnabled": false
3235
+ },
3236
+ "public.junior_location_configurations": {
3237
+ "name": "junior_location_configurations",
3238
+ "schema": "",
3239
+ "columns": {
3240
+ "location_id": {
3241
+ "name": "location_id",
3242
+ "type": "text",
3243
+ "primaryKey": false,
3244
+ "notNull": true
3245
+ },
3246
+ "key": {
3247
+ "name": "key",
3248
+ "type": "text",
3249
+ "primaryKey": false,
3250
+ "notNull": true
3251
+ },
3252
+ "value": {
3253
+ "name": "value",
3254
+ "type": "text",
3255
+ "primaryKey": false,
3256
+ "notNull": true
3257
+ },
3258
+ "updated_at": {
3259
+ "name": "updated_at",
3260
+ "type": "timestamp with time zone",
3261
+ "primaryKey": false,
3262
+ "notNull": true
3263
+ },
3264
+ "updated_by": {
3265
+ "name": "updated_by",
3266
+ "type": "text",
3267
+ "primaryKey": false,
3268
+ "notNull": false
3269
+ },
3270
+ "source": {
3271
+ "name": "source",
3272
+ "type": "text",
3273
+ "primaryKey": false,
3274
+ "notNull": false
3275
+ },
3276
+ "expires_at": {
3277
+ "name": "expires_at",
3278
+ "type": "text",
3279
+ "primaryKey": false,
3280
+ "notNull": false
3281
+ }
3282
+ },
3283
+ "indexes": {},
3284
+ "foreignKeys": {
3285
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3286
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3287
+ "tableFrom": "junior_location_configurations",
3288
+ "tableTo": "junior_destinations",
3289
+ "columnsFrom": ["location_id"],
3290
+ "columnsTo": ["id"],
3291
+ "onDelete": "cascade",
3292
+ "onUpdate": "no action"
3293
+ }
3294
+ },
3295
+ "compositePrimaryKeys": {
3296
+ "junior_location_configurations_location_id_key_pk": {
3297
+ "name": "junior_location_configurations_location_id_key_pk",
3298
+ "columns": ["location_id", "key"]
3299
+ }
3300
+ },
3301
+ "uniqueConstraints": {},
3302
+ "policies": {},
3303
+ "checkConstraints": {},
3304
+ "isRLSEnabled": false
3305
+ },
3306
+ "public.junior_push_subscriptions": {
3307
+ "name": "junior_push_subscriptions",
3308
+ "schema": "",
3309
+ "columns": {
3310
+ "id": {
3311
+ "name": "id",
3312
+ "type": "text",
3313
+ "primaryKey": true,
3314
+ "notNull": true
3315
+ },
3316
+ "user_id": {
3317
+ "name": "user_id",
3318
+ "type": "text",
3319
+ "primaryKey": false,
3320
+ "notNull": true
3321
+ },
3322
+ "endpoint": {
3323
+ "name": "endpoint",
3324
+ "type": "text",
3325
+ "primaryKey": false,
3326
+ "notNull": true
3327
+ },
3328
+ "p256dh": {
3329
+ "name": "p256dh",
3330
+ "type": "text",
3331
+ "primaryKey": false,
3332
+ "notNull": true
3333
+ },
3334
+ "auth": {
3335
+ "name": "auth",
3336
+ "type": "text",
3337
+ "primaryKey": false,
3338
+ "notNull": true
3339
+ },
3340
+ "created_at": {
3341
+ "name": "created_at",
3342
+ "type": "timestamp with time zone",
3343
+ "primaryKey": false,
3344
+ "notNull": true
3345
+ },
3346
+ "updated_at": {
3347
+ "name": "updated_at",
3348
+ "type": "timestamp with time zone",
3349
+ "primaryKey": false,
3350
+ "notNull": true
3351
+ }
3352
+ },
3353
+ "indexes": {
3354
+ "junior_push_subscriptions_endpoint_uidx": {
3355
+ "name": "junior_push_subscriptions_endpoint_uidx",
3356
+ "columns": [
3357
+ {
3358
+ "expression": "endpoint",
3359
+ "isExpression": false,
3360
+ "asc": true,
3361
+ "nulls": "last"
3362
+ }
3363
+ ],
3364
+ "isUnique": true,
3365
+ "concurrently": false,
3366
+ "method": "btree",
3367
+ "with": {}
3368
+ },
3369
+ "junior_push_subscriptions_user_idx": {
3370
+ "name": "junior_push_subscriptions_user_idx",
3371
+ "columns": [
3372
+ {
3373
+ "expression": "user_id",
3374
+ "isExpression": false,
3375
+ "asc": true,
3376
+ "nulls": "last"
3377
+ }
3378
+ ],
3379
+ "isUnique": false,
3380
+ "concurrently": false,
3381
+ "method": "btree",
3382
+ "with": {}
3383
+ }
3384
+ },
3385
+ "foreignKeys": {
3386
+ "junior_push_subscriptions_user_id_junior_users_id_fk": {
3387
+ "name": "junior_push_subscriptions_user_id_junior_users_id_fk",
3388
+ "tableFrom": "junior_push_subscriptions",
3389
+ "tableTo": "junior_users",
3390
+ "columnsFrom": ["user_id"],
3391
+ "columnsTo": ["id"],
3392
+ "onDelete": "cascade",
3393
+ "onUpdate": "no action"
3394
+ }
3395
+ },
3396
+ "compositePrimaryKeys": {},
3397
+ "uniqueConstraints": {},
3398
+ "policies": {},
3399
+ "checkConstraints": {},
3400
+ "isRLSEnabled": false
3401
+ },
3402
+ "public.junior_review_item_assignees": {
3403
+ "name": "junior_review_item_assignees",
3404
+ "schema": "",
3405
+ "columns": {
3406
+ "item_id": {
3407
+ "name": "item_id",
3408
+ "type": "text",
3409
+ "primaryKey": false,
3410
+ "notNull": true
3411
+ },
3412
+ "user_id": {
3413
+ "name": "user_id",
3414
+ "type": "text",
3415
+ "primaryKey": false,
3416
+ "notNull": true
3417
+ }
3418
+ },
3419
+ "indexes": {
3420
+ "junior_review_item_assignees_user_idx": {
3421
+ "name": "junior_review_item_assignees_user_idx",
3422
+ "columns": [
3423
+ {
3424
+ "expression": "user_id",
3425
+ "isExpression": false,
3426
+ "asc": true,
3427
+ "nulls": "last"
3428
+ }
3429
+ ],
3430
+ "isUnique": false,
3431
+ "concurrently": false,
3432
+ "method": "btree",
3433
+ "with": {}
3434
+ }
3435
+ },
3436
+ "foreignKeys": {
3437
+ "junior_review_item_assignees_item_id_junior_review_items_id_fk": {
3438
+ "name": "junior_review_item_assignees_item_id_junior_review_items_id_fk",
3439
+ "tableFrom": "junior_review_item_assignees",
3440
+ "tableTo": "junior_review_items",
3441
+ "columnsFrom": ["item_id"],
3442
+ "columnsTo": ["id"],
3443
+ "onDelete": "cascade",
3444
+ "onUpdate": "no action"
3445
+ },
3446
+ "junior_review_item_assignees_user_id_junior_users_id_fk": {
3447
+ "name": "junior_review_item_assignees_user_id_junior_users_id_fk",
3448
+ "tableFrom": "junior_review_item_assignees",
3449
+ "tableTo": "junior_users",
3450
+ "columnsFrom": ["user_id"],
3451
+ "columnsTo": ["id"],
3452
+ "onDelete": "cascade",
3453
+ "onUpdate": "no action"
3454
+ }
3455
+ },
3456
+ "compositePrimaryKeys": {
3457
+ "junior_review_item_assignees_item_id_user_id_pk": {
3458
+ "name": "junior_review_item_assignees_item_id_user_id_pk",
3459
+ "columns": ["item_id", "user_id"]
3460
+ }
3461
+ },
3462
+ "uniqueConstraints": {},
3463
+ "policies": {},
3464
+ "checkConstraints": {},
3465
+ "isRLSEnabled": false
3466
+ },
3467
+ "public.junior_review_item_conversations": {
3468
+ "name": "junior_review_item_conversations",
3469
+ "schema": "",
3470
+ "columns": {
3471
+ "item_id": {
3472
+ "name": "item_id",
3473
+ "type": "text",
3474
+ "primaryKey": false,
3475
+ "notNull": true
3476
+ },
3477
+ "conversation_id": {
3478
+ "name": "conversation_id",
3479
+ "type": "text",
3480
+ "primaryKey": false,
3481
+ "notNull": true
3482
+ }
3483
+ },
3484
+ "indexes": {
3485
+ "junior_review_item_conversations_conversation_idx": {
3486
+ "name": "junior_review_item_conversations_conversation_idx",
3487
+ "columns": [
3488
+ {
3489
+ "expression": "conversation_id",
3490
+ "isExpression": false,
3491
+ "asc": true,
3492
+ "nulls": "last"
3493
+ }
3494
+ ],
3495
+ "isUnique": false,
3496
+ "concurrently": false,
3497
+ "method": "btree",
3498
+ "with": {}
3499
+ }
3500
+ },
3501
+ "foreignKeys": {
3502
+ "junior_review_item_conversations_item_id_junior_review_items_id_fk": {
3503
+ "name": "junior_review_item_conversations_item_id_junior_review_items_id_fk",
3504
+ "tableFrom": "junior_review_item_conversations",
3505
+ "tableTo": "junior_review_items",
3506
+ "columnsFrom": ["item_id"],
3507
+ "columnsTo": ["id"],
3508
+ "onDelete": "cascade",
3509
+ "onUpdate": "no action"
3510
+ },
3511
+ "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk": {
3512
+ "name": "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk",
3513
+ "tableFrom": "junior_review_item_conversations",
3514
+ "tableTo": "junior_conversations",
3515
+ "columnsFrom": ["conversation_id"],
3516
+ "columnsTo": ["conversation_id"],
3517
+ "onDelete": "cascade",
3518
+ "onUpdate": "no action"
3519
+ }
3520
+ },
3521
+ "compositePrimaryKeys": {
3522
+ "junior_review_item_conversations_item_id_conversation_id_pk": {
3523
+ "name": "junior_review_item_conversations_item_id_conversation_id_pk",
3524
+ "columns": ["item_id", "conversation_id"]
3525
+ }
3526
+ },
3527
+ "uniqueConstraints": {},
3528
+ "policies": {},
3529
+ "checkConstraints": {},
3530
+ "isRLSEnabled": false
3531
+ },
3532
+ "public.junior_review_item_slack_cards": {
3533
+ "name": "junior_review_item_slack_cards",
3534
+ "schema": "",
3535
+ "columns": {
3536
+ "item_id": {
3537
+ "name": "item_id",
3538
+ "type": "text",
3539
+ "primaryKey": false,
3540
+ "notNull": true
3541
+ },
3542
+ "conversation_id": {
3543
+ "name": "conversation_id",
3544
+ "type": "text",
3545
+ "primaryKey": false,
3546
+ "notNull": true
3547
+ },
3548
+ "team_id": {
3549
+ "name": "team_id",
3550
+ "type": "text",
3551
+ "primaryKey": false,
3552
+ "notNull": true
3553
+ },
3554
+ "channel_id": {
3555
+ "name": "channel_id",
3556
+ "type": "text",
3557
+ "primaryKey": false,
3558
+ "notNull": true
3559
+ },
3560
+ "message_ts": {
3561
+ "name": "message_ts",
3562
+ "type": "text",
3563
+ "primaryKey": false,
3564
+ "notNull": true
3565
+ }
3566
+ },
3567
+ "indexes": {},
3568
+ "foreignKeys": {
3569
+ "junior_review_item_slack_cards_item_id_junior_review_items_id_fk": {
3570
+ "name": "junior_review_item_slack_cards_item_id_junior_review_items_id_fk",
3571
+ "tableFrom": "junior_review_item_slack_cards",
3572
+ "tableTo": "junior_review_items",
3573
+ "columnsFrom": ["item_id"],
3574
+ "columnsTo": ["id"],
3575
+ "onDelete": "cascade",
3576
+ "onUpdate": "no action"
3577
+ },
3578
+ "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk": {
3579
+ "name": "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk",
3580
+ "tableFrom": "junior_review_item_slack_cards",
3581
+ "tableTo": "junior_conversations",
3582
+ "columnsFrom": ["conversation_id"],
3583
+ "columnsTo": ["conversation_id"],
3584
+ "onDelete": "cascade",
3585
+ "onUpdate": "no action"
3586
+ }
3587
+ },
3588
+ "compositePrimaryKeys": {
3589
+ "junior_review_item_slack_cards_item_id_conversation_id_pk": {
3590
+ "name": "junior_review_item_slack_cards_item_id_conversation_id_pk",
3591
+ "columns": ["item_id", "conversation_id"]
3592
+ }
3593
+ },
3594
+ "uniqueConstraints": {},
3595
+ "policies": {},
3596
+ "checkConstraints": {},
3597
+ "isRLSEnabled": false
3598
+ },
3599
+ "public.junior_review_items": {
3600
+ "name": "junior_review_items",
3601
+ "schema": "",
3602
+ "columns": {
3603
+ "id": {
3604
+ "name": "id",
3605
+ "type": "text",
3606
+ "primaryKey": true,
3607
+ "notNull": true
3608
+ },
3609
+ "kind": {
3610
+ "name": "kind",
3611
+ "type": "text",
3612
+ "primaryKey": false,
3613
+ "notNull": true
3614
+ },
3615
+ "status": {
3616
+ "name": "status",
3617
+ "type": "text",
3618
+ "primaryKey": false,
3619
+ "notNull": true
3620
+ },
3621
+ "visibility": {
3622
+ "name": "visibility",
3623
+ "type": "text",
3624
+ "primaryKey": false,
3625
+ "notNull": true
3626
+ },
3627
+ "title": {
3628
+ "name": "title",
3629
+ "type": "text",
3630
+ "primaryKey": false,
3631
+ "notNull": true
3632
+ },
3633
+ "body": {
3634
+ "name": "body",
3635
+ "type": "text",
3636
+ "primaryKey": false,
3637
+ "notNull": true
3638
+ },
3639
+ "request": {
3640
+ "name": "request",
3641
+ "type": "jsonb",
3642
+ "primaryKey": false,
3643
+ "notNull": false
3644
+ },
3645
+ "answer": {
3646
+ "name": "answer",
3647
+ "type": "jsonb",
3648
+ "primaryKey": false,
3649
+ "notNull": false
3650
+ },
3651
+ "assigned_to_everyone": {
3652
+ "name": "assigned_to_everyone",
3653
+ "type": "boolean",
3654
+ "primaryKey": false,
3655
+ "notNull": true,
3656
+ "default": false
3657
+ },
3658
+ "dedupe_key": {
3659
+ "name": "dedupe_key",
3660
+ "type": "text",
3661
+ "primaryKey": false,
3662
+ "notNull": true
3663
+ },
3664
+ "subject_id": {
3665
+ "name": "subject_id",
3666
+ "type": "text",
3667
+ "primaryKey": false,
3668
+ "notNull": false
3669
+ },
3670
+ "subject_title": {
3671
+ "name": "subject_title",
3672
+ "type": "text",
3673
+ "primaryKey": false,
3674
+ "notNull": false
3675
+ },
3676
+ "subject_url": {
3677
+ "name": "subject_url",
3678
+ "type": "text",
3679
+ "primaryKey": false,
3680
+ "notNull": false
3681
+ },
3682
+ "added_by_conversation_id": {
3683
+ "name": "added_by_conversation_id",
3684
+ "type": "text",
3685
+ "primaryKey": false,
3686
+ "notNull": true
3687
+ },
3688
+ "added_by_turn_id": {
3689
+ "name": "added_by_turn_id",
3690
+ "type": "text",
3691
+ "primaryKey": false,
3692
+ "notNull": false
3693
+ },
3694
+ "provider": {
3695
+ "name": "provider",
3696
+ "type": "text",
3697
+ "primaryKey": false,
3698
+ "notNull": false
3699
+ },
3700
+ "provider_tenant_id": {
3701
+ "name": "provider_tenant_id",
3702
+ "type": "text",
3703
+ "primaryKey": false,
3704
+ "notNull": false
3705
+ },
3706
+ "automation_id": {
3707
+ "name": "automation_id",
3708
+ "type": "text",
3709
+ "primaryKey": false,
3710
+ "notNull": false
3711
+ },
3712
+ "closed_at": {
3713
+ "name": "closed_at",
3714
+ "type": "timestamp with time zone",
3715
+ "primaryKey": false,
3716
+ "notNull": false
3717
+ },
3718
+ "closed_by_user_id": {
3719
+ "name": "closed_by_user_id",
3720
+ "type": "text",
3721
+ "primaryKey": false,
3722
+ "notNull": false
3723
+ },
3724
+ "close_reason": {
3725
+ "name": "close_reason",
3726
+ "type": "text",
3727
+ "primaryKey": false,
3728
+ "notNull": false
3729
+ },
3730
+ "created_at": {
3731
+ "name": "created_at",
3732
+ "type": "timestamp with time zone",
3733
+ "primaryKey": false,
3734
+ "notNull": true
3735
+ },
3736
+ "updated_at": {
3737
+ "name": "updated_at",
3738
+ "type": "timestamp with time zone",
3739
+ "primaryKey": false,
3740
+ "notNull": true
3741
+ }
3742
+ },
3743
+ "indexes": {
3744
+ "junior_review_items_open_dedupe_uidx": {
3745
+ "name": "junior_review_items_open_dedupe_uidx",
3746
+ "columns": [
3747
+ {
3748
+ "expression": "coalesce(\"provider\", '')",
3749
+ "asc": true,
3750
+ "isExpression": true,
3751
+ "nulls": "last"
3752
+ },
3753
+ {
3754
+ "expression": "coalesce(\"provider_tenant_id\", '')",
3755
+ "asc": true,
3756
+ "isExpression": true,
3757
+ "nulls": "last"
3758
+ },
3759
+ {
3760
+ "expression": "dedupe_key",
3761
+ "isExpression": false,
3762
+ "asc": true,
3763
+ "nulls": "last"
3764
+ }
3765
+ ],
3766
+ "isUnique": true,
3767
+ "where": "\"junior_review_items\".\"status\" = 'open'",
3768
+ "concurrently": false,
3769
+ "method": "btree",
3770
+ "with": {}
3771
+ },
3772
+ "junior_review_items_status_idx": {
3773
+ "name": "junior_review_items_status_idx",
3774
+ "columns": [
3775
+ {
3776
+ "expression": "status",
3777
+ "isExpression": false,
3778
+ "asc": true,
3779
+ "nulls": "last"
3780
+ },
3781
+ {
3782
+ "expression": "updated_at",
3783
+ "isExpression": false,
3784
+ "asc": true,
3785
+ "nulls": "last"
3786
+ },
3787
+ {
3788
+ "expression": "id",
3789
+ "isExpression": false,
3790
+ "asc": true,
3791
+ "nulls": "last"
3792
+ }
3793
+ ],
3794
+ "isUnique": false,
3795
+ "concurrently": false,
3796
+ "method": "btree",
3797
+ "with": {}
3798
+ },
3799
+ "junior_review_items_subject_idx": {
3800
+ "name": "junior_review_items_subject_idx",
3801
+ "columns": [
3802
+ {
3803
+ "expression": "subject_id",
3804
+ "isExpression": false,
3805
+ "asc": true,
3806
+ "nulls": "last"
3807
+ },
3808
+ {
3809
+ "expression": "status",
3810
+ "isExpression": false,
3811
+ "asc": true,
3812
+ "nulls": "last"
3813
+ }
3814
+ ],
3815
+ "isUnique": false,
3816
+ "concurrently": false,
3817
+ "method": "btree",
3818
+ "with": {}
3819
+ },
3820
+ "junior_review_items_automation_idx": {
3821
+ "name": "junior_review_items_automation_idx",
3822
+ "columns": [
3823
+ {
3824
+ "expression": "automation_id",
3825
+ "isExpression": false,
3826
+ "asc": true,
3827
+ "nulls": "last"
3828
+ },
3829
+ {
3830
+ "expression": "status",
3831
+ "isExpression": false,
3832
+ "asc": true,
3833
+ "nulls": "last"
3834
+ }
3835
+ ],
3836
+ "isUnique": false,
3837
+ "concurrently": false,
3838
+ "method": "btree",
3839
+ "with": {}
3840
+ }
3841
+ },
3842
+ "foreignKeys": {
3843
+ "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk": {
3844
+ "name": "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk",
3845
+ "tableFrom": "junior_review_items",
3846
+ "tableTo": "junior_conversations",
3847
+ "columnsFrom": ["added_by_conversation_id"],
3848
+ "columnsTo": ["conversation_id"],
3849
+ "onDelete": "cascade",
3850
+ "onUpdate": "no action"
3851
+ },
3852
+ "junior_review_items_automation_id_junior_automations_id_fk": {
3853
+ "name": "junior_review_items_automation_id_junior_automations_id_fk",
3854
+ "tableFrom": "junior_review_items",
3855
+ "tableTo": "junior_automations",
3856
+ "columnsFrom": ["automation_id"],
3857
+ "columnsTo": ["id"],
3858
+ "onDelete": "set null",
3859
+ "onUpdate": "no action"
3860
+ },
3861
+ "junior_review_items_closed_by_user_id_junior_users_id_fk": {
3862
+ "name": "junior_review_items_closed_by_user_id_junior_users_id_fk",
3863
+ "tableFrom": "junior_review_items",
3864
+ "tableTo": "junior_users",
3865
+ "columnsFrom": ["closed_by_user_id"],
3866
+ "columnsTo": ["id"],
3867
+ "onDelete": "set null",
3868
+ "onUpdate": "no action"
3869
+ }
3870
+ },
3871
+ "compositePrimaryKeys": {},
3872
+ "uniqueConstraints": {},
3873
+ "policies": {},
3874
+ "checkConstraints": {
3875
+ "junior_review_items_kind_check": {
3876
+ "name": "junior_review_items_kind_check",
3877
+ "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)"
3878
+ },
3879
+ "junior_review_items_status_check": {
3880
+ "name": "junior_review_items_status_check",
3881
+ "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)"
3882
+ },
3883
+ "junior_review_items_tenant_check": {
3884
+ "name": "junior_review_items_tenant_check",
3885
+ "value": "(\"junior_review_items\".\"provider\" is null) = (\"junior_review_items\".\"provider_tenant_id\" is null)"
3886
+ },
3887
+ "junior_review_items_visibility_check": {
3888
+ "name": "junior_review_items_visibility_check",
3889
+ "value": "\"junior_review_items\".\"visibility\" = 'public' or not \"junior_review_items\".\"assigned_to_everyone\""
3890
+ }
3891
+ },
3892
+ "isRLSEnabled": false
3893
+ },
3894
+ "public.junior_snapshots": {
3895
+ "name": "junior_snapshots",
3896
+ "schema": "",
3897
+ "columns": {
3898
+ "id": {
3899
+ "name": "id",
3900
+ "type": "text",
3901
+ "primaryKey": true,
3902
+ "notNull": true
3903
+ },
3904
+ "workspace_id": {
3905
+ "name": "workspace_id",
3906
+ "type": "text",
3907
+ "primaryKey": false,
3908
+ "notNull": true
3909
+ },
3910
+ "profile_hash": {
3911
+ "name": "profile_hash",
3912
+ "type": "text",
3913
+ "primaryKey": false,
3914
+ "notNull": true
3915
+ },
3916
+ "status": {
3917
+ "name": "status",
3918
+ "type": "text",
3919
+ "primaryKey": false,
3920
+ "notNull": true
3921
+ },
3922
+ "snapshot_id": {
3923
+ "name": "snapshot_id",
3924
+ "type": "text",
3925
+ "primaryKey": false,
3926
+ "notNull": false
3927
+ },
3928
+ "build_duration_ms": {
3929
+ "name": "build_duration_ms",
3930
+ "type": "integer",
3931
+ "primaryKey": false,
3932
+ "notNull": false
3933
+ },
3934
+ "size_bytes": {
3935
+ "name": "size_bytes",
3936
+ "type": "bigint",
3937
+ "primaryKey": false,
3938
+ "notNull": false
3939
+ },
3940
+ "generated_at": {
3941
+ "name": "generated_at",
3942
+ "type": "timestamp with time zone",
3943
+ "primaryKey": false,
3944
+ "notNull": false
3945
+ },
3946
+ "build_started_at": {
3947
+ "name": "build_started_at",
3948
+ "type": "timestamp with time zone",
3949
+ "primaryKey": false,
3950
+ "notNull": false
3951
+ },
3952
+ "build_phase": {
3953
+ "name": "build_phase",
3954
+ "type": "text",
3955
+ "primaryKey": false,
3956
+ "notNull": false
3957
+ },
3958
+ "build_sandbox_name": {
3959
+ "name": "build_sandbox_name",
3960
+ "type": "text",
3961
+ "primaryKey": false,
3962
+ "notNull": false
3963
+ },
3964
+ "build_command_id": {
3965
+ "name": "build_command_id",
3966
+ "type": "text",
3967
+ "primaryKey": false,
3968
+ "notNull": false
3969
+ },
3970
+ "build_error": {
3971
+ "name": "build_error",
3972
+ "type": "text",
3973
+ "primaryKey": false,
3974
+ "notNull": false
3975
+ },
3976
+ "created_at": {
3977
+ "name": "created_at",
3978
+ "type": "timestamp with time zone",
3979
+ "primaryKey": false,
3980
+ "notNull": true
3981
+ },
3982
+ "updated_at": {
3983
+ "name": "updated_at",
3984
+ "type": "timestamp with time zone",
3985
+ "primaryKey": false,
3986
+ "notNull": true
3987
+ }
3988
+ },
3989
+ "indexes": {
3990
+ "junior_snapshots_snapshot_id_uidx": {
3991
+ "name": "junior_snapshots_snapshot_id_uidx",
3992
+ "columns": [
3993
+ {
3994
+ "expression": "snapshot_id",
3995
+ "isExpression": false,
3996
+ "asc": true,
3997
+ "nulls": "last"
3998
+ }
3999
+ ],
4000
+ "isUnique": true,
4001
+ "concurrently": false,
4002
+ "method": "btree",
4003
+ "with": {}
4004
+ },
4005
+ "junior_snapshots_workspace_idx": {
4006
+ "name": "junior_snapshots_workspace_idx",
4007
+ "columns": [
4008
+ {
4009
+ "expression": "workspace_id",
4010
+ "isExpression": false,
4011
+ "asc": true,
4012
+ "nulls": "last"
4013
+ }
4014
+ ],
4015
+ "isUnique": false,
4016
+ "concurrently": false,
4017
+ "method": "btree",
4018
+ "with": {}
4019
+ },
4020
+ "junior_snapshots_workspace_profile_status_idx": {
4021
+ "name": "junior_snapshots_workspace_profile_status_idx",
4022
+ "columns": [
4023
+ {
4024
+ "expression": "workspace_id",
4025
+ "isExpression": false,
4026
+ "asc": true,
4027
+ "nulls": "last"
4028
+ },
4029
+ {
4030
+ "expression": "profile_hash",
4031
+ "isExpression": false,
4032
+ "asc": true,
4033
+ "nulls": "last"
4034
+ },
4035
+ {
4036
+ "expression": "status",
4037
+ "isExpression": false,
4038
+ "asc": true,
4039
+ "nulls": "last"
4040
+ }
4041
+ ],
4042
+ "isUnique": false,
4043
+ "concurrently": false,
4044
+ "method": "btree",
4045
+ "with": {}
4046
+ },
4047
+ "junior_snapshots_active_build_uidx": {
4048
+ "name": "junior_snapshots_active_build_uidx",
4049
+ "columns": [
4050
+ {
4051
+ "expression": "workspace_id",
4052
+ "isExpression": false,
4053
+ "asc": true,
4054
+ "nulls": "last"
4055
+ },
4056
+ {
4057
+ "expression": "profile_hash",
4058
+ "isExpression": false,
4059
+ "asc": true,
4060
+ "nulls": "last"
4061
+ }
4062
+ ],
4063
+ "isUnique": true,
4064
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
4065
+ "concurrently": false,
4066
+ "method": "btree",
4067
+ "with": {}
4068
+ },
4069
+ "junior_snapshots_workspace_status_idx": {
4070
+ "name": "junior_snapshots_workspace_status_idx",
4071
+ "columns": [
4072
+ {
4073
+ "expression": "workspace_id",
4074
+ "isExpression": false,
4075
+ "asc": true,
4076
+ "nulls": "last"
4077
+ },
4078
+ {
4079
+ "expression": "status",
4080
+ "isExpression": false,
4081
+ "asc": true,
4082
+ "nulls": "last"
4083
+ }
4084
+ ],
4085
+ "isUnique": false,
4086
+ "concurrently": false,
4087
+ "method": "btree",
4088
+ "with": {}
4089
+ }
4090
+ },
4091
+ "foreignKeys": {
4092
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
4093
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
4094
+ "tableFrom": "junior_snapshots",
4095
+ "tableTo": "junior_workspaces",
4096
+ "columnsFrom": ["workspace_id"],
4097
+ "columnsTo": ["id"],
4098
+ "onDelete": "cascade",
4099
+ "onUpdate": "no action"
4100
+ }
4101
+ },
4102
+ "compositePrimaryKeys": {},
4103
+ "uniqueConstraints": {},
4104
+ "policies": {},
4105
+ "checkConstraints": {
4106
+ "junior_snapshots_status_check": {
4107
+ "name": "junior_snapshots_status_check",
4108
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
4109
+ },
4110
+ "junior_snapshots_build_phase_check": {
4111
+ "name": "junior_snapshots_build_phase_check",
4112
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
4113
+ },
4114
+ "junior_snapshots_ready_fields_check": {
4115
+ "name": "junior_snapshots_ready_fields_check",
4116
+ "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)"
4117
+ },
4118
+ "junior_snapshots_build_fields_check": {
4119
+ "name": "junior_snapshots_build_fields_check",
4120
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
4121
+ },
4122
+ "junior_snapshots_build_duration_check": {
4123
+ "name": "junior_snapshots_build_duration_check",
4124
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
4125
+ },
4126
+ "junior_snapshots_size_bytes_check": {
4127
+ "name": "junior_snapshots_size_bytes_check",
4128
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
4129
+ }
4130
+ },
4131
+ "isRLSEnabled": false
4132
+ },
4133
+ "public.junior_stats": {
4134
+ "name": "junior_stats",
4135
+ "schema": "",
4136
+ "columns": {
4137
+ "date": {
4138
+ "name": "date",
4139
+ "type": "date",
4140
+ "primaryKey": false,
4141
+ "notNull": true
4142
+ },
4143
+ "namespace": {
4144
+ "name": "namespace",
4145
+ "type": "text",
4146
+ "primaryKey": false,
4147
+ "notNull": true
4148
+ },
4149
+ "metric": {
4150
+ "name": "metric",
4151
+ "type": "text",
4152
+ "primaryKey": false,
4153
+ "notNull": true
4154
+ },
4155
+ "name": {
4156
+ "name": "name",
4157
+ "type": "text",
4158
+ "primaryKey": false,
4159
+ "notNull": true
4160
+ },
4161
+ "count": {
4162
+ "name": "count",
4163
+ "type": "integer",
4164
+ "primaryKey": false,
4165
+ "notNull": true,
4166
+ "default": 0
4167
+ }
4168
+ },
4169
+ "indexes": {},
4170
+ "foreignKeys": {},
4171
+ "compositePrimaryKeys": {
4172
+ "junior_stats_date_namespace_metric_name_pk": {
4173
+ "name": "junior_stats_date_namespace_metric_name_pk",
4174
+ "columns": ["date", "namespace", "metric", "name"]
4175
+ }
4176
+ },
4177
+ "uniqueConstraints": {},
4178
+ "policies": {},
4179
+ "checkConstraints": {},
4180
+ "isRLSEnabled": false
4181
+ },
4182
+ "public.junior_users": {
4183
+ "name": "junior_users",
4184
+ "schema": "",
4185
+ "columns": {
4186
+ "id": {
4187
+ "name": "id",
4188
+ "type": "text",
4189
+ "primaryKey": true,
4190
+ "notNull": true
4191
+ },
4192
+ "primary_email": {
4193
+ "name": "primary_email",
4194
+ "type": "text",
4195
+ "primaryKey": false,
4196
+ "notNull": true
4197
+ },
4198
+ "primary_email_normalized": {
4199
+ "name": "primary_email_normalized",
4200
+ "type": "text",
4201
+ "primaryKey": false,
4202
+ "notNull": true
4203
+ },
4204
+ "display_name": {
4205
+ "name": "display_name",
4206
+ "type": "text",
4207
+ "primaryKey": false,
4208
+ "notNull": false
4209
+ },
4210
+ "timezone": {
4211
+ "name": "timezone",
4212
+ "type": "text",
4213
+ "primaryKey": false,
4214
+ "notNull": false
4215
+ },
4216
+ "customization": {
4217
+ "name": "customization",
4218
+ "type": "text",
4219
+ "primaryKey": false,
4220
+ "notNull": false
4221
+ },
4222
+ "notification_schedule": {
4223
+ "name": "notification_schedule",
4224
+ "type": "jsonb",
4225
+ "primaryKey": false,
4226
+ "notNull": false
4227
+ },
4228
+ "is_admin": {
4229
+ "name": "is_admin",
4230
+ "type": "boolean",
4231
+ "primaryKey": false,
4232
+ "notNull": true,
4233
+ "default": false
4234
+ },
4235
+ "auto_archive_default": {
4236
+ "name": "auto_archive_default",
4237
+ "type": "boolean",
4238
+ "primaryKey": false,
4239
+ "notNull": true,
4240
+ "default": false
4241
+ },
4242
+ "auto_archive_grace_hours": {
4243
+ "name": "auto_archive_grace_hours",
4244
+ "type": "integer",
4245
+ "primaryKey": false,
4246
+ "notNull": true,
4247
+ "default": 24
4248
+ },
4249
+ "created_at": {
4250
+ "name": "created_at",
4251
+ "type": "timestamp with time zone",
4252
+ "primaryKey": false,
4253
+ "notNull": true
4254
+ },
4255
+ "updated_at": {
4256
+ "name": "updated_at",
4257
+ "type": "timestamp with time zone",
4258
+ "primaryKey": false,
4259
+ "notNull": true
4260
+ }
4261
+ },
4262
+ "indexes": {
4263
+ "junior_users_primary_email_normalized_uidx": {
4264
+ "name": "junior_users_primary_email_normalized_uidx",
4265
+ "columns": [
4266
+ {
4267
+ "expression": "primary_email_normalized",
4268
+ "isExpression": false,
4269
+ "asc": true,
4270
+ "nulls": "last"
4271
+ }
4272
+ ],
4273
+ "isUnique": true,
4274
+ "concurrently": false,
4275
+ "method": "btree",
4276
+ "with": {}
4277
+ }
4278
+ },
4279
+ "foreignKeys": {},
4280
+ "compositePrimaryKeys": {},
4281
+ "uniqueConstraints": {},
4282
+ "policies": {},
4283
+ "checkConstraints": {},
4284
+ "isRLSEnabled": false
4285
+ },
4286
+ "public.junior_workspace_repos": {
4287
+ "name": "junior_workspace_repos",
4288
+ "schema": "",
4289
+ "columns": {
4290
+ "workspace_id": {
4291
+ "name": "workspace_id",
4292
+ "type": "text",
4293
+ "primaryKey": false,
4294
+ "notNull": true
4295
+ },
4296
+ "provider": {
4297
+ "name": "provider",
4298
+ "type": "text",
4299
+ "primaryKey": false,
4300
+ "notNull": true
4301
+ },
4302
+ "repo": {
4303
+ "name": "repo",
4304
+ "type": "text",
4305
+ "primaryKey": false,
4306
+ "notNull": true
4307
+ }
4308
+ },
4309
+ "indexes": {},
4310
+ "foreignKeys": {
4311
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
4312
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
4313
+ "tableFrom": "junior_workspace_repos",
4314
+ "tableTo": "junior_workspaces",
4315
+ "columnsFrom": ["workspace_id"],
4316
+ "columnsTo": ["id"],
4317
+ "onDelete": "cascade",
4318
+ "onUpdate": "no action"
4319
+ }
4320
+ },
4321
+ "compositePrimaryKeys": {
4322
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
4323
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
4324
+ "columns": ["workspace_id", "provider", "repo"]
4325
+ }
4326
+ },
4327
+ "uniqueConstraints": {},
4328
+ "policies": {},
4329
+ "checkConstraints": {},
4330
+ "isRLSEnabled": false
4331
+ },
4332
+ "public.junior_workspaces": {
4333
+ "name": "junior_workspaces",
4334
+ "schema": "",
4335
+ "columns": {
4336
+ "id": {
4337
+ "name": "id",
4338
+ "type": "text",
4339
+ "primaryKey": true,
4340
+ "notNull": true
4341
+ },
4342
+ "name": {
4343
+ "name": "name",
4344
+ "type": "text",
4345
+ "primaryKey": false,
4346
+ "notNull": true
4347
+ },
4348
+ "setup_script": {
4349
+ "name": "setup_script",
4350
+ "type": "text",
4351
+ "primaryKey": false,
4352
+ "notNull": true,
4353
+ "default": "''"
4354
+ },
4355
+ "vcpus": {
4356
+ "name": "vcpus",
4357
+ "type": "integer",
4358
+ "primaryKey": false,
4359
+ "notNull": false
4360
+ },
4361
+ "created_at": {
4362
+ "name": "created_at",
4363
+ "type": "timestamp with time zone",
4364
+ "primaryKey": false,
4365
+ "notNull": true
4366
+ },
4367
+ "updated_at": {
4368
+ "name": "updated_at",
4369
+ "type": "timestamp with time zone",
4370
+ "primaryKey": false,
4371
+ "notNull": true
4372
+ }
4373
+ },
4374
+ "indexes": {
4375
+ "junior_workspaces_name_idx": {
4376
+ "name": "junior_workspaces_name_idx",
4377
+ "columns": [
4378
+ {
4379
+ "expression": "name",
4380
+ "isExpression": false,
4381
+ "asc": true,
4382
+ "nulls": "last"
4383
+ }
4384
+ ],
4385
+ "isUnique": true,
4386
+ "concurrently": false,
4387
+ "method": "btree",
4388
+ "with": {}
4389
+ }
4390
+ },
4391
+ "foreignKeys": {},
4392
+ "compositePrimaryKeys": {},
4393
+ "uniqueConstraints": {},
4394
+ "policies": {},
4395
+ "checkConstraints": {},
4396
+ "isRLSEnabled": false
4397
+ }
4398
+ },
4399
+ "enums": {},
4400
+ "schemas": {},
4401
+ "sequences": {},
4402
+ "roles": {},
4403
+ "policies": {},
4404
+ "views": {},
4405
+ "_meta": {
4406
+ "columns": {},
4407
+ "schemas": {},
4408
+ "tables": {}
4409
+ }
4410
+ }