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