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