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