@sentry/junior 0.286.0 → 0.288.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 (78) hide show
  1. package/dist/{adapter-JQZaJ-B_.js → adapter-Cikcqdty.js} +1 -1
  2. package/dist/{admin-Dm2bimJ-.js → admin-BcSxHuTB.js} +2 -1
  3. package/dist/{agent-runner-DGCwOEyL.js → agent-runner-9MXyWUL8.js} +784 -368
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +9 -8
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +411 -65
  8. package/dist/{app-BKq0JzWx.d.ts → app-BUklJVBe.d.ts} +4 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +555 -71
  11. package/dist/{assistant-reply-CAPafcUY.js → assistant-reply-mj47jMRV.js} +1 -1
  12. package/dist/{automation-B-jJN_gM.js → automation-DDXwHQs5.js} +4 -7
  13. package/dist/{background-compaction-queue-Btu2oab_.js → background-compaction-queue-CjllSPir.js} +161 -90
  14. package/dist/{briefs-UMeYehUe.js → briefs-DW9iuolG.js} +7 -5
  15. package/dist/{catalog-runtime-Bym8GVdh.js → catalog-runtime-B3gfH58M.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-CLJcyYEF.js +1762 -0
  24. package/dist/{connections-CQ7p0aNJ.js → connections-BtdJftow.js} +9 -9
  25. package/dist/{conversation-BusI2uzj.js → conversation-DhoqHtQ7.js} +30 -6
  26. package/dist/{conversation-pending-messages-DwehU0Fd.js → conversation-pending-messages-DHV0S4uF.js} +2 -5
  27. package/dist/{conversation-privacy-Cd_nZZBM.js → conversation-privacy-BPirIVlX.js} +1 -1
  28. package/dist/core-model-BTt5E5b0.js +182 -0
  29. package/dist/{credential-sync-DmiJi_At.js → credential-sync-Co8Q2xRW.js} +28 -20
  30. package/dist/{viewer-CH-ASQzh.js → db-Co7DTYYh.js} +62 -358
  31. package/dist/{db-C5zi4ecs.d.ts → db-zIs8-Ba3.d.ts} +6 -2
  32. package/dist/{executor-Dipi2Ixl.js → executor-m0kIN71Q.js} +102 -14
  33. package/dist/{media-B-BpXo41.js → history-IjdmO_r6.js} +8 -88
  34. package/dist/instrumentation.js +2 -2
  35. package/dist/{logging-CMFhLLj4.js → logging-DbD-dErY.js} +3 -2
  36. package/dist/media-BAHvgkok.js +85 -0
  37. package/dist/{message-D1xLljUF.js → message-DKTdTYm-.js} +10 -10
  38. package/dist/nitro.d.ts +1 -1
  39. package/dist/nitro.js +19 -41
  40. package/dist/{oauth-callback-server-DCAFIUQr.js → oauth-callback-server-CpbepSbp.js} +2 -2
  41. package/dist/{projection-CoeMNxJ4.js → projection-BViECfYu.js} +361 -746
  42. package/dist/{prompt-C9OQEfan.js → prompt-KT6MaDHN.js} +1 -1
  43. package/dist/{registry-u-sFYtx_.js → registry-D-Acyjhh.js} +1 -1
  44. package/dist/{reporting-window-B4TwyuJo.js → reporting-window-B3Ze-Qnt.js} +4 -1
  45. package/dist/{resolve-DYqgL3Eo.js → resolve-gkT2R66z.js} +3 -3
  46. package/dist/{result-CescSwAw.js → result-DHmCFEt8.js} +8 -8
  47. package/dist/{runner-Cr67a8TB.js → runner-DBKjGjH-.js} +8 -8
  48. package/dist/{sandbox-egress-signals-DLOazy5W.js → sandbox-egress-signals-9n8hqx29.js} +1 -1
  49. package/dist/{schedule-BTp__wrw.js → schedule-cP0AACm1.js} +11 -2
  50. package/dist/{schema-Ih60j59-.d.ts → schema-B_6aOcx5.d.ts} +159 -3
  51. package/dist/{schema-BUSi3sgv.js → schema-DxicIQbc.js} +79 -14
  52. package/dist/{service-account-CsKxktLk.js → service-account-Bi0HsY6w.js} +3 -3
  53. package/dist/{service-account-CGEqz9wG.js → service-account-CDlC9ssy.js} +3 -3
  54. package/dist/{session-stop-CGz5DByb.js → session-stop-BWOsuo8p.js} +62 -20
  55. package/dist/{skills-COCqf61f.js → skills-DO5K68Rq.js} +2 -2
  56. package/dist/spawn-BBqZDcPa.js +79 -0
  57. package/dist/{stop-GyFZkHuQ.js → stop-WC97cmHz.js} +832 -552
  58. package/dist/{store-D0-8plWp.js → store-ByR1Lr7e.js} +4 -16
  59. package/dist/{task-runner-xPuQmEot.js → task-runner-B-Ewf8TX.js} +30 -21
  60. package/dist/{turn-failure-response-BOviBdT-.js → turn-failure-response-CpdPoZSl.js} +25 -11
  61. package/dist/{validation-DZDKorGz.js → validation-B4sbIoES.js} +1 -1
  62. package/dist/{version-BTIz7fGi.js → version-D6lpuAgL.js} +1 -1
  63. package/dist/version.js +1 -1
  64. package/dist/viewer-CeP27tC3.js +337 -0
  65. package/dist/warmup-P_GJCL1c.js +767 -0
  66. package/dist/{work-C75_IM5e.js → work-DI7x1Slm.js} +32 -20
  67. package/dist/{worker-Dl47I729.js → worker-CYPTOT4j.js} +6 -7
  68. package/migrations/0088_conversation_unsubscribe.sql +1 -0
  69. package/migrations/0089_conversation_paused_status.sql +3 -0
  70. package/migrations/0090_guardian_review_time_index.sql +20 -0
  71. package/migrations/meta/0088_snapshot.json +4372 -0
  72. package/migrations/meta/0089_snapshot.json +4372 -0
  73. package/migrations/meta/0090_snapshot.json +4388 -0
  74. package/migrations/meta/_journal.json +21 -0
  75. package/package.json +5 -4
  76. package/dist/client-B0aAs7wC.js +0 -793
  77. package/dist/config-B9f9Lqo5.js +0 -579
  78. package/dist/spawn-C8F_iXWO.js +0 -42
@@ -0,0 +1,4372 @@
1
+ {
2
+ "id": "572b6755-e298-41a7-8b3c-5d271ca6b163",
3
+ "prevId": "428fbb17-a8db-4d8a-8259-4ac9511c5105",
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_plugin_conversation_idx": {
1926
+ "name": "junior_conversation_events_plugin_conversation_idx",
1927
+ "columns": [
1928
+ {
1929
+ "expression": "conversation_id",
1930
+ "isExpression": false,
1931
+ "asc": true,
1932
+ "nulls": "last"
1933
+ },
1934
+ {
1935
+ "expression": "(\"payload\"->>'namespace')",
1936
+ "asc": true,
1937
+ "isExpression": true,
1938
+ "nulls": "last"
1939
+ },
1940
+ {
1941
+ "expression": "(\"payload\"->>'name')",
1942
+ "asc": true,
1943
+ "isExpression": true,
1944
+ "nulls": "last"
1945
+ },
1946
+ {
1947
+ "expression": "seq",
1948
+ "isExpression": false,
1949
+ "asc": true,
1950
+ "nulls": "last"
1951
+ }
1952
+ ],
1953
+ "isUnique": false,
1954
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
1955
+ "concurrently": false,
1956
+ "method": "btree",
1957
+ "with": {}
1958
+ },
1959
+ "junior_conversation_events_actor_identity_idx": {
1960
+ "name": "junior_conversation_events_actor_identity_idx",
1961
+ "columns": [
1962
+ {
1963
+ "expression": "actor_identity_id",
1964
+ "isExpression": false,
1965
+ "asc": true,
1966
+ "nulls": "last"
1967
+ },
1968
+ {
1969
+ "expression": "conversation_id",
1970
+ "isExpression": false,
1971
+ "asc": true,
1972
+ "nulls": "last"
1973
+ },
1974
+ {
1975
+ "expression": "seq",
1976
+ "isExpression": false,
1977
+ "asc": true,
1978
+ "nulls": "last"
1979
+ }
1980
+ ],
1981
+ "isUnique": false,
1982
+ "concurrently": false,
1983
+ "method": "btree",
1984
+ "with": {}
1985
+ },
1986
+ "junior_conversation_events_author_idx": {
1987
+ "name": "junior_conversation_events_author_idx",
1988
+ "columns": [
1989
+ {
1990
+ "expression": "conversation_id",
1991
+ "isExpression": false,
1992
+ "asc": true,
1993
+ "nulls": "last"
1994
+ },
1995
+ {
1996
+ "expression": "actor_identity_id",
1997
+ "isExpression": false,
1998
+ "asc": true,
1999
+ "nulls": "last"
2000
+ },
2001
+ {
2002
+ "expression": "seq",
2003
+ "isExpression": false,
2004
+ "asc": true,
2005
+ "nulls": "last"
2006
+ }
2007
+ ],
2008
+ "isUnique": false,
2009
+ "where": "\"junior_conversation_events\".\"actor_identity_id\" is not null",
2010
+ "concurrently": false,
2011
+ "method": "btree",
2012
+ "with": {}
2013
+ },
2014
+ "junior_conversation_events_message_role_idx": {
2015
+ "name": "junior_conversation_events_message_role_idx",
2016
+ "columns": [
2017
+ {
2018
+ "expression": "conversation_id",
2019
+ "isExpression": false,
2020
+ "asc": true,
2021
+ "nulls": "last"
2022
+ },
2023
+ {
2024
+ "expression": "(\"payload\"->>'role')",
2025
+ "asc": true,
2026
+ "isExpression": true,
2027
+ "nulls": "last"
2028
+ },
2029
+ {
2030
+ "expression": "created_at",
2031
+ "isExpression": false,
2032
+ "asc": true,
2033
+ "nulls": "last"
2034
+ },
2035
+ {
2036
+ "expression": "seq",
2037
+ "isExpression": false,
2038
+ "asc": true,
2039
+ "nulls": "last"
2040
+ }
2041
+ ],
2042
+ "isUnique": false,
2043
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2044
+ "concurrently": false,
2045
+ "method": "btree",
2046
+ "with": {}
2047
+ },
2048
+ "junior_conversation_events_user_message_time_idx": {
2049
+ "name": "junior_conversation_events_user_message_time_idx",
2050
+ "columns": [
2051
+ {
2052
+ "expression": "conversation_id",
2053
+ "isExpression": false,
2054
+ "asc": true,
2055
+ "nulls": "last"
2056
+ },
2057
+ {
2058
+ "expression": "created_at",
2059
+ "isExpression": false,
2060
+ "asc": true,
2061
+ "nulls": "last"
2062
+ },
2063
+ {
2064
+ "expression": "seq",
2065
+ "isExpression": false,
2066
+ "asc": true,
2067
+ "nulls": "last"
2068
+ }
2069
+ ],
2070
+ "isUnique": false,
2071
+ "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')",
2072
+ "concurrently": false,
2073
+ "method": "btree",
2074
+ "with": {}
2075
+ },
2076
+ "junior_conversation_events_message_search_idx": {
2077
+ "name": "junior_conversation_events_message_search_idx",
2078
+ "columns": [
2079
+ {
2080
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
2081
+ "asc": true,
2082
+ "isExpression": true,
2083
+ "nulls": "last"
2084
+ }
2085
+ ],
2086
+ "isUnique": false,
2087
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2088
+ "concurrently": false,
2089
+ "method": "gin",
2090
+ "with": {}
2091
+ },
2092
+ "junior_conversation_events_idempotency_idx": {
2093
+ "name": "junior_conversation_events_idempotency_idx",
2094
+ "columns": [
2095
+ {
2096
+ "expression": "conversation_id",
2097
+ "isExpression": false,
2098
+ "asc": true,
2099
+ "nulls": "last"
2100
+ },
2101
+ {
2102
+ "expression": "idempotency_key",
2103
+ "isExpression": false,
2104
+ "asc": true,
2105
+ "nulls": "last"
2106
+ }
2107
+ ],
2108
+ "isUnique": true,
2109
+ "concurrently": false,
2110
+ "method": "btree",
2111
+ "with": {}
2112
+ }
2113
+ },
2114
+ "foreignKeys": {
2115
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
2116
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
2117
+ "tableFrom": "junior_conversation_events",
2118
+ "tableTo": "junior_identities",
2119
+ "columnsFrom": ["actor_identity_id"],
2120
+ "columnsTo": ["id"],
2121
+ "onDelete": "no action",
2122
+ "onUpdate": "no action"
2123
+ },
2124
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
2125
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
2126
+ "tableFrom": "junior_conversation_events",
2127
+ "tableTo": "junior_conversations",
2128
+ "columnsFrom": ["conversation_id"],
2129
+ "columnsTo": ["conversation_id"],
2130
+ "onDelete": "no action",
2131
+ "onUpdate": "no action"
2132
+ }
2133
+ },
2134
+ "compositePrimaryKeys": {
2135
+ "junior_conversation_events_conversation_id_seq_pk": {
2136
+ "name": "junior_conversation_events_conversation_id_seq_pk",
2137
+ "columns": ["conversation_id", "seq"]
2138
+ }
2139
+ },
2140
+ "uniqueConstraints": {},
2141
+ "policies": {},
2142
+ "checkConstraints": {},
2143
+ "isRLSEnabled": false
2144
+ },
2145
+ "public.junior_conversation_metrics": {
2146
+ "name": "junior_conversation_metrics",
2147
+ "schema": "",
2148
+ "columns": {
2149
+ "conversation_id": {
2150
+ "name": "conversation_id",
2151
+ "type": "text",
2152
+ "primaryKey": false,
2153
+ "notNull": true
2154
+ },
2155
+ "run_id": {
2156
+ "name": "run_id",
2157
+ "type": "text",
2158
+ "primaryKey": false,
2159
+ "notNull": true
2160
+ },
2161
+ "metric": {
2162
+ "name": "metric",
2163
+ "type": "text",
2164
+ "primaryKey": false,
2165
+ "notNull": true
2166
+ },
2167
+ "value": {
2168
+ "name": "value",
2169
+ "type": "double precision",
2170
+ "primaryKey": false,
2171
+ "notNull": true
2172
+ },
2173
+ "occurred_at": {
2174
+ "name": "occurred_at",
2175
+ "type": "timestamp with time zone",
2176
+ "primaryKey": false,
2177
+ "notNull": true
2178
+ },
2179
+ "updated_at": {
2180
+ "name": "updated_at",
2181
+ "type": "timestamp with time zone",
2182
+ "primaryKey": false,
2183
+ "notNull": true
2184
+ }
2185
+ },
2186
+ "indexes": {
2187
+ "junior_conversation_metrics_occurred_at_metric_idx": {
2188
+ "name": "junior_conversation_metrics_occurred_at_metric_idx",
2189
+ "columns": [
2190
+ {
2191
+ "expression": "occurred_at",
2192
+ "isExpression": false,
2193
+ "asc": true,
2194
+ "nulls": "last"
2195
+ },
2196
+ {
2197
+ "expression": "metric",
2198
+ "isExpression": false,
2199
+ "asc": true,
2200
+ "nulls": "last"
2201
+ }
2202
+ ],
2203
+ "isUnique": false,
2204
+ "concurrently": false,
2205
+ "method": "btree",
2206
+ "with": {}
2207
+ }
2208
+ },
2209
+ "foreignKeys": {
2210
+ "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk": {
2211
+ "name": "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
2212
+ "tableFrom": "junior_conversation_metrics",
2213
+ "tableTo": "junior_conversations",
2214
+ "columnsFrom": ["conversation_id"],
2215
+ "columnsTo": ["conversation_id"],
2216
+ "onDelete": "no action",
2217
+ "onUpdate": "no action"
2218
+ }
2219
+ },
2220
+ "compositePrimaryKeys": {
2221
+ "junior_conversation_metrics_conversation_id_run_id_metric_pk": {
2222
+ "name": "junior_conversation_metrics_conversation_id_run_id_metric_pk",
2223
+ "columns": ["conversation_id", "run_id", "metric"]
2224
+ }
2225
+ },
2226
+ "uniqueConstraints": {},
2227
+ "policies": {},
2228
+ "checkConstraints": {},
2229
+ "isRLSEnabled": false
2230
+ },
2231
+ "public.junior_conversation_participants": {
2232
+ "name": "junior_conversation_participants",
2233
+ "schema": "",
2234
+ "columns": {
2235
+ "user_id": {
2236
+ "name": "user_id",
2237
+ "type": "text",
2238
+ "primaryKey": false,
2239
+ "notNull": true
2240
+ },
2241
+ "root_conversation_id": {
2242
+ "name": "root_conversation_id",
2243
+ "type": "text",
2244
+ "primaryKey": false,
2245
+ "notNull": true
2246
+ },
2247
+ "last_message_at": {
2248
+ "name": "last_message_at",
2249
+ "type": "timestamp with time zone",
2250
+ "primaryKey": false,
2251
+ "notNull": true
2252
+ },
2253
+ "archived_at": {
2254
+ "name": "archived_at",
2255
+ "type": "timestamp with time zone",
2256
+ "primaryKey": false,
2257
+ "notNull": false
2258
+ },
2259
+ "pinned_at": {
2260
+ "name": "pinned_at",
2261
+ "type": "timestamp with time zone",
2262
+ "primaryKey": false,
2263
+ "notNull": false
2264
+ },
2265
+ "pin_position": {
2266
+ "name": "pin_position",
2267
+ "type": "integer",
2268
+ "primaryKey": false,
2269
+ "notNull": false
2270
+ },
2271
+ "auto_archive": {
2272
+ "name": "auto_archive",
2273
+ "type": "boolean",
2274
+ "primaryKey": false,
2275
+ "notNull": false
2276
+ },
2277
+ "unsubscribed_at": {
2278
+ "name": "unsubscribed_at",
2279
+ "type": "timestamp with time zone",
2280
+ "primaryKey": false,
2281
+ "notNull": false
2282
+ }
2283
+ },
2284
+ "indexes": {
2285
+ "junior_conversation_participants_user_activity_idx": {
2286
+ "name": "junior_conversation_participants_user_activity_idx",
2287
+ "columns": [
2288
+ {
2289
+ "expression": "user_id",
2290
+ "isExpression": false,
2291
+ "asc": true,
2292
+ "nulls": "last"
2293
+ },
2294
+ {
2295
+ "expression": "last_message_at",
2296
+ "isExpression": false,
2297
+ "asc": false,
2298
+ "nulls": "last"
2299
+ }
2300
+ ],
2301
+ "isUnique": false,
2302
+ "concurrently": false,
2303
+ "method": "btree",
2304
+ "with": {}
2305
+ },
2306
+ "junior_conversation_participants_root_idx": {
2307
+ "name": "junior_conversation_participants_root_idx",
2308
+ "columns": [
2309
+ {
2310
+ "expression": "root_conversation_id",
2311
+ "isExpression": false,
2312
+ "asc": true,
2313
+ "nulls": "last"
2314
+ }
2315
+ ],
2316
+ "isUnique": false,
2317
+ "concurrently": false,
2318
+ "method": "btree",
2319
+ "with": {}
2320
+ },
2321
+ "junior_conversation_participants_auto_archive_idx": {
2322
+ "name": "junior_conversation_participants_auto_archive_idx",
2323
+ "columns": [
2324
+ {
2325
+ "expression": "user_id",
2326
+ "isExpression": false,
2327
+ "asc": true,
2328
+ "nulls": "last"
2329
+ }
2330
+ ],
2331
+ "isUnique": false,
2332
+ "where": "\"junior_conversation_participants\".\"auto_archive\"",
2333
+ "concurrently": false,
2334
+ "method": "btree",
2335
+ "with": {}
2336
+ }
2337
+ },
2338
+ "foreignKeys": {
2339
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
2340
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
2341
+ "tableFrom": "junior_conversation_participants",
2342
+ "tableTo": "junior_users",
2343
+ "columnsFrom": ["user_id"],
2344
+ "columnsTo": ["id"],
2345
+ "onDelete": "no action",
2346
+ "onUpdate": "no action"
2347
+ },
2348
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
2349
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
2350
+ "tableFrom": "junior_conversation_participants",
2351
+ "tableTo": "junior_conversations",
2352
+ "columnsFrom": ["root_conversation_id"],
2353
+ "columnsTo": ["conversation_id"],
2354
+ "onDelete": "no action",
2355
+ "onUpdate": "no action"
2356
+ }
2357
+ },
2358
+ "compositePrimaryKeys": {
2359
+ "junior_conversation_participants_user_root_pk": {
2360
+ "name": "junior_conversation_participants_user_root_pk",
2361
+ "columns": ["user_id", "root_conversation_id"]
2362
+ }
2363
+ },
2364
+ "uniqueConstraints": {},
2365
+ "policies": {},
2366
+ "checkConstraints": {},
2367
+ "isRLSEnabled": false
2368
+ },
2369
+ "public.junior_conversation_read_positions": {
2370
+ "name": "junior_conversation_read_positions",
2371
+ "schema": "",
2372
+ "columns": {
2373
+ "user_id": {
2374
+ "name": "user_id",
2375
+ "type": "text",
2376
+ "primaryKey": false,
2377
+ "notNull": true
2378
+ },
2379
+ "conversation_id": {
2380
+ "name": "conversation_id",
2381
+ "type": "text",
2382
+ "primaryKey": false,
2383
+ "notNull": true
2384
+ },
2385
+ "last_read_seq": {
2386
+ "name": "last_read_seq",
2387
+ "type": "integer",
2388
+ "primaryKey": false,
2389
+ "notNull": true
2390
+ },
2391
+ "updated_at": {
2392
+ "name": "updated_at",
2393
+ "type": "timestamp with time zone",
2394
+ "primaryKey": false,
2395
+ "notNull": true
2396
+ }
2397
+ },
2398
+ "indexes": {},
2399
+ "foreignKeys": {
2400
+ "junior_conversation_read_positions_user_id_junior_users_id_fk": {
2401
+ "name": "junior_conversation_read_positions_user_id_junior_users_id_fk",
2402
+ "tableFrom": "junior_conversation_read_positions",
2403
+ "tableTo": "junior_users",
2404
+ "columnsFrom": ["user_id"],
2405
+ "columnsTo": ["id"],
2406
+ "onDelete": "no action",
2407
+ "onUpdate": "no action"
2408
+ },
2409
+ "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk": {
2410
+ "name": "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk",
2411
+ "tableFrom": "junior_conversation_read_positions",
2412
+ "tableTo": "junior_conversations",
2413
+ "columnsFrom": ["conversation_id"],
2414
+ "columnsTo": ["conversation_id"],
2415
+ "onDelete": "no action",
2416
+ "onUpdate": "no action"
2417
+ }
2418
+ },
2419
+ "compositePrimaryKeys": {
2420
+ "junior_conversation_read_positions_user_conversation_pk": {
2421
+ "name": "junior_conversation_read_positions_user_conversation_pk",
2422
+ "columns": ["user_id", "conversation_id"]
2423
+ }
2424
+ },
2425
+ "uniqueConstraints": {},
2426
+ "policies": {},
2427
+ "checkConstraints": {},
2428
+ "isRLSEnabled": false
2429
+ },
2430
+ "public.junior_conversations": {
2431
+ "name": "junior_conversations",
2432
+ "schema": "",
2433
+ "columns": {
2434
+ "conversation_id": {
2435
+ "name": "conversation_id",
2436
+ "type": "text",
2437
+ "primaryKey": true,
2438
+ "notNull": true
2439
+ },
2440
+ "schema_version": {
2441
+ "name": "schema_version",
2442
+ "type": "integer",
2443
+ "primaryKey": false,
2444
+ "notNull": true,
2445
+ "default": 1
2446
+ },
2447
+ "source": {
2448
+ "name": "source",
2449
+ "type": "text",
2450
+ "primaryKey": false,
2451
+ "notNull": false
2452
+ },
2453
+ "source_json": {
2454
+ "name": "source_json",
2455
+ "type": "jsonb",
2456
+ "primaryKey": false,
2457
+ "notNull": false
2458
+ },
2459
+ "location_json": {
2460
+ "name": "location_json",
2461
+ "type": "jsonb",
2462
+ "primaryKey": false,
2463
+ "notNull": false
2464
+ },
2465
+ "destination_id": {
2466
+ "name": "destination_id",
2467
+ "type": "text",
2468
+ "primaryKey": false,
2469
+ "notNull": false
2470
+ },
2471
+ "destination_json": {
2472
+ "name": "destination_json",
2473
+ "type": "jsonb",
2474
+ "primaryKey": false,
2475
+ "notNull": false
2476
+ },
2477
+ "actor_identity_id": {
2478
+ "name": "actor_identity_id",
2479
+ "type": "text",
2480
+ "primaryKey": false,
2481
+ "notNull": false
2482
+ },
2483
+ "creator_identity_id": {
2484
+ "name": "creator_identity_id",
2485
+ "type": "text",
2486
+ "primaryKey": false,
2487
+ "notNull": false
2488
+ },
2489
+ "credential_subject_identity_id": {
2490
+ "name": "credential_subject_identity_id",
2491
+ "type": "text",
2492
+ "primaryKey": false,
2493
+ "notNull": false
2494
+ },
2495
+ "actor_json": {
2496
+ "name": "actor_json",
2497
+ "type": "jsonb",
2498
+ "primaryKey": false,
2499
+ "notNull": false
2500
+ },
2501
+ "channel_name": {
2502
+ "name": "channel_name",
2503
+ "type": "text",
2504
+ "primaryKey": false,
2505
+ "notNull": false
2506
+ },
2507
+ "title": {
2508
+ "name": "title",
2509
+ "type": "text",
2510
+ "primaryKey": false,
2511
+ "notNull": false
2512
+ },
2513
+ "created_at": {
2514
+ "name": "created_at",
2515
+ "type": "timestamp with time zone",
2516
+ "primaryKey": false,
2517
+ "notNull": true
2518
+ },
2519
+ "last_activity_at": {
2520
+ "name": "last_activity_at",
2521
+ "type": "timestamp with time zone",
2522
+ "primaryKey": false,
2523
+ "notNull": true
2524
+ },
2525
+ "updated_at": {
2526
+ "name": "updated_at",
2527
+ "type": "timestamp with time zone",
2528
+ "primaryKey": false,
2529
+ "notNull": true
2530
+ },
2531
+ "execution_updated_at": {
2532
+ "name": "execution_updated_at",
2533
+ "type": "timestamp with time zone",
2534
+ "primaryKey": false,
2535
+ "notNull": false
2536
+ },
2537
+ "execution_status": {
2538
+ "name": "execution_status",
2539
+ "type": "text",
2540
+ "primaryKey": false,
2541
+ "notNull": true
2542
+ },
2543
+ "run_id": {
2544
+ "name": "run_id",
2545
+ "type": "text",
2546
+ "primaryKey": false,
2547
+ "notNull": false
2548
+ },
2549
+ "last_checkpoint_at": {
2550
+ "name": "last_checkpoint_at",
2551
+ "type": "timestamp with time zone",
2552
+ "primaryKey": false,
2553
+ "notNull": false
2554
+ },
2555
+ "last_enqueued_at": {
2556
+ "name": "last_enqueued_at",
2557
+ "type": "timestamp with time zone",
2558
+ "primaryKey": false,
2559
+ "notNull": false
2560
+ },
2561
+ "parent_conversation_id": {
2562
+ "name": "parent_conversation_id",
2563
+ "type": "text",
2564
+ "primaryKey": false,
2565
+ "notNull": false
2566
+ },
2567
+ "kind": {
2568
+ "name": "kind",
2569
+ "type": "text",
2570
+ "primaryKey": false,
2571
+ "notNull": false
2572
+ },
2573
+ "archived_at": {
2574
+ "name": "archived_at",
2575
+ "type": "timestamp with time zone",
2576
+ "primaryKey": false,
2577
+ "notNull": false
2578
+ },
2579
+ "child_archived_at": {
2580
+ "name": "child_archived_at",
2581
+ "type": "timestamp with time zone",
2582
+ "primaryKey": false,
2583
+ "notNull": false
2584
+ },
2585
+ "forked_from_conversation_id": {
2586
+ "name": "forked_from_conversation_id",
2587
+ "type": "text",
2588
+ "primaryKey": false,
2589
+ "notNull": false
2590
+ },
2591
+ "quick_question_at": {
2592
+ "name": "quick_question_at",
2593
+ "type": "timestamp with time zone",
2594
+ "primaryKey": false,
2595
+ "notNull": false
2596
+ },
2597
+ "root_conversation_id": {
2598
+ "name": "root_conversation_id",
2599
+ "type": "text",
2600
+ "primaryKey": false,
2601
+ "notNull": false
2602
+ },
2603
+ "transcript_purged_at": {
2604
+ "name": "transcript_purged_at",
2605
+ "type": "timestamp with time zone",
2606
+ "primaryKey": false,
2607
+ "notNull": false
2608
+ },
2609
+ "stopped_at": {
2610
+ "name": "stopped_at",
2611
+ "type": "timestamp with time zone",
2612
+ "primaryKey": false,
2613
+ "notNull": false
2614
+ },
2615
+ "duration_ms": {
2616
+ "name": "duration_ms",
2617
+ "type": "integer",
2618
+ "primaryKey": false,
2619
+ "notNull": true,
2620
+ "default": 0
2621
+ },
2622
+ "usage_json": {
2623
+ "name": "usage_json",
2624
+ "type": "jsonb",
2625
+ "primaryKey": false,
2626
+ "notNull": false
2627
+ },
2628
+ "execution_duration_ms": {
2629
+ "name": "execution_duration_ms",
2630
+ "type": "integer",
2631
+ "primaryKey": false,
2632
+ "notNull": true,
2633
+ "default": 0
2634
+ },
2635
+ "execution_usage_json": {
2636
+ "name": "execution_usage_json",
2637
+ "type": "jsonb",
2638
+ "primaryKey": false,
2639
+ "notNull": false
2640
+ },
2641
+ "metric_run_id": {
2642
+ "name": "metric_run_id",
2643
+ "type": "text",
2644
+ "primaryKey": false,
2645
+ "notNull": false
2646
+ },
2647
+ "detail_version": {
2648
+ "name": "detail_version",
2649
+ "type": "integer",
2650
+ "primaryKey": false,
2651
+ "notNull": true,
2652
+ "default": 0
2653
+ }
2654
+ },
2655
+ "indexes": {
2656
+ "junior_conversations_last_activity_idx": {
2657
+ "name": "junior_conversations_last_activity_idx",
2658
+ "columns": [
2659
+ {
2660
+ "expression": "last_activity_at",
2661
+ "isExpression": false,
2662
+ "asc": false,
2663
+ "nulls": "last"
2664
+ },
2665
+ {
2666
+ "expression": "conversation_id",
2667
+ "isExpression": false,
2668
+ "asc": true,
2669
+ "nulls": "last"
2670
+ }
2671
+ ],
2672
+ "isUnique": false,
2673
+ "concurrently": false,
2674
+ "method": "btree",
2675
+ "with": {}
2676
+ },
2677
+ "junior_conversations_active_idx": {
2678
+ "name": "junior_conversations_active_idx",
2679
+ "columns": [
2680
+ {
2681
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
2682
+ "asc": true,
2683
+ "isExpression": true,
2684
+ "nulls": "last"
2685
+ },
2686
+ {
2687
+ "expression": "conversation_id",
2688
+ "isExpression": false,
2689
+ "asc": true,
2690
+ "nulls": "last"
2691
+ }
2692
+ ],
2693
+ "isUnique": false,
2694
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
2695
+ "concurrently": false,
2696
+ "method": "btree",
2697
+ "with": {}
2698
+ },
2699
+ "junior_conversations_destination_activity_idx": {
2700
+ "name": "junior_conversations_destination_activity_idx",
2701
+ "columns": [
2702
+ {
2703
+ "expression": "destination_id",
2704
+ "isExpression": false,
2705
+ "asc": true,
2706
+ "nulls": "last"
2707
+ },
2708
+ {
2709
+ "expression": "last_activity_at",
2710
+ "isExpression": false,
2711
+ "asc": false,
2712
+ "nulls": "last"
2713
+ }
2714
+ ],
2715
+ "isUnique": false,
2716
+ "concurrently": false,
2717
+ "method": "btree",
2718
+ "with": {}
2719
+ },
2720
+ "junior_conversations_actor_activity_idx": {
2721
+ "name": "junior_conversations_actor_activity_idx",
2722
+ "columns": [
2723
+ {
2724
+ "expression": "actor_identity_id",
2725
+ "isExpression": false,
2726
+ "asc": true,
2727
+ "nulls": "last"
2728
+ },
2729
+ {
2730
+ "expression": "last_activity_at",
2731
+ "isExpression": false,
2732
+ "asc": false,
2733
+ "nulls": "last"
2734
+ }
2735
+ ],
2736
+ "isUnique": false,
2737
+ "concurrently": false,
2738
+ "method": "btree",
2739
+ "with": {}
2740
+ },
2741
+ "junior_conversations_parent_idx": {
2742
+ "name": "junior_conversations_parent_idx",
2743
+ "columns": [
2744
+ {
2745
+ "expression": "parent_conversation_id",
2746
+ "isExpression": false,
2747
+ "asc": true,
2748
+ "nulls": "last"
2749
+ }
2750
+ ],
2751
+ "isUnique": false,
2752
+ "concurrently": false,
2753
+ "method": "btree",
2754
+ "with": {}
2755
+ },
2756
+ "junior_conversations_forked_from_idx": {
2757
+ "name": "junior_conversations_forked_from_idx",
2758
+ "columns": [
2759
+ {
2760
+ "expression": "forked_from_conversation_id",
2761
+ "isExpression": false,
2762
+ "asc": true,
2763
+ "nulls": "last"
2764
+ }
2765
+ ],
2766
+ "isUnique": false,
2767
+ "concurrently": false,
2768
+ "method": "btree",
2769
+ "with": {}
2770
+ },
2771
+ "junior_conversations_root_idx": {
2772
+ "name": "junior_conversations_root_idx",
2773
+ "columns": [
2774
+ {
2775
+ "expression": "root_conversation_id",
2776
+ "isExpression": false,
2777
+ "asc": true,
2778
+ "nulls": "last"
2779
+ }
2780
+ ],
2781
+ "isUnique": false,
2782
+ "concurrently": false,
2783
+ "method": "btree",
2784
+ "with": {}
2785
+ }
2786
+ },
2787
+ "foreignKeys": {
2788
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
2789
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
2790
+ "tableFrom": "junior_conversations",
2791
+ "tableTo": "junior_destinations",
2792
+ "columnsFrom": ["destination_id"],
2793
+ "columnsTo": ["id"],
2794
+ "onDelete": "no action",
2795
+ "onUpdate": "no action"
2796
+ },
2797
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
2798
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
2799
+ "tableFrom": "junior_conversations",
2800
+ "tableTo": "junior_identities",
2801
+ "columnsFrom": ["actor_identity_id"],
2802
+ "columnsTo": ["id"],
2803
+ "onDelete": "no action",
2804
+ "onUpdate": "no action"
2805
+ },
2806
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
2807
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
2808
+ "tableFrom": "junior_conversations",
2809
+ "tableTo": "junior_identities",
2810
+ "columnsFrom": ["creator_identity_id"],
2811
+ "columnsTo": ["id"],
2812
+ "onDelete": "no action",
2813
+ "onUpdate": "no action"
2814
+ },
2815
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
2816
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
2817
+ "tableFrom": "junior_conversations",
2818
+ "tableTo": "junior_identities",
2819
+ "columnsFrom": ["credential_subject_identity_id"],
2820
+ "columnsTo": ["id"],
2821
+ "onDelete": "no action",
2822
+ "onUpdate": "no action"
2823
+ },
2824
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
2825
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
2826
+ "tableFrom": "junior_conversations",
2827
+ "tableTo": "junior_conversations",
2828
+ "columnsFrom": ["parent_conversation_id"],
2829
+ "columnsTo": ["conversation_id"],
2830
+ "onDelete": "no action",
2831
+ "onUpdate": "no action"
2832
+ },
2833
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
2834
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
2835
+ "tableFrom": "junior_conversations",
2836
+ "tableTo": "junior_conversations",
2837
+ "columnsFrom": ["forked_from_conversation_id"],
2838
+ "columnsTo": ["conversation_id"],
2839
+ "onDelete": "set null",
2840
+ "onUpdate": "no action"
2841
+ },
2842
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
2843
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
2844
+ "tableFrom": "junior_conversations",
2845
+ "tableTo": "junior_conversations",
2846
+ "columnsFrom": ["root_conversation_id"],
2847
+ "columnsTo": ["conversation_id"],
2848
+ "onDelete": "no action",
2849
+ "onUpdate": "no action"
2850
+ }
2851
+ },
2852
+ "compositePrimaryKeys": {},
2853
+ "uniqueConstraints": {},
2854
+ "policies": {},
2855
+ "checkConstraints": {
2856
+ "junior_conversations_kind_check": {
2857
+ "name": "junior_conversations_kind_check",
2858
+ "value": "\"junior_conversations\".\"kind\" in ('root', 'thread', 'task')"
2859
+ },
2860
+ "junior_conversations_kind_parent_check": {
2861
+ "name": "junior_conversations_kind_parent_check",
2862
+ "value": "\"junior_conversations\".\"kind\" is null or ((\"junior_conversations\".\"kind\" = 'root') = (\"junior_conversations\".\"parent_conversation_id\" is null))"
2863
+ }
2864
+ },
2865
+ "isRLSEnabled": false
2866
+ },
2867
+ "public.junior_destinations": {
2868
+ "name": "junior_destinations",
2869
+ "schema": "",
2870
+ "columns": {
2871
+ "id": {
2872
+ "name": "id",
2873
+ "type": "text",
2874
+ "primaryKey": true,
2875
+ "notNull": true
2876
+ },
2877
+ "provider": {
2878
+ "name": "provider",
2879
+ "type": "text",
2880
+ "primaryKey": false,
2881
+ "notNull": true
2882
+ },
2883
+ "provider_tenant_id": {
2884
+ "name": "provider_tenant_id",
2885
+ "type": "text",
2886
+ "primaryKey": false,
2887
+ "notNull": true,
2888
+ "default": "''"
2889
+ },
2890
+ "provider_destination_id": {
2891
+ "name": "provider_destination_id",
2892
+ "type": "text",
2893
+ "primaryKey": false,
2894
+ "notNull": true
2895
+ },
2896
+ "kind": {
2897
+ "name": "kind",
2898
+ "type": "text",
2899
+ "primaryKey": false,
2900
+ "notNull": true
2901
+ },
2902
+ "parent_destination_id": {
2903
+ "name": "parent_destination_id",
2904
+ "type": "text",
2905
+ "primaryKey": false,
2906
+ "notNull": false
2907
+ },
2908
+ "display_name": {
2909
+ "name": "display_name",
2910
+ "type": "text",
2911
+ "primaryKey": false,
2912
+ "notNull": false
2913
+ },
2914
+ "visibility": {
2915
+ "name": "visibility",
2916
+ "type": "text",
2917
+ "primaryKey": false,
2918
+ "notNull": true,
2919
+ "default": "'unknown'"
2920
+ },
2921
+ "metadata_json": {
2922
+ "name": "metadata_json",
2923
+ "type": "jsonb",
2924
+ "primaryKey": false,
2925
+ "notNull": false
2926
+ },
2927
+ "created_at": {
2928
+ "name": "created_at",
2929
+ "type": "timestamp with time zone",
2930
+ "primaryKey": false,
2931
+ "notNull": true
2932
+ },
2933
+ "updated_at": {
2934
+ "name": "updated_at",
2935
+ "type": "timestamp with time zone",
2936
+ "primaryKey": false,
2937
+ "notNull": true
2938
+ }
2939
+ },
2940
+ "indexes": {
2941
+ "junior_destinations_provider_destination_uidx": {
2942
+ "name": "junior_destinations_provider_destination_uidx",
2943
+ "columns": [
2944
+ {
2945
+ "expression": "provider",
2946
+ "isExpression": false,
2947
+ "asc": true,
2948
+ "nulls": "last"
2949
+ },
2950
+ {
2951
+ "expression": "provider_tenant_id",
2952
+ "isExpression": false,
2953
+ "asc": true,
2954
+ "nulls": "last"
2955
+ },
2956
+ {
2957
+ "expression": "provider_destination_id",
2958
+ "isExpression": false,
2959
+ "asc": true,
2960
+ "nulls": "last"
2961
+ }
2962
+ ],
2963
+ "isUnique": true,
2964
+ "concurrently": false,
2965
+ "method": "btree",
2966
+ "with": {}
2967
+ },
2968
+ "junior_destinations_provider_kind_idx": {
2969
+ "name": "junior_destinations_provider_kind_idx",
2970
+ "columns": [
2971
+ {
2972
+ "expression": "provider",
2973
+ "isExpression": false,
2974
+ "asc": true,
2975
+ "nulls": "last"
2976
+ },
2977
+ {
2978
+ "expression": "kind",
2979
+ "isExpression": false,
2980
+ "asc": true,
2981
+ "nulls": "last"
2982
+ }
2983
+ ],
2984
+ "isUnique": false,
2985
+ "concurrently": false,
2986
+ "method": "btree",
2987
+ "with": {}
2988
+ }
2989
+ },
2990
+ "foreignKeys": {},
2991
+ "compositePrimaryKeys": {},
2992
+ "uniqueConstraints": {},
2993
+ "policies": {},
2994
+ "checkConstraints": {},
2995
+ "isRLSEnabled": false
2996
+ },
2997
+ "public.junior_identities": {
2998
+ "name": "junior_identities",
2999
+ "schema": "",
3000
+ "columns": {
3001
+ "id": {
3002
+ "name": "id",
3003
+ "type": "text",
3004
+ "primaryKey": true,
3005
+ "notNull": true
3006
+ },
3007
+ "kind": {
3008
+ "name": "kind",
3009
+ "type": "text",
3010
+ "primaryKey": false,
3011
+ "notNull": true
3012
+ },
3013
+ "provider": {
3014
+ "name": "provider",
3015
+ "type": "text",
3016
+ "primaryKey": false,
3017
+ "notNull": true
3018
+ },
3019
+ "provider_tenant_id": {
3020
+ "name": "provider_tenant_id",
3021
+ "type": "text",
3022
+ "primaryKey": false,
3023
+ "notNull": true,
3024
+ "default": "''"
3025
+ },
3026
+ "provider_subject_id": {
3027
+ "name": "provider_subject_id",
3028
+ "type": "text",
3029
+ "primaryKey": false,
3030
+ "notNull": true
3031
+ },
3032
+ "display_name": {
3033
+ "name": "display_name",
3034
+ "type": "text",
3035
+ "primaryKey": false,
3036
+ "notNull": false
3037
+ },
3038
+ "handle": {
3039
+ "name": "handle",
3040
+ "type": "text",
3041
+ "primaryKey": false,
3042
+ "notNull": false
3043
+ },
3044
+ "email": {
3045
+ "name": "email",
3046
+ "type": "text",
3047
+ "primaryKey": false,
3048
+ "notNull": false
3049
+ },
3050
+ "avatar_url": {
3051
+ "name": "avatar_url",
3052
+ "type": "text",
3053
+ "primaryKey": false,
3054
+ "notNull": false
3055
+ },
3056
+ "metadata_json": {
3057
+ "name": "metadata_json",
3058
+ "type": "jsonb",
3059
+ "primaryKey": false,
3060
+ "notNull": false
3061
+ },
3062
+ "created_at": {
3063
+ "name": "created_at",
3064
+ "type": "timestamp with time zone",
3065
+ "primaryKey": false,
3066
+ "notNull": true
3067
+ },
3068
+ "updated_at": {
3069
+ "name": "updated_at",
3070
+ "type": "timestamp with time zone",
3071
+ "primaryKey": false,
3072
+ "notNull": true
3073
+ },
3074
+ "user_id": {
3075
+ "name": "user_id",
3076
+ "type": "text",
3077
+ "primaryKey": false,
3078
+ "notNull": false
3079
+ },
3080
+ "email_normalized": {
3081
+ "name": "email_normalized",
3082
+ "type": "text",
3083
+ "primaryKey": false,
3084
+ "notNull": false
3085
+ },
3086
+ "email_verified": {
3087
+ "name": "email_verified",
3088
+ "type": "boolean",
3089
+ "primaryKey": false,
3090
+ "notNull": true,
3091
+ "default": false
3092
+ },
3093
+ "signed_in_at": {
3094
+ "name": "signed_in_at",
3095
+ "type": "timestamp with time zone",
3096
+ "primaryKey": false,
3097
+ "notNull": false
3098
+ }
3099
+ },
3100
+ "indexes": {
3101
+ "junior_identities_provider_subject_uidx": {
3102
+ "name": "junior_identities_provider_subject_uidx",
3103
+ "columns": [
3104
+ {
3105
+ "expression": "provider",
3106
+ "isExpression": false,
3107
+ "asc": true,
3108
+ "nulls": "last"
3109
+ },
3110
+ {
3111
+ "expression": "provider_tenant_id",
3112
+ "isExpression": false,
3113
+ "asc": true,
3114
+ "nulls": "last"
3115
+ },
3116
+ {
3117
+ "expression": "provider_subject_id",
3118
+ "isExpression": false,
3119
+ "asc": true,
3120
+ "nulls": "last"
3121
+ }
3122
+ ],
3123
+ "isUnique": true,
3124
+ "concurrently": false,
3125
+ "method": "btree",
3126
+ "with": {}
3127
+ },
3128
+ "junior_identities_user_idx": {
3129
+ "name": "junior_identities_user_idx",
3130
+ "columns": [
3131
+ {
3132
+ "expression": "user_id",
3133
+ "isExpression": false,
3134
+ "asc": true,
3135
+ "nulls": "last"
3136
+ }
3137
+ ],
3138
+ "isUnique": false,
3139
+ "concurrently": false,
3140
+ "method": "btree",
3141
+ "with": {}
3142
+ },
3143
+ "junior_identities_verified_email_idx": {
3144
+ "name": "junior_identities_verified_email_idx",
3145
+ "columns": [
3146
+ {
3147
+ "expression": "email_normalized",
3148
+ "isExpression": false,
3149
+ "asc": true,
3150
+ "nulls": "last"
3151
+ }
3152
+ ],
3153
+ "isUnique": false,
3154
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
3155
+ "concurrently": false,
3156
+ "method": "btree",
3157
+ "with": {}
3158
+ },
3159
+ "junior_identities_kind_provider_idx": {
3160
+ "name": "junior_identities_kind_provider_idx",
3161
+ "columns": [
3162
+ {
3163
+ "expression": "kind",
3164
+ "isExpression": false,
3165
+ "asc": true,
3166
+ "nulls": "last"
3167
+ },
3168
+ {
3169
+ "expression": "provider",
3170
+ "isExpression": false,
3171
+ "asc": true,
3172
+ "nulls": "last"
3173
+ }
3174
+ ],
3175
+ "isUnique": false,
3176
+ "concurrently": false,
3177
+ "method": "btree",
3178
+ "with": {}
3179
+ }
3180
+ },
3181
+ "foreignKeys": {
3182
+ "junior_identities_user_id_junior_users_id_fk": {
3183
+ "name": "junior_identities_user_id_junior_users_id_fk",
3184
+ "tableFrom": "junior_identities",
3185
+ "tableTo": "junior_users",
3186
+ "columnsFrom": ["user_id"],
3187
+ "columnsTo": ["id"],
3188
+ "onDelete": "no action",
3189
+ "onUpdate": "no action"
3190
+ }
3191
+ },
3192
+ "compositePrimaryKeys": {},
3193
+ "uniqueConstraints": {},
3194
+ "policies": {},
3195
+ "checkConstraints": {},
3196
+ "isRLSEnabled": false
3197
+ },
3198
+ "public.junior_location_configurations": {
3199
+ "name": "junior_location_configurations",
3200
+ "schema": "",
3201
+ "columns": {
3202
+ "location_id": {
3203
+ "name": "location_id",
3204
+ "type": "text",
3205
+ "primaryKey": false,
3206
+ "notNull": true
3207
+ },
3208
+ "key": {
3209
+ "name": "key",
3210
+ "type": "text",
3211
+ "primaryKey": false,
3212
+ "notNull": true
3213
+ },
3214
+ "value": {
3215
+ "name": "value",
3216
+ "type": "text",
3217
+ "primaryKey": false,
3218
+ "notNull": true
3219
+ },
3220
+ "updated_at": {
3221
+ "name": "updated_at",
3222
+ "type": "timestamp with time zone",
3223
+ "primaryKey": false,
3224
+ "notNull": true
3225
+ },
3226
+ "updated_by": {
3227
+ "name": "updated_by",
3228
+ "type": "text",
3229
+ "primaryKey": false,
3230
+ "notNull": false
3231
+ },
3232
+ "source": {
3233
+ "name": "source",
3234
+ "type": "text",
3235
+ "primaryKey": false,
3236
+ "notNull": false
3237
+ },
3238
+ "expires_at": {
3239
+ "name": "expires_at",
3240
+ "type": "text",
3241
+ "primaryKey": false,
3242
+ "notNull": false
3243
+ }
3244
+ },
3245
+ "indexes": {},
3246
+ "foreignKeys": {
3247
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3248
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3249
+ "tableFrom": "junior_location_configurations",
3250
+ "tableTo": "junior_destinations",
3251
+ "columnsFrom": ["location_id"],
3252
+ "columnsTo": ["id"],
3253
+ "onDelete": "cascade",
3254
+ "onUpdate": "no action"
3255
+ }
3256
+ },
3257
+ "compositePrimaryKeys": {
3258
+ "junior_location_configurations_location_id_key_pk": {
3259
+ "name": "junior_location_configurations_location_id_key_pk",
3260
+ "columns": ["location_id", "key"]
3261
+ }
3262
+ },
3263
+ "uniqueConstraints": {},
3264
+ "policies": {},
3265
+ "checkConstraints": {},
3266
+ "isRLSEnabled": false
3267
+ },
3268
+ "public.junior_push_subscriptions": {
3269
+ "name": "junior_push_subscriptions",
3270
+ "schema": "",
3271
+ "columns": {
3272
+ "id": {
3273
+ "name": "id",
3274
+ "type": "text",
3275
+ "primaryKey": true,
3276
+ "notNull": true
3277
+ },
3278
+ "user_id": {
3279
+ "name": "user_id",
3280
+ "type": "text",
3281
+ "primaryKey": false,
3282
+ "notNull": true
3283
+ },
3284
+ "endpoint": {
3285
+ "name": "endpoint",
3286
+ "type": "text",
3287
+ "primaryKey": false,
3288
+ "notNull": true
3289
+ },
3290
+ "p256dh": {
3291
+ "name": "p256dh",
3292
+ "type": "text",
3293
+ "primaryKey": false,
3294
+ "notNull": true
3295
+ },
3296
+ "auth": {
3297
+ "name": "auth",
3298
+ "type": "text",
3299
+ "primaryKey": false,
3300
+ "notNull": true
3301
+ },
3302
+ "created_at": {
3303
+ "name": "created_at",
3304
+ "type": "timestamp with time zone",
3305
+ "primaryKey": false,
3306
+ "notNull": true
3307
+ },
3308
+ "updated_at": {
3309
+ "name": "updated_at",
3310
+ "type": "timestamp with time zone",
3311
+ "primaryKey": false,
3312
+ "notNull": true
3313
+ }
3314
+ },
3315
+ "indexes": {
3316
+ "junior_push_subscriptions_endpoint_uidx": {
3317
+ "name": "junior_push_subscriptions_endpoint_uidx",
3318
+ "columns": [
3319
+ {
3320
+ "expression": "endpoint",
3321
+ "isExpression": false,
3322
+ "asc": true,
3323
+ "nulls": "last"
3324
+ }
3325
+ ],
3326
+ "isUnique": true,
3327
+ "concurrently": false,
3328
+ "method": "btree",
3329
+ "with": {}
3330
+ },
3331
+ "junior_push_subscriptions_user_idx": {
3332
+ "name": "junior_push_subscriptions_user_idx",
3333
+ "columns": [
3334
+ {
3335
+ "expression": "user_id",
3336
+ "isExpression": false,
3337
+ "asc": true,
3338
+ "nulls": "last"
3339
+ }
3340
+ ],
3341
+ "isUnique": false,
3342
+ "concurrently": false,
3343
+ "method": "btree",
3344
+ "with": {}
3345
+ }
3346
+ },
3347
+ "foreignKeys": {
3348
+ "junior_push_subscriptions_user_id_junior_users_id_fk": {
3349
+ "name": "junior_push_subscriptions_user_id_junior_users_id_fk",
3350
+ "tableFrom": "junior_push_subscriptions",
3351
+ "tableTo": "junior_users",
3352
+ "columnsFrom": ["user_id"],
3353
+ "columnsTo": ["id"],
3354
+ "onDelete": "cascade",
3355
+ "onUpdate": "no action"
3356
+ }
3357
+ },
3358
+ "compositePrimaryKeys": {},
3359
+ "uniqueConstraints": {},
3360
+ "policies": {},
3361
+ "checkConstraints": {},
3362
+ "isRLSEnabled": false
3363
+ },
3364
+ "public.junior_review_item_assignees": {
3365
+ "name": "junior_review_item_assignees",
3366
+ "schema": "",
3367
+ "columns": {
3368
+ "item_id": {
3369
+ "name": "item_id",
3370
+ "type": "text",
3371
+ "primaryKey": false,
3372
+ "notNull": true
3373
+ },
3374
+ "user_id": {
3375
+ "name": "user_id",
3376
+ "type": "text",
3377
+ "primaryKey": false,
3378
+ "notNull": true
3379
+ }
3380
+ },
3381
+ "indexes": {
3382
+ "junior_review_item_assignees_user_idx": {
3383
+ "name": "junior_review_item_assignees_user_idx",
3384
+ "columns": [
3385
+ {
3386
+ "expression": "user_id",
3387
+ "isExpression": false,
3388
+ "asc": true,
3389
+ "nulls": "last"
3390
+ }
3391
+ ],
3392
+ "isUnique": false,
3393
+ "concurrently": false,
3394
+ "method": "btree",
3395
+ "with": {}
3396
+ }
3397
+ },
3398
+ "foreignKeys": {
3399
+ "junior_review_item_assignees_item_id_junior_review_items_id_fk": {
3400
+ "name": "junior_review_item_assignees_item_id_junior_review_items_id_fk",
3401
+ "tableFrom": "junior_review_item_assignees",
3402
+ "tableTo": "junior_review_items",
3403
+ "columnsFrom": ["item_id"],
3404
+ "columnsTo": ["id"],
3405
+ "onDelete": "cascade",
3406
+ "onUpdate": "no action"
3407
+ },
3408
+ "junior_review_item_assignees_user_id_junior_users_id_fk": {
3409
+ "name": "junior_review_item_assignees_user_id_junior_users_id_fk",
3410
+ "tableFrom": "junior_review_item_assignees",
3411
+ "tableTo": "junior_users",
3412
+ "columnsFrom": ["user_id"],
3413
+ "columnsTo": ["id"],
3414
+ "onDelete": "cascade",
3415
+ "onUpdate": "no action"
3416
+ }
3417
+ },
3418
+ "compositePrimaryKeys": {
3419
+ "junior_review_item_assignees_item_id_user_id_pk": {
3420
+ "name": "junior_review_item_assignees_item_id_user_id_pk",
3421
+ "columns": ["item_id", "user_id"]
3422
+ }
3423
+ },
3424
+ "uniqueConstraints": {},
3425
+ "policies": {},
3426
+ "checkConstraints": {},
3427
+ "isRLSEnabled": false
3428
+ },
3429
+ "public.junior_review_item_conversations": {
3430
+ "name": "junior_review_item_conversations",
3431
+ "schema": "",
3432
+ "columns": {
3433
+ "item_id": {
3434
+ "name": "item_id",
3435
+ "type": "text",
3436
+ "primaryKey": false,
3437
+ "notNull": true
3438
+ },
3439
+ "conversation_id": {
3440
+ "name": "conversation_id",
3441
+ "type": "text",
3442
+ "primaryKey": false,
3443
+ "notNull": true
3444
+ }
3445
+ },
3446
+ "indexes": {
3447
+ "junior_review_item_conversations_conversation_idx": {
3448
+ "name": "junior_review_item_conversations_conversation_idx",
3449
+ "columns": [
3450
+ {
3451
+ "expression": "conversation_id",
3452
+ "isExpression": false,
3453
+ "asc": true,
3454
+ "nulls": "last"
3455
+ }
3456
+ ],
3457
+ "isUnique": false,
3458
+ "concurrently": false,
3459
+ "method": "btree",
3460
+ "with": {}
3461
+ }
3462
+ },
3463
+ "foreignKeys": {
3464
+ "junior_review_item_conversations_item_id_junior_review_items_id_fk": {
3465
+ "name": "junior_review_item_conversations_item_id_junior_review_items_id_fk",
3466
+ "tableFrom": "junior_review_item_conversations",
3467
+ "tableTo": "junior_review_items",
3468
+ "columnsFrom": ["item_id"],
3469
+ "columnsTo": ["id"],
3470
+ "onDelete": "cascade",
3471
+ "onUpdate": "no action"
3472
+ },
3473
+ "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk": {
3474
+ "name": "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk",
3475
+ "tableFrom": "junior_review_item_conversations",
3476
+ "tableTo": "junior_conversations",
3477
+ "columnsFrom": ["conversation_id"],
3478
+ "columnsTo": ["conversation_id"],
3479
+ "onDelete": "cascade",
3480
+ "onUpdate": "no action"
3481
+ }
3482
+ },
3483
+ "compositePrimaryKeys": {
3484
+ "junior_review_item_conversations_item_id_conversation_id_pk": {
3485
+ "name": "junior_review_item_conversations_item_id_conversation_id_pk",
3486
+ "columns": ["item_id", "conversation_id"]
3487
+ }
3488
+ },
3489
+ "uniqueConstraints": {},
3490
+ "policies": {},
3491
+ "checkConstraints": {},
3492
+ "isRLSEnabled": false
3493
+ },
3494
+ "public.junior_review_item_slack_cards": {
3495
+ "name": "junior_review_item_slack_cards",
3496
+ "schema": "",
3497
+ "columns": {
3498
+ "item_id": {
3499
+ "name": "item_id",
3500
+ "type": "text",
3501
+ "primaryKey": false,
3502
+ "notNull": true
3503
+ },
3504
+ "conversation_id": {
3505
+ "name": "conversation_id",
3506
+ "type": "text",
3507
+ "primaryKey": false,
3508
+ "notNull": true
3509
+ },
3510
+ "team_id": {
3511
+ "name": "team_id",
3512
+ "type": "text",
3513
+ "primaryKey": false,
3514
+ "notNull": true
3515
+ },
3516
+ "channel_id": {
3517
+ "name": "channel_id",
3518
+ "type": "text",
3519
+ "primaryKey": false,
3520
+ "notNull": true
3521
+ },
3522
+ "message_ts": {
3523
+ "name": "message_ts",
3524
+ "type": "text",
3525
+ "primaryKey": false,
3526
+ "notNull": true
3527
+ }
3528
+ },
3529
+ "indexes": {},
3530
+ "foreignKeys": {
3531
+ "junior_review_item_slack_cards_item_id_junior_review_items_id_fk": {
3532
+ "name": "junior_review_item_slack_cards_item_id_junior_review_items_id_fk",
3533
+ "tableFrom": "junior_review_item_slack_cards",
3534
+ "tableTo": "junior_review_items",
3535
+ "columnsFrom": ["item_id"],
3536
+ "columnsTo": ["id"],
3537
+ "onDelete": "cascade",
3538
+ "onUpdate": "no action"
3539
+ },
3540
+ "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk": {
3541
+ "name": "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk",
3542
+ "tableFrom": "junior_review_item_slack_cards",
3543
+ "tableTo": "junior_conversations",
3544
+ "columnsFrom": ["conversation_id"],
3545
+ "columnsTo": ["conversation_id"],
3546
+ "onDelete": "cascade",
3547
+ "onUpdate": "no action"
3548
+ }
3549
+ },
3550
+ "compositePrimaryKeys": {
3551
+ "junior_review_item_slack_cards_item_id_conversation_id_pk": {
3552
+ "name": "junior_review_item_slack_cards_item_id_conversation_id_pk",
3553
+ "columns": ["item_id", "conversation_id"]
3554
+ }
3555
+ },
3556
+ "uniqueConstraints": {},
3557
+ "policies": {},
3558
+ "checkConstraints": {},
3559
+ "isRLSEnabled": false
3560
+ },
3561
+ "public.junior_review_items": {
3562
+ "name": "junior_review_items",
3563
+ "schema": "",
3564
+ "columns": {
3565
+ "id": {
3566
+ "name": "id",
3567
+ "type": "text",
3568
+ "primaryKey": true,
3569
+ "notNull": true
3570
+ },
3571
+ "kind": {
3572
+ "name": "kind",
3573
+ "type": "text",
3574
+ "primaryKey": false,
3575
+ "notNull": true
3576
+ },
3577
+ "status": {
3578
+ "name": "status",
3579
+ "type": "text",
3580
+ "primaryKey": false,
3581
+ "notNull": true
3582
+ },
3583
+ "visibility": {
3584
+ "name": "visibility",
3585
+ "type": "text",
3586
+ "primaryKey": false,
3587
+ "notNull": true
3588
+ },
3589
+ "title": {
3590
+ "name": "title",
3591
+ "type": "text",
3592
+ "primaryKey": false,
3593
+ "notNull": true
3594
+ },
3595
+ "body": {
3596
+ "name": "body",
3597
+ "type": "text",
3598
+ "primaryKey": false,
3599
+ "notNull": true
3600
+ },
3601
+ "request": {
3602
+ "name": "request",
3603
+ "type": "jsonb",
3604
+ "primaryKey": false,
3605
+ "notNull": false
3606
+ },
3607
+ "answer": {
3608
+ "name": "answer",
3609
+ "type": "jsonb",
3610
+ "primaryKey": false,
3611
+ "notNull": false
3612
+ },
3613
+ "assigned_to_everyone": {
3614
+ "name": "assigned_to_everyone",
3615
+ "type": "boolean",
3616
+ "primaryKey": false,
3617
+ "notNull": true,
3618
+ "default": false
3619
+ },
3620
+ "dedupe_key": {
3621
+ "name": "dedupe_key",
3622
+ "type": "text",
3623
+ "primaryKey": false,
3624
+ "notNull": true
3625
+ },
3626
+ "subject_id": {
3627
+ "name": "subject_id",
3628
+ "type": "text",
3629
+ "primaryKey": false,
3630
+ "notNull": false
3631
+ },
3632
+ "subject_title": {
3633
+ "name": "subject_title",
3634
+ "type": "text",
3635
+ "primaryKey": false,
3636
+ "notNull": false
3637
+ },
3638
+ "subject_url": {
3639
+ "name": "subject_url",
3640
+ "type": "text",
3641
+ "primaryKey": false,
3642
+ "notNull": false
3643
+ },
3644
+ "added_by_conversation_id": {
3645
+ "name": "added_by_conversation_id",
3646
+ "type": "text",
3647
+ "primaryKey": false,
3648
+ "notNull": true
3649
+ },
3650
+ "added_by_turn_id": {
3651
+ "name": "added_by_turn_id",
3652
+ "type": "text",
3653
+ "primaryKey": false,
3654
+ "notNull": false
3655
+ },
3656
+ "provider": {
3657
+ "name": "provider",
3658
+ "type": "text",
3659
+ "primaryKey": false,
3660
+ "notNull": false
3661
+ },
3662
+ "provider_tenant_id": {
3663
+ "name": "provider_tenant_id",
3664
+ "type": "text",
3665
+ "primaryKey": false,
3666
+ "notNull": false
3667
+ },
3668
+ "automation_id": {
3669
+ "name": "automation_id",
3670
+ "type": "text",
3671
+ "primaryKey": false,
3672
+ "notNull": false
3673
+ },
3674
+ "closed_at": {
3675
+ "name": "closed_at",
3676
+ "type": "timestamp with time zone",
3677
+ "primaryKey": false,
3678
+ "notNull": false
3679
+ },
3680
+ "closed_by_user_id": {
3681
+ "name": "closed_by_user_id",
3682
+ "type": "text",
3683
+ "primaryKey": false,
3684
+ "notNull": false
3685
+ },
3686
+ "close_reason": {
3687
+ "name": "close_reason",
3688
+ "type": "text",
3689
+ "primaryKey": false,
3690
+ "notNull": false
3691
+ },
3692
+ "created_at": {
3693
+ "name": "created_at",
3694
+ "type": "timestamp with time zone",
3695
+ "primaryKey": false,
3696
+ "notNull": true
3697
+ },
3698
+ "updated_at": {
3699
+ "name": "updated_at",
3700
+ "type": "timestamp with time zone",
3701
+ "primaryKey": false,
3702
+ "notNull": true
3703
+ }
3704
+ },
3705
+ "indexes": {
3706
+ "junior_review_items_open_dedupe_uidx": {
3707
+ "name": "junior_review_items_open_dedupe_uidx",
3708
+ "columns": [
3709
+ {
3710
+ "expression": "coalesce(\"provider\", '')",
3711
+ "asc": true,
3712
+ "isExpression": true,
3713
+ "nulls": "last"
3714
+ },
3715
+ {
3716
+ "expression": "coalesce(\"provider_tenant_id\", '')",
3717
+ "asc": true,
3718
+ "isExpression": true,
3719
+ "nulls": "last"
3720
+ },
3721
+ {
3722
+ "expression": "dedupe_key",
3723
+ "isExpression": false,
3724
+ "asc": true,
3725
+ "nulls": "last"
3726
+ }
3727
+ ],
3728
+ "isUnique": true,
3729
+ "where": "\"junior_review_items\".\"status\" = 'open'",
3730
+ "concurrently": false,
3731
+ "method": "btree",
3732
+ "with": {}
3733
+ },
3734
+ "junior_review_items_status_idx": {
3735
+ "name": "junior_review_items_status_idx",
3736
+ "columns": [
3737
+ {
3738
+ "expression": "status",
3739
+ "isExpression": false,
3740
+ "asc": true,
3741
+ "nulls": "last"
3742
+ },
3743
+ {
3744
+ "expression": "updated_at",
3745
+ "isExpression": false,
3746
+ "asc": true,
3747
+ "nulls": "last"
3748
+ },
3749
+ {
3750
+ "expression": "id",
3751
+ "isExpression": false,
3752
+ "asc": true,
3753
+ "nulls": "last"
3754
+ }
3755
+ ],
3756
+ "isUnique": false,
3757
+ "concurrently": false,
3758
+ "method": "btree",
3759
+ "with": {}
3760
+ },
3761
+ "junior_review_items_subject_idx": {
3762
+ "name": "junior_review_items_subject_idx",
3763
+ "columns": [
3764
+ {
3765
+ "expression": "subject_id",
3766
+ "isExpression": false,
3767
+ "asc": true,
3768
+ "nulls": "last"
3769
+ },
3770
+ {
3771
+ "expression": "status",
3772
+ "isExpression": false,
3773
+ "asc": true,
3774
+ "nulls": "last"
3775
+ }
3776
+ ],
3777
+ "isUnique": false,
3778
+ "concurrently": false,
3779
+ "method": "btree",
3780
+ "with": {}
3781
+ },
3782
+ "junior_review_items_automation_idx": {
3783
+ "name": "junior_review_items_automation_idx",
3784
+ "columns": [
3785
+ {
3786
+ "expression": "automation_id",
3787
+ "isExpression": false,
3788
+ "asc": true,
3789
+ "nulls": "last"
3790
+ },
3791
+ {
3792
+ "expression": "status",
3793
+ "isExpression": false,
3794
+ "asc": true,
3795
+ "nulls": "last"
3796
+ }
3797
+ ],
3798
+ "isUnique": false,
3799
+ "concurrently": false,
3800
+ "method": "btree",
3801
+ "with": {}
3802
+ }
3803
+ },
3804
+ "foreignKeys": {
3805
+ "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk": {
3806
+ "name": "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk",
3807
+ "tableFrom": "junior_review_items",
3808
+ "tableTo": "junior_conversations",
3809
+ "columnsFrom": ["added_by_conversation_id"],
3810
+ "columnsTo": ["conversation_id"],
3811
+ "onDelete": "cascade",
3812
+ "onUpdate": "no action"
3813
+ },
3814
+ "junior_review_items_automation_id_junior_automations_id_fk": {
3815
+ "name": "junior_review_items_automation_id_junior_automations_id_fk",
3816
+ "tableFrom": "junior_review_items",
3817
+ "tableTo": "junior_automations",
3818
+ "columnsFrom": ["automation_id"],
3819
+ "columnsTo": ["id"],
3820
+ "onDelete": "set null",
3821
+ "onUpdate": "no action"
3822
+ },
3823
+ "junior_review_items_closed_by_user_id_junior_users_id_fk": {
3824
+ "name": "junior_review_items_closed_by_user_id_junior_users_id_fk",
3825
+ "tableFrom": "junior_review_items",
3826
+ "tableTo": "junior_users",
3827
+ "columnsFrom": ["closed_by_user_id"],
3828
+ "columnsTo": ["id"],
3829
+ "onDelete": "set null",
3830
+ "onUpdate": "no action"
3831
+ }
3832
+ },
3833
+ "compositePrimaryKeys": {},
3834
+ "uniqueConstraints": {},
3835
+ "policies": {},
3836
+ "checkConstraints": {
3837
+ "junior_review_items_kind_check": {
3838
+ "name": "junior_review_items_kind_check",
3839
+ "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)"
3840
+ },
3841
+ "junior_review_items_status_check": {
3842
+ "name": "junior_review_items_status_check",
3843
+ "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)"
3844
+ },
3845
+ "junior_review_items_tenant_check": {
3846
+ "name": "junior_review_items_tenant_check",
3847
+ "value": "(\"junior_review_items\".\"provider\" is null) = (\"junior_review_items\".\"provider_tenant_id\" is null)"
3848
+ },
3849
+ "junior_review_items_visibility_check": {
3850
+ "name": "junior_review_items_visibility_check",
3851
+ "value": "\"junior_review_items\".\"visibility\" = 'public' or not \"junior_review_items\".\"assigned_to_everyone\""
3852
+ }
3853
+ },
3854
+ "isRLSEnabled": false
3855
+ },
3856
+ "public.junior_snapshots": {
3857
+ "name": "junior_snapshots",
3858
+ "schema": "",
3859
+ "columns": {
3860
+ "id": {
3861
+ "name": "id",
3862
+ "type": "text",
3863
+ "primaryKey": true,
3864
+ "notNull": true
3865
+ },
3866
+ "workspace_id": {
3867
+ "name": "workspace_id",
3868
+ "type": "text",
3869
+ "primaryKey": false,
3870
+ "notNull": true
3871
+ },
3872
+ "profile_hash": {
3873
+ "name": "profile_hash",
3874
+ "type": "text",
3875
+ "primaryKey": false,
3876
+ "notNull": true
3877
+ },
3878
+ "status": {
3879
+ "name": "status",
3880
+ "type": "text",
3881
+ "primaryKey": false,
3882
+ "notNull": true
3883
+ },
3884
+ "snapshot_id": {
3885
+ "name": "snapshot_id",
3886
+ "type": "text",
3887
+ "primaryKey": false,
3888
+ "notNull": false
3889
+ },
3890
+ "build_duration_ms": {
3891
+ "name": "build_duration_ms",
3892
+ "type": "integer",
3893
+ "primaryKey": false,
3894
+ "notNull": false
3895
+ },
3896
+ "size_bytes": {
3897
+ "name": "size_bytes",
3898
+ "type": "bigint",
3899
+ "primaryKey": false,
3900
+ "notNull": false
3901
+ },
3902
+ "generated_at": {
3903
+ "name": "generated_at",
3904
+ "type": "timestamp with time zone",
3905
+ "primaryKey": false,
3906
+ "notNull": false
3907
+ },
3908
+ "build_started_at": {
3909
+ "name": "build_started_at",
3910
+ "type": "timestamp with time zone",
3911
+ "primaryKey": false,
3912
+ "notNull": false
3913
+ },
3914
+ "build_phase": {
3915
+ "name": "build_phase",
3916
+ "type": "text",
3917
+ "primaryKey": false,
3918
+ "notNull": false
3919
+ },
3920
+ "build_sandbox_name": {
3921
+ "name": "build_sandbox_name",
3922
+ "type": "text",
3923
+ "primaryKey": false,
3924
+ "notNull": false
3925
+ },
3926
+ "build_command_id": {
3927
+ "name": "build_command_id",
3928
+ "type": "text",
3929
+ "primaryKey": false,
3930
+ "notNull": false
3931
+ },
3932
+ "build_error": {
3933
+ "name": "build_error",
3934
+ "type": "text",
3935
+ "primaryKey": false,
3936
+ "notNull": false
3937
+ },
3938
+ "created_at": {
3939
+ "name": "created_at",
3940
+ "type": "timestamp with time zone",
3941
+ "primaryKey": false,
3942
+ "notNull": true
3943
+ },
3944
+ "updated_at": {
3945
+ "name": "updated_at",
3946
+ "type": "timestamp with time zone",
3947
+ "primaryKey": false,
3948
+ "notNull": true
3949
+ }
3950
+ },
3951
+ "indexes": {
3952
+ "junior_snapshots_snapshot_id_uidx": {
3953
+ "name": "junior_snapshots_snapshot_id_uidx",
3954
+ "columns": [
3955
+ {
3956
+ "expression": "snapshot_id",
3957
+ "isExpression": false,
3958
+ "asc": true,
3959
+ "nulls": "last"
3960
+ }
3961
+ ],
3962
+ "isUnique": true,
3963
+ "concurrently": false,
3964
+ "method": "btree",
3965
+ "with": {}
3966
+ },
3967
+ "junior_snapshots_workspace_idx": {
3968
+ "name": "junior_snapshots_workspace_idx",
3969
+ "columns": [
3970
+ {
3971
+ "expression": "workspace_id",
3972
+ "isExpression": false,
3973
+ "asc": true,
3974
+ "nulls": "last"
3975
+ }
3976
+ ],
3977
+ "isUnique": false,
3978
+ "concurrently": false,
3979
+ "method": "btree",
3980
+ "with": {}
3981
+ },
3982
+ "junior_snapshots_workspace_profile_status_idx": {
3983
+ "name": "junior_snapshots_workspace_profile_status_idx",
3984
+ "columns": [
3985
+ {
3986
+ "expression": "workspace_id",
3987
+ "isExpression": false,
3988
+ "asc": true,
3989
+ "nulls": "last"
3990
+ },
3991
+ {
3992
+ "expression": "profile_hash",
3993
+ "isExpression": false,
3994
+ "asc": true,
3995
+ "nulls": "last"
3996
+ },
3997
+ {
3998
+ "expression": "status",
3999
+ "isExpression": false,
4000
+ "asc": true,
4001
+ "nulls": "last"
4002
+ }
4003
+ ],
4004
+ "isUnique": false,
4005
+ "concurrently": false,
4006
+ "method": "btree",
4007
+ "with": {}
4008
+ },
4009
+ "junior_snapshots_active_build_uidx": {
4010
+ "name": "junior_snapshots_active_build_uidx",
4011
+ "columns": [
4012
+ {
4013
+ "expression": "workspace_id",
4014
+ "isExpression": false,
4015
+ "asc": true,
4016
+ "nulls": "last"
4017
+ },
4018
+ {
4019
+ "expression": "profile_hash",
4020
+ "isExpression": false,
4021
+ "asc": true,
4022
+ "nulls": "last"
4023
+ }
4024
+ ],
4025
+ "isUnique": true,
4026
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
4027
+ "concurrently": false,
4028
+ "method": "btree",
4029
+ "with": {}
4030
+ },
4031
+ "junior_snapshots_workspace_status_idx": {
4032
+ "name": "junior_snapshots_workspace_status_idx",
4033
+ "columns": [
4034
+ {
4035
+ "expression": "workspace_id",
4036
+ "isExpression": false,
4037
+ "asc": true,
4038
+ "nulls": "last"
4039
+ },
4040
+ {
4041
+ "expression": "status",
4042
+ "isExpression": false,
4043
+ "asc": true,
4044
+ "nulls": "last"
4045
+ }
4046
+ ],
4047
+ "isUnique": false,
4048
+ "concurrently": false,
4049
+ "method": "btree",
4050
+ "with": {}
4051
+ }
4052
+ },
4053
+ "foreignKeys": {
4054
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
4055
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
4056
+ "tableFrom": "junior_snapshots",
4057
+ "tableTo": "junior_workspaces",
4058
+ "columnsFrom": ["workspace_id"],
4059
+ "columnsTo": ["id"],
4060
+ "onDelete": "cascade",
4061
+ "onUpdate": "no action"
4062
+ }
4063
+ },
4064
+ "compositePrimaryKeys": {},
4065
+ "uniqueConstraints": {},
4066
+ "policies": {},
4067
+ "checkConstraints": {
4068
+ "junior_snapshots_status_check": {
4069
+ "name": "junior_snapshots_status_check",
4070
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
4071
+ },
4072
+ "junior_snapshots_build_phase_check": {
4073
+ "name": "junior_snapshots_build_phase_check",
4074
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
4075
+ },
4076
+ "junior_snapshots_ready_fields_check": {
4077
+ "name": "junior_snapshots_ready_fields_check",
4078
+ "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)"
4079
+ },
4080
+ "junior_snapshots_build_fields_check": {
4081
+ "name": "junior_snapshots_build_fields_check",
4082
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
4083
+ },
4084
+ "junior_snapshots_build_duration_check": {
4085
+ "name": "junior_snapshots_build_duration_check",
4086
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
4087
+ },
4088
+ "junior_snapshots_size_bytes_check": {
4089
+ "name": "junior_snapshots_size_bytes_check",
4090
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
4091
+ }
4092
+ },
4093
+ "isRLSEnabled": false
4094
+ },
4095
+ "public.junior_stats": {
4096
+ "name": "junior_stats",
4097
+ "schema": "",
4098
+ "columns": {
4099
+ "date": {
4100
+ "name": "date",
4101
+ "type": "date",
4102
+ "primaryKey": false,
4103
+ "notNull": true
4104
+ },
4105
+ "namespace": {
4106
+ "name": "namespace",
4107
+ "type": "text",
4108
+ "primaryKey": false,
4109
+ "notNull": true
4110
+ },
4111
+ "metric": {
4112
+ "name": "metric",
4113
+ "type": "text",
4114
+ "primaryKey": false,
4115
+ "notNull": true
4116
+ },
4117
+ "name": {
4118
+ "name": "name",
4119
+ "type": "text",
4120
+ "primaryKey": false,
4121
+ "notNull": true
4122
+ },
4123
+ "count": {
4124
+ "name": "count",
4125
+ "type": "integer",
4126
+ "primaryKey": false,
4127
+ "notNull": true,
4128
+ "default": 0
4129
+ }
4130
+ },
4131
+ "indexes": {},
4132
+ "foreignKeys": {},
4133
+ "compositePrimaryKeys": {
4134
+ "junior_stats_date_namespace_metric_name_pk": {
4135
+ "name": "junior_stats_date_namespace_metric_name_pk",
4136
+ "columns": ["date", "namespace", "metric", "name"]
4137
+ }
4138
+ },
4139
+ "uniqueConstraints": {},
4140
+ "policies": {},
4141
+ "checkConstraints": {},
4142
+ "isRLSEnabled": false
4143
+ },
4144
+ "public.junior_users": {
4145
+ "name": "junior_users",
4146
+ "schema": "",
4147
+ "columns": {
4148
+ "id": {
4149
+ "name": "id",
4150
+ "type": "text",
4151
+ "primaryKey": true,
4152
+ "notNull": true
4153
+ },
4154
+ "primary_email": {
4155
+ "name": "primary_email",
4156
+ "type": "text",
4157
+ "primaryKey": false,
4158
+ "notNull": true
4159
+ },
4160
+ "primary_email_normalized": {
4161
+ "name": "primary_email_normalized",
4162
+ "type": "text",
4163
+ "primaryKey": false,
4164
+ "notNull": true
4165
+ },
4166
+ "display_name": {
4167
+ "name": "display_name",
4168
+ "type": "text",
4169
+ "primaryKey": false,
4170
+ "notNull": false
4171
+ },
4172
+ "timezone": {
4173
+ "name": "timezone",
4174
+ "type": "text",
4175
+ "primaryKey": false,
4176
+ "notNull": false
4177
+ },
4178
+ "customization": {
4179
+ "name": "customization",
4180
+ "type": "text",
4181
+ "primaryKey": false,
4182
+ "notNull": false
4183
+ },
4184
+ "notification_schedule": {
4185
+ "name": "notification_schedule",
4186
+ "type": "jsonb",
4187
+ "primaryKey": false,
4188
+ "notNull": false
4189
+ },
4190
+ "is_admin": {
4191
+ "name": "is_admin",
4192
+ "type": "boolean",
4193
+ "primaryKey": false,
4194
+ "notNull": true,
4195
+ "default": false
4196
+ },
4197
+ "auto_archive_default": {
4198
+ "name": "auto_archive_default",
4199
+ "type": "boolean",
4200
+ "primaryKey": false,
4201
+ "notNull": true,
4202
+ "default": false
4203
+ },
4204
+ "auto_archive_grace_hours": {
4205
+ "name": "auto_archive_grace_hours",
4206
+ "type": "integer",
4207
+ "primaryKey": false,
4208
+ "notNull": true,
4209
+ "default": 24
4210
+ },
4211
+ "created_at": {
4212
+ "name": "created_at",
4213
+ "type": "timestamp with time zone",
4214
+ "primaryKey": false,
4215
+ "notNull": true
4216
+ },
4217
+ "updated_at": {
4218
+ "name": "updated_at",
4219
+ "type": "timestamp with time zone",
4220
+ "primaryKey": false,
4221
+ "notNull": true
4222
+ }
4223
+ },
4224
+ "indexes": {
4225
+ "junior_users_primary_email_normalized_uidx": {
4226
+ "name": "junior_users_primary_email_normalized_uidx",
4227
+ "columns": [
4228
+ {
4229
+ "expression": "primary_email_normalized",
4230
+ "isExpression": false,
4231
+ "asc": true,
4232
+ "nulls": "last"
4233
+ }
4234
+ ],
4235
+ "isUnique": true,
4236
+ "concurrently": false,
4237
+ "method": "btree",
4238
+ "with": {}
4239
+ }
4240
+ },
4241
+ "foreignKeys": {},
4242
+ "compositePrimaryKeys": {},
4243
+ "uniqueConstraints": {},
4244
+ "policies": {},
4245
+ "checkConstraints": {},
4246
+ "isRLSEnabled": false
4247
+ },
4248
+ "public.junior_workspace_repos": {
4249
+ "name": "junior_workspace_repos",
4250
+ "schema": "",
4251
+ "columns": {
4252
+ "workspace_id": {
4253
+ "name": "workspace_id",
4254
+ "type": "text",
4255
+ "primaryKey": false,
4256
+ "notNull": true
4257
+ },
4258
+ "provider": {
4259
+ "name": "provider",
4260
+ "type": "text",
4261
+ "primaryKey": false,
4262
+ "notNull": true
4263
+ },
4264
+ "repo": {
4265
+ "name": "repo",
4266
+ "type": "text",
4267
+ "primaryKey": false,
4268
+ "notNull": true
4269
+ }
4270
+ },
4271
+ "indexes": {},
4272
+ "foreignKeys": {
4273
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
4274
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
4275
+ "tableFrom": "junior_workspace_repos",
4276
+ "tableTo": "junior_workspaces",
4277
+ "columnsFrom": ["workspace_id"],
4278
+ "columnsTo": ["id"],
4279
+ "onDelete": "cascade",
4280
+ "onUpdate": "no action"
4281
+ }
4282
+ },
4283
+ "compositePrimaryKeys": {
4284
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
4285
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
4286
+ "columns": ["workspace_id", "provider", "repo"]
4287
+ }
4288
+ },
4289
+ "uniqueConstraints": {},
4290
+ "policies": {},
4291
+ "checkConstraints": {},
4292
+ "isRLSEnabled": false
4293
+ },
4294
+ "public.junior_workspaces": {
4295
+ "name": "junior_workspaces",
4296
+ "schema": "",
4297
+ "columns": {
4298
+ "id": {
4299
+ "name": "id",
4300
+ "type": "text",
4301
+ "primaryKey": true,
4302
+ "notNull": true
4303
+ },
4304
+ "name": {
4305
+ "name": "name",
4306
+ "type": "text",
4307
+ "primaryKey": false,
4308
+ "notNull": true
4309
+ },
4310
+ "setup_script": {
4311
+ "name": "setup_script",
4312
+ "type": "text",
4313
+ "primaryKey": false,
4314
+ "notNull": true,
4315
+ "default": "''"
4316
+ },
4317
+ "vcpus": {
4318
+ "name": "vcpus",
4319
+ "type": "integer",
4320
+ "primaryKey": false,
4321
+ "notNull": false
4322
+ },
4323
+ "created_at": {
4324
+ "name": "created_at",
4325
+ "type": "timestamp with time zone",
4326
+ "primaryKey": false,
4327
+ "notNull": true
4328
+ },
4329
+ "updated_at": {
4330
+ "name": "updated_at",
4331
+ "type": "timestamp with time zone",
4332
+ "primaryKey": false,
4333
+ "notNull": true
4334
+ }
4335
+ },
4336
+ "indexes": {
4337
+ "junior_workspaces_name_idx": {
4338
+ "name": "junior_workspaces_name_idx",
4339
+ "columns": [
4340
+ {
4341
+ "expression": "name",
4342
+ "isExpression": false,
4343
+ "asc": true,
4344
+ "nulls": "last"
4345
+ }
4346
+ ],
4347
+ "isUnique": true,
4348
+ "concurrently": false,
4349
+ "method": "btree",
4350
+ "with": {}
4351
+ }
4352
+ },
4353
+ "foreignKeys": {},
4354
+ "compositePrimaryKeys": {},
4355
+ "uniqueConstraints": {},
4356
+ "policies": {},
4357
+ "checkConstraints": {},
4358
+ "isRLSEnabled": false
4359
+ }
4360
+ },
4361
+ "enums": {},
4362
+ "schemas": {},
4363
+ "sequences": {},
4364
+ "roles": {},
4365
+ "policies": {},
4366
+ "views": {},
4367
+ "_meta": {
4368
+ "columns": {},
4369
+ "schemas": {},
4370
+ "tables": {}
4371
+ }
4372
+ }