@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,4925 @@
1
+ {
2
+ "id": "1880d763-2db8-4b02-931d-e59c0840186a",
3
+ "prevId": "0841b571-f89e-4038-a529-b2c840c32e76",
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_open_idx": {
1584
+ "name": "junior_code_changes_open_idx",
1585
+ "columns": [
1586
+ {
1587
+ "expression": "id",
1588
+ "isExpression": false,
1589
+ "asc": true,
1590
+ "nulls": "last"
1591
+ }
1592
+ ],
1593
+ "isUnique": false,
1594
+ "where": "\"junior_code_changes\".\"state\" = 'open'",
1595
+ "concurrently": false,
1596
+ "method": "btree",
1597
+ "with": {}
1598
+ }
1599
+ },
1600
+ "foreignKeys": {
1601
+ "junior_code_changes_repository_id_junior_code_repositories_id_fk": {
1602
+ "name": "junior_code_changes_repository_id_junior_code_repositories_id_fk",
1603
+ "tableFrom": "junior_code_changes",
1604
+ "tableTo": "junior_code_repositories",
1605
+ "columnsFrom": [
1606
+ "repository_id"
1607
+ ],
1608
+ "columnsTo": [
1609
+ "id"
1610
+ ],
1611
+ "onDelete": "cascade",
1612
+ "onUpdate": "no action"
1613
+ }
1614
+ },
1615
+ "compositePrimaryKeys": {},
1616
+ "uniqueConstraints": {},
1617
+ "policies": {},
1618
+ "checkConstraints": {},
1619
+ "isRLSEnabled": false
1620
+ },
1621
+ "public.junior_code_repositories": {
1622
+ "name": "junior_code_repositories",
1623
+ "schema": "",
1624
+ "columns": {
1625
+ "id": {
1626
+ "name": "id",
1627
+ "type": "uuid",
1628
+ "primaryKey": true,
1629
+ "notNull": true
1630
+ },
1631
+ "name": {
1632
+ "name": "name",
1633
+ "type": "text",
1634
+ "primaryKey": false,
1635
+ "notNull": true
1636
+ },
1637
+ "provider": {
1638
+ "name": "provider",
1639
+ "type": "text",
1640
+ "primaryKey": false,
1641
+ "notNull": true
1642
+ },
1643
+ "provider_id": {
1644
+ "name": "provider_id",
1645
+ "type": "text",
1646
+ "primaryKey": false,
1647
+ "notNull": true
1648
+ },
1649
+ "url": {
1650
+ "name": "url",
1651
+ "type": "text",
1652
+ "primaryKey": false,
1653
+ "notNull": false
1654
+ },
1655
+ "updated_at": {
1656
+ "name": "updated_at",
1657
+ "type": "timestamp with time zone",
1658
+ "primaryKey": false,
1659
+ "notNull": true
1660
+ }
1661
+ },
1662
+ "indexes": {
1663
+ "junior_code_repositories_provider_id_idx": {
1664
+ "name": "junior_code_repositories_provider_id_idx",
1665
+ "columns": [
1666
+ {
1667
+ "expression": "provider",
1668
+ "isExpression": false,
1669
+ "asc": true,
1670
+ "nulls": "last"
1671
+ },
1672
+ {
1673
+ "expression": "provider_id",
1674
+ "isExpression": false,
1675
+ "asc": true,
1676
+ "nulls": "last"
1677
+ }
1678
+ ],
1679
+ "isUnique": true,
1680
+ "concurrently": false,
1681
+ "method": "btree",
1682
+ "with": {}
1683
+ }
1684
+ },
1685
+ "foreignKeys": {},
1686
+ "compositePrimaryKeys": {},
1687
+ "uniqueConstraints": {},
1688
+ "policies": {},
1689
+ "checkConstraints": {},
1690
+ "isRLSEnabled": false
1691
+ },
1692
+ "public.junior_conversation_annotations": {
1693
+ "name": "junior_conversation_annotations",
1694
+ "schema": "",
1695
+ "columns": {
1696
+ "conversation_id": {
1697
+ "name": "conversation_id",
1698
+ "type": "text",
1699
+ "primaryKey": false,
1700
+ "notNull": true
1701
+ },
1702
+ "plugin": {
1703
+ "name": "plugin",
1704
+ "type": "text",
1705
+ "primaryKey": false,
1706
+ "notNull": true
1707
+ },
1708
+ "kind": {
1709
+ "name": "kind",
1710
+ "type": "text",
1711
+ "primaryKey": false,
1712
+ "notNull": true
1713
+ },
1714
+ "key": {
1715
+ "name": "key",
1716
+ "type": "text",
1717
+ "primaryKey": false,
1718
+ "notNull": true
1719
+ },
1720
+ "annotation_json": {
1721
+ "name": "annotation_json",
1722
+ "type": "jsonb",
1723
+ "primaryKey": false,
1724
+ "notNull": true
1725
+ },
1726
+ "created_at": {
1727
+ "name": "created_at",
1728
+ "type": "timestamp with time zone",
1729
+ "primaryKey": false,
1730
+ "notNull": true
1731
+ },
1732
+ "updated_at": {
1733
+ "name": "updated_at",
1734
+ "type": "timestamp with time zone",
1735
+ "primaryKey": false,
1736
+ "notNull": true
1737
+ }
1738
+ },
1739
+ "indexes": {},
1740
+ "foreignKeys": {
1741
+ "junior_conversation_annotations_conversation_id_fk": {
1742
+ "name": "junior_conversation_annotations_conversation_id_fk",
1743
+ "tableFrom": "junior_conversation_annotations",
1744
+ "tableTo": "junior_conversations",
1745
+ "columnsFrom": [
1746
+ "conversation_id"
1747
+ ],
1748
+ "columnsTo": [
1749
+ "conversation_id"
1750
+ ],
1751
+ "onDelete": "cascade",
1752
+ "onUpdate": "no action"
1753
+ }
1754
+ },
1755
+ "compositePrimaryKeys": {
1756
+ "junior_conversation_annotations_pk": {
1757
+ "name": "junior_conversation_annotations_pk",
1758
+ "columns": [
1759
+ "conversation_id",
1760
+ "plugin",
1761
+ "kind",
1762
+ "key"
1763
+ ]
1764
+ }
1765
+ },
1766
+ "uniqueConstraints": {},
1767
+ "policies": {},
1768
+ "checkConstraints": {},
1769
+ "isRLSEnabled": false
1770
+ },
1771
+ "public.junior_conversation_bindings": {
1772
+ "name": "junior_conversation_bindings",
1773
+ "schema": "",
1774
+ "columns": {
1775
+ "conversation_id": {
1776
+ "name": "conversation_id",
1777
+ "type": "text",
1778
+ "primaryKey": false,
1779
+ "notNull": true
1780
+ },
1781
+ "provider": {
1782
+ "name": "provider",
1783
+ "type": "text",
1784
+ "primaryKey": false,
1785
+ "notNull": true
1786
+ },
1787
+ "provider_tenant_id": {
1788
+ "name": "provider_tenant_id",
1789
+ "type": "text",
1790
+ "primaryKey": false,
1791
+ "notNull": true,
1792
+ "default": "''"
1793
+ },
1794
+ "provider_destination_id": {
1795
+ "name": "provider_destination_id",
1796
+ "type": "text",
1797
+ "primaryKey": false,
1798
+ "notNull": true
1799
+ },
1800
+ "provider_conversation_id": {
1801
+ "name": "provider_conversation_id",
1802
+ "type": "text",
1803
+ "primaryKey": false,
1804
+ "notNull": true
1805
+ },
1806
+ "created_at": {
1807
+ "name": "created_at",
1808
+ "type": "timestamp with time zone",
1809
+ "primaryKey": false,
1810
+ "notNull": true
1811
+ }
1812
+ },
1813
+ "indexes": {
1814
+ "junior_conversation_bindings_conversation_idx": {
1815
+ "name": "junior_conversation_bindings_conversation_idx",
1816
+ "columns": [
1817
+ {
1818
+ "expression": "conversation_id",
1819
+ "isExpression": false,
1820
+ "asc": true,
1821
+ "nulls": "last"
1822
+ }
1823
+ ],
1824
+ "isUnique": false,
1825
+ "concurrently": false,
1826
+ "method": "btree",
1827
+ "with": {}
1828
+ }
1829
+ },
1830
+ "foreignKeys": {
1831
+ "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk": {
1832
+ "name": "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk",
1833
+ "tableFrom": "junior_conversation_bindings",
1834
+ "tableTo": "junior_conversations",
1835
+ "columnsFrom": [
1836
+ "conversation_id"
1837
+ ],
1838
+ "columnsTo": [
1839
+ "conversation_id"
1840
+ ],
1841
+ "onDelete": "no action",
1842
+ "onUpdate": "no action"
1843
+ }
1844
+ },
1845
+ "compositePrimaryKeys": {
1846
+ "junior_conversation_bindings_provider_conversation_pk": {
1847
+ "name": "junior_conversation_bindings_provider_conversation_pk",
1848
+ "columns": [
1849
+ "provider",
1850
+ "provider_tenant_id",
1851
+ "provider_destination_id",
1852
+ "provider_conversation_id"
1853
+ ]
1854
+ }
1855
+ },
1856
+ "uniqueConstraints": {},
1857
+ "policies": {},
1858
+ "checkConstraints": {},
1859
+ "isRLSEnabled": false
1860
+ },
1861
+ "public.junior_conversation_briefs": {
1862
+ "name": "junior_conversation_briefs",
1863
+ "schema": "",
1864
+ "columns": {
1865
+ "conversation_id": {
1866
+ "name": "conversation_id",
1867
+ "type": "text",
1868
+ "primaryKey": false,
1869
+ "notNull": true
1870
+ },
1871
+ "version": {
1872
+ "name": "version",
1873
+ "type": "integer",
1874
+ "primaryKey": false,
1875
+ "notNull": true
1876
+ },
1877
+ "turn_id": {
1878
+ "name": "turn_id",
1879
+ "type": "text",
1880
+ "primaryKey": false,
1881
+ "notNull": true
1882
+ },
1883
+ "through_seq": {
1884
+ "name": "through_seq",
1885
+ "type": "integer",
1886
+ "primaryKey": false,
1887
+ "notNull": true
1888
+ },
1889
+ "content": {
1890
+ "name": "content",
1891
+ "type": "jsonb",
1892
+ "primaryKey": false,
1893
+ "notNull": true
1894
+ },
1895
+ "search_text": {
1896
+ "name": "search_text",
1897
+ "type": "text",
1898
+ "primaryKey": false,
1899
+ "notNull": true
1900
+ },
1901
+ "model_id": {
1902
+ "name": "model_id",
1903
+ "type": "text",
1904
+ "primaryKey": false,
1905
+ "notNull": true
1906
+ },
1907
+ "cost_usd": {
1908
+ "name": "cost_usd",
1909
+ "type": "double precision",
1910
+ "primaryKey": false,
1911
+ "notNull": false
1912
+ },
1913
+ "created_at": {
1914
+ "name": "created_at",
1915
+ "type": "timestamp with time zone",
1916
+ "primaryKey": false,
1917
+ "notNull": true,
1918
+ "default": "now()"
1919
+ }
1920
+ },
1921
+ "indexes": {
1922
+ "junior_conversation_briefs_conversation_turn_idx": {
1923
+ "name": "junior_conversation_briefs_conversation_turn_idx",
1924
+ "columns": [
1925
+ {
1926
+ "expression": "conversation_id",
1927
+ "isExpression": false,
1928
+ "asc": true,
1929
+ "nulls": "last"
1930
+ },
1931
+ {
1932
+ "expression": "turn_id",
1933
+ "isExpression": false,
1934
+ "asc": true,
1935
+ "nulls": "last"
1936
+ }
1937
+ ],
1938
+ "isUnique": true,
1939
+ "concurrently": false,
1940
+ "method": "btree",
1941
+ "with": {}
1942
+ },
1943
+ "junior_conversation_briefs_conversation_version_idx": {
1944
+ "name": "junior_conversation_briefs_conversation_version_idx",
1945
+ "columns": [
1946
+ {
1947
+ "expression": "conversation_id",
1948
+ "isExpression": false,
1949
+ "asc": true,
1950
+ "nulls": "last"
1951
+ },
1952
+ {
1953
+ "expression": "version",
1954
+ "isExpression": false,
1955
+ "asc": false,
1956
+ "nulls": "last"
1957
+ }
1958
+ ],
1959
+ "isUnique": false,
1960
+ "concurrently": false,
1961
+ "method": "btree",
1962
+ "with": {}
1963
+ },
1964
+ "junior_conversation_briefs_search_idx": {
1965
+ "name": "junior_conversation_briefs_search_idx",
1966
+ "columns": [
1967
+ {
1968
+ "expression": "to_tsvector('english', \"search_text\")",
1969
+ "asc": true,
1970
+ "isExpression": true,
1971
+ "nulls": "last"
1972
+ }
1973
+ ],
1974
+ "isUnique": false,
1975
+ "concurrently": false,
1976
+ "method": "gin",
1977
+ "with": {}
1978
+ }
1979
+ },
1980
+ "foreignKeys": {
1981
+ "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk": {
1982
+ "name": "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk",
1983
+ "tableFrom": "junior_conversation_briefs",
1984
+ "tableTo": "junior_conversations",
1985
+ "columnsFrom": [
1986
+ "conversation_id"
1987
+ ],
1988
+ "columnsTo": [
1989
+ "conversation_id"
1990
+ ],
1991
+ "onDelete": "cascade",
1992
+ "onUpdate": "no action"
1993
+ }
1994
+ },
1995
+ "compositePrimaryKeys": {
1996
+ "junior_conversation_briefs_conversation_id_version_pk": {
1997
+ "name": "junior_conversation_briefs_conversation_id_version_pk",
1998
+ "columns": [
1999
+ "conversation_id",
2000
+ "version"
2001
+ ]
2002
+ }
2003
+ },
2004
+ "uniqueConstraints": {},
2005
+ "policies": {},
2006
+ "checkConstraints": {},
2007
+ "isRLSEnabled": false
2008
+ },
2009
+ "public.junior_conversation_embeddings": {
2010
+ "name": "junior_conversation_embeddings",
2011
+ "schema": "",
2012
+ "columns": {
2013
+ "conversation_id": {
2014
+ "name": "conversation_id",
2015
+ "type": "text",
2016
+ "primaryKey": true,
2017
+ "notNull": true
2018
+ },
2019
+ "brief_version": {
2020
+ "name": "brief_version",
2021
+ "type": "integer",
2022
+ "primaryKey": false,
2023
+ "notNull": true
2024
+ },
2025
+ "provider": {
2026
+ "name": "provider",
2027
+ "type": "text",
2028
+ "primaryKey": false,
2029
+ "notNull": true
2030
+ },
2031
+ "model": {
2032
+ "name": "model",
2033
+ "type": "text",
2034
+ "primaryKey": false,
2035
+ "notNull": true
2036
+ },
2037
+ "dimensions": {
2038
+ "name": "dimensions",
2039
+ "type": "integer",
2040
+ "primaryKey": false,
2041
+ "notNull": true
2042
+ },
2043
+ "embedding": {
2044
+ "name": "embedding",
2045
+ "type": "vector",
2046
+ "primaryKey": false,
2047
+ "notNull": true
2048
+ },
2049
+ "created_at": {
2050
+ "name": "created_at",
2051
+ "type": "timestamp with time zone",
2052
+ "primaryKey": false,
2053
+ "notNull": true,
2054
+ "default": "now()"
2055
+ }
2056
+ },
2057
+ "indexes": {},
2058
+ "foreignKeys": {
2059
+ "junior_conversation_embeddings_brief_fk": {
2060
+ "name": "junior_conversation_embeddings_brief_fk",
2061
+ "tableFrom": "junior_conversation_embeddings",
2062
+ "tableTo": "junior_conversation_briefs",
2063
+ "columnsFrom": [
2064
+ "conversation_id",
2065
+ "brief_version"
2066
+ ],
2067
+ "columnsTo": [
2068
+ "conversation_id",
2069
+ "version"
2070
+ ],
2071
+ "onDelete": "cascade",
2072
+ "onUpdate": "no action"
2073
+ }
2074
+ },
2075
+ "compositePrimaryKeys": {},
2076
+ "uniqueConstraints": {},
2077
+ "policies": {},
2078
+ "checkConstraints": {
2079
+ "junior_conversation_embeddings_dimensions_check": {
2080
+ "name": "junior_conversation_embeddings_dimensions_check",
2081
+ "value": "vector_dims(\"junior_conversation_embeddings\".\"embedding\") = \"junior_conversation_embeddings\".\"dimensions\""
2082
+ }
2083
+ },
2084
+ "isRLSEnabled": false
2085
+ },
2086
+ "public.junior_conversation_events": {
2087
+ "name": "junior_conversation_events",
2088
+ "schema": "",
2089
+ "columns": {
2090
+ "conversation_id": {
2091
+ "name": "conversation_id",
2092
+ "type": "text",
2093
+ "primaryKey": false,
2094
+ "notNull": true
2095
+ },
2096
+ "seq": {
2097
+ "name": "seq",
2098
+ "type": "integer",
2099
+ "primaryKey": false,
2100
+ "notNull": true
2101
+ },
2102
+ "history_version": {
2103
+ "name": "history_version",
2104
+ "type": "integer",
2105
+ "primaryKey": false,
2106
+ "notNull": true
2107
+ },
2108
+ "schema_version": {
2109
+ "name": "schema_version",
2110
+ "type": "integer",
2111
+ "primaryKey": false,
2112
+ "notNull": true,
2113
+ "default": 1
2114
+ },
2115
+ "idempotency_key": {
2116
+ "name": "idempotency_key",
2117
+ "type": "text",
2118
+ "primaryKey": false,
2119
+ "notNull": false
2120
+ },
2121
+ "type": {
2122
+ "name": "type",
2123
+ "type": "text",
2124
+ "primaryKey": false,
2125
+ "notNull": true
2126
+ },
2127
+ "payload": {
2128
+ "name": "payload",
2129
+ "type": "jsonb",
2130
+ "primaryKey": false,
2131
+ "notNull": true
2132
+ },
2133
+ "actor_identity_id": {
2134
+ "name": "actor_identity_id",
2135
+ "type": "text",
2136
+ "primaryKey": false,
2137
+ "notNull": false
2138
+ },
2139
+ "created_at": {
2140
+ "name": "created_at",
2141
+ "type": "timestamp with time zone",
2142
+ "primaryKey": false,
2143
+ "notNull": true
2144
+ }
2145
+ },
2146
+ "indexes": {
2147
+ "junior_conversation_events_history_version_idx": {
2148
+ "name": "junior_conversation_events_history_version_idx",
2149
+ "columns": [
2150
+ {
2151
+ "expression": "conversation_id",
2152
+ "isExpression": false,
2153
+ "asc": true,
2154
+ "nulls": "last"
2155
+ },
2156
+ {
2157
+ "expression": "history_version",
2158
+ "isExpression": false,
2159
+ "asc": true,
2160
+ "nulls": "last"
2161
+ },
2162
+ {
2163
+ "expression": "seq",
2164
+ "isExpression": false,
2165
+ "asc": true,
2166
+ "nulls": "last"
2167
+ }
2168
+ ],
2169
+ "isUnique": false,
2170
+ "concurrently": false,
2171
+ "method": "btree",
2172
+ "with": {}
2173
+ },
2174
+ "junior_conversation_events_type_idx": {
2175
+ "name": "junior_conversation_events_type_idx",
2176
+ "columns": [
2177
+ {
2178
+ "expression": "conversation_id",
2179
+ "isExpression": false,
2180
+ "asc": true,
2181
+ "nulls": "last"
2182
+ },
2183
+ {
2184
+ "expression": "type",
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_plugin_report_idx": {
2202
+ "name": "junior_conversation_events_plugin_report_idx",
2203
+ "columns": [
2204
+ {
2205
+ "expression": "(\"payload\"->>'namespace')",
2206
+ "asc": true,
2207
+ "isExpression": true,
2208
+ "nulls": "last"
2209
+ },
2210
+ {
2211
+ "expression": "(\"payload\"->>'name')",
2212
+ "asc": true,
2213
+ "isExpression": true,
2214
+ "nulls": "last"
2215
+ },
2216
+ {
2217
+ "expression": "created_at",
2218
+ "isExpression": false,
2219
+ "asc": true,
2220
+ "nulls": "last"
2221
+ }
2222
+ ],
2223
+ "isUnique": false,
2224
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
2225
+ "concurrently": false,
2226
+ "method": "btree",
2227
+ "with": {}
2228
+ },
2229
+ "junior_conversation_events_guardian_review_time_idx": {
2230
+ "name": "junior_conversation_events_guardian_review_time_idx",
2231
+ "columns": [
2232
+ {
2233
+ "expression": "created_at",
2234
+ "isExpression": false,
2235
+ "asc": true,
2236
+ "nulls": "last"
2237
+ }
2238
+ ],
2239
+ "isUnique": false,
2240
+ "where": "\"junior_conversation_events\".\"type\" = 'guardian_action_reviewed'",
2241
+ "concurrently": false,
2242
+ "method": "btree",
2243
+ "with": {}
2244
+ },
2245
+ "junior_conversation_events_plugin_conversation_idx": {
2246
+ "name": "junior_conversation_events_plugin_conversation_idx",
2247
+ "columns": [
2248
+ {
2249
+ "expression": "conversation_id",
2250
+ "isExpression": false,
2251
+ "asc": true,
2252
+ "nulls": "last"
2253
+ },
2254
+ {
2255
+ "expression": "(\"payload\"->>'namespace')",
2256
+ "asc": true,
2257
+ "isExpression": true,
2258
+ "nulls": "last"
2259
+ },
2260
+ {
2261
+ "expression": "(\"payload\"->>'name')",
2262
+ "asc": true,
2263
+ "isExpression": true,
2264
+ "nulls": "last"
2265
+ },
2266
+ {
2267
+ "expression": "seq",
2268
+ "isExpression": false,
2269
+ "asc": true,
2270
+ "nulls": "last"
2271
+ }
2272
+ ],
2273
+ "isUnique": false,
2274
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
2275
+ "concurrently": false,
2276
+ "method": "btree",
2277
+ "with": {}
2278
+ },
2279
+ "junior_conversation_events_actor_identity_idx": {
2280
+ "name": "junior_conversation_events_actor_identity_idx",
2281
+ "columns": [
2282
+ {
2283
+ "expression": "actor_identity_id",
2284
+ "isExpression": false,
2285
+ "asc": true,
2286
+ "nulls": "last"
2287
+ },
2288
+ {
2289
+ "expression": "conversation_id",
2290
+ "isExpression": false,
2291
+ "asc": true,
2292
+ "nulls": "last"
2293
+ },
2294
+ {
2295
+ "expression": "seq",
2296
+ "isExpression": false,
2297
+ "asc": true,
2298
+ "nulls": "last"
2299
+ }
2300
+ ],
2301
+ "isUnique": false,
2302
+ "concurrently": false,
2303
+ "method": "btree",
2304
+ "with": {}
2305
+ },
2306
+ "junior_conversation_events_author_idx": {
2307
+ "name": "junior_conversation_events_author_idx",
2308
+ "columns": [
2309
+ {
2310
+ "expression": "conversation_id",
2311
+ "isExpression": false,
2312
+ "asc": true,
2313
+ "nulls": "last"
2314
+ },
2315
+ {
2316
+ "expression": "actor_identity_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
+ "where": "\"junior_conversation_events\".\"actor_identity_id\" is not null",
2330
+ "concurrently": false,
2331
+ "method": "btree",
2332
+ "with": {}
2333
+ },
2334
+ "junior_conversation_events_message_role_idx": {
2335
+ "name": "junior_conversation_events_message_role_idx",
2336
+ "columns": [
2337
+ {
2338
+ "expression": "conversation_id",
2339
+ "isExpression": false,
2340
+ "asc": true,
2341
+ "nulls": "last"
2342
+ },
2343
+ {
2344
+ "expression": "(\"payload\"->>'role')",
2345
+ "asc": true,
2346
+ "isExpression": true,
2347
+ "nulls": "last"
2348
+ },
2349
+ {
2350
+ "expression": "created_at",
2351
+ "isExpression": false,
2352
+ "asc": true,
2353
+ "nulls": "last"
2354
+ },
2355
+ {
2356
+ "expression": "seq",
2357
+ "isExpression": false,
2358
+ "asc": true,
2359
+ "nulls": "last"
2360
+ }
2361
+ ],
2362
+ "isUnique": false,
2363
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2364
+ "concurrently": false,
2365
+ "method": "btree",
2366
+ "with": {}
2367
+ },
2368
+ "junior_conversation_events_user_message_time_idx": {
2369
+ "name": "junior_conversation_events_user_message_time_idx",
2370
+ "columns": [
2371
+ {
2372
+ "expression": "conversation_id",
2373
+ "isExpression": false,
2374
+ "asc": true,
2375
+ "nulls": "last"
2376
+ },
2377
+ {
2378
+ "expression": "created_at",
2379
+ "isExpression": false,
2380
+ "asc": true,
2381
+ "nulls": "last"
2382
+ },
2383
+ {
2384
+ "expression": "seq",
2385
+ "isExpression": false,
2386
+ "asc": true,
2387
+ "nulls": "last"
2388
+ }
2389
+ ],
2390
+ "isUnique": false,
2391
+ "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')",
2392
+ "concurrently": false,
2393
+ "method": "btree",
2394
+ "with": {}
2395
+ },
2396
+ "junior_conversation_events_message_search_idx": {
2397
+ "name": "junior_conversation_events_message_search_idx",
2398
+ "columns": [
2399
+ {
2400
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
2401
+ "asc": true,
2402
+ "isExpression": true,
2403
+ "nulls": "last"
2404
+ }
2405
+ ],
2406
+ "isUnique": false,
2407
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2408
+ "concurrently": false,
2409
+ "method": "gin",
2410
+ "with": {}
2411
+ },
2412
+ "junior_conversation_events_idempotency_idx": {
2413
+ "name": "junior_conversation_events_idempotency_idx",
2414
+ "columns": [
2415
+ {
2416
+ "expression": "conversation_id",
2417
+ "isExpression": false,
2418
+ "asc": true,
2419
+ "nulls": "last"
2420
+ },
2421
+ {
2422
+ "expression": "idempotency_key",
2423
+ "isExpression": false,
2424
+ "asc": true,
2425
+ "nulls": "last"
2426
+ }
2427
+ ],
2428
+ "isUnique": true,
2429
+ "concurrently": false,
2430
+ "method": "btree",
2431
+ "with": {}
2432
+ }
2433
+ },
2434
+ "foreignKeys": {
2435
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
2436
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
2437
+ "tableFrom": "junior_conversation_events",
2438
+ "tableTo": "junior_identities",
2439
+ "columnsFrom": [
2440
+ "actor_identity_id"
2441
+ ],
2442
+ "columnsTo": [
2443
+ "id"
2444
+ ],
2445
+ "onDelete": "no action",
2446
+ "onUpdate": "no action"
2447
+ },
2448
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
2449
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
2450
+ "tableFrom": "junior_conversation_events",
2451
+ "tableTo": "junior_conversations",
2452
+ "columnsFrom": [
2453
+ "conversation_id"
2454
+ ],
2455
+ "columnsTo": [
2456
+ "conversation_id"
2457
+ ],
2458
+ "onDelete": "no action",
2459
+ "onUpdate": "no action"
2460
+ }
2461
+ },
2462
+ "compositePrimaryKeys": {
2463
+ "junior_conversation_events_conversation_id_seq_pk": {
2464
+ "name": "junior_conversation_events_conversation_id_seq_pk",
2465
+ "columns": [
2466
+ "conversation_id",
2467
+ "seq"
2468
+ ]
2469
+ }
2470
+ },
2471
+ "uniqueConstraints": {},
2472
+ "policies": {},
2473
+ "checkConstraints": {},
2474
+ "isRLSEnabled": false
2475
+ },
2476
+ "public.junior_conversation_metrics": {
2477
+ "name": "junior_conversation_metrics",
2478
+ "schema": "",
2479
+ "columns": {
2480
+ "conversation_id": {
2481
+ "name": "conversation_id",
2482
+ "type": "text",
2483
+ "primaryKey": false,
2484
+ "notNull": true
2485
+ },
2486
+ "run_id": {
2487
+ "name": "run_id",
2488
+ "type": "text",
2489
+ "primaryKey": false,
2490
+ "notNull": true
2491
+ },
2492
+ "metric": {
2493
+ "name": "metric",
2494
+ "type": "text",
2495
+ "primaryKey": false,
2496
+ "notNull": true
2497
+ },
2498
+ "actor_identity_id": {
2499
+ "name": "actor_identity_id",
2500
+ "type": "text",
2501
+ "primaryKey": false,
2502
+ "notNull": false
2503
+ },
2504
+ "value": {
2505
+ "name": "value",
2506
+ "type": "double precision",
2507
+ "primaryKey": false,
2508
+ "notNull": true
2509
+ },
2510
+ "occurred_at": {
2511
+ "name": "occurred_at",
2512
+ "type": "timestamp with time zone",
2513
+ "primaryKey": false,
2514
+ "notNull": true
2515
+ },
2516
+ "updated_at": {
2517
+ "name": "updated_at",
2518
+ "type": "timestamp with time zone",
2519
+ "primaryKey": false,
2520
+ "notNull": true
2521
+ }
2522
+ },
2523
+ "indexes": {
2524
+ "junior_conversation_metrics_actor_identity_occurred_at_idx": {
2525
+ "name": "junior_conversation_metrics_actor_identity_occurred_at_idx",
2526
+ "columns": [
2527
+ {
2528
+ "expression": "actor_identity_id",
2529
+ "isExpression": false,
2530
+ "asc": true,
2531
+ "nulls": "last"
2532
+ },
2533
+ {
2534
+ "expression": "occurred_at",
2535
+ "isExpression": false,
2536
+ "asc": true,
2537
+ "nulls": "last"
2538
+ }
2539
+ ],
2540
+ "isUnique": false,
2541
+ "concurrently": false,
2542
+ "method": "btree",
2543
+ "with": {}
2544
+ },
2545
+ "junior_conversation_metrics_occurred_at_metric_idx": {
2546
+ "name": "junior_conversation_metrics_occurred_at_metric_idx",
2547
+ "columns": [
2548
+ {
2549
+ "expression": "occurred_at",
2550
+ "isExpression": false,
2551
+ "asc": true,
2552
+ "nulls": "last"
2553
+ },
2554
+ {
2555
+ "expression": "metric",
2556
+ "isExpression": false,
2557
+ "asc": true,
2558
+ "nulls": "last"
2559
+ }
2560
+ ],
2561
+ "isUnique": false,
2562
+ "concurrently": false,
2563
+ "method": "btree",
2564
+ "with": {}
2565
+ }
2566
+ },
2567
+ "foreignKeys": {
2568
+ "junior_conversation_metrics_actor_identity_id_junior_identities_id_fk": {
2569
+ "name": "junior_conversation_metrics_actor_identity_id_junior_identities_id_fk",
2570
+ "tableFrom": "junior_conversation_metrics",
2571
+ "tableTo": "junior_identities",
2572
+ "columnsFrom": [
2573
+ "actor_identity_id"
2574
+ ],
2575
+ "columnsTo": [
2576
+ "id"
2577
+ ],
2578
+ "onDelete": "no action",
2579
+ "onUpdate": "no action"
2580
+ },
2581
+ "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk": {
2582
+ "name": "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
2583
+ "tableFrom": "junior_conversation_metrics",
2584
+ "tableTo": "junior_conversations",
2585
+ "columnsFrom": [
2586
+ "conversation_id"
2587
+ ],
2588
+ "columnsTo": [
2589
+ "conversation_id"
2590
+ ],
2591
+ "onDelete": "no action",
2592
+ "onUpdate": "no action"
2593
+ }
2594
+ },
2595
+ "compositePrimaryKeys": {
2596
+ "junior_conversation_metrics_conversation_id_run_id_metric_pk": {
2597
+ "name": "junior_conversation_metrics_conversation_id_run_id_metric_pk",
2598
+ "columns": [
2599
+ "conversation_id",
2600
+ "run_id",
2601
+ "metric"
2602
+ ]
2603
+ }
2604
+ },
2605
+ "uniqueConstraints": {},
2606
+ "policies": {},
2607
+ "checkConstraints": {},
2608
+ "isRLSEnabled": false
2609
+ },
2610
+ "public.junior_conversation_participants": {
2611
+ "name": "junior_conversation_participants",
2612
+ "schema": "",
2613
+ "columns": {
2614
+ "user_id": {
2615
+ "name": "user_id",
2616
+ "type": "text",
2617
+ "primaryKey": false,
2618
+ "notNull": true
2619
+ },
2620
+ "root_conversation_id": {
2621
+ "name": "root_conversation_id",
2622
+ "type": "text",
2623
+ "primaryKey": false,
2624
+ "notNull": true
2625
+ },
2626
+ "last_message_at": {
2627
+ "name": "last_message_at",
2628
+ "type": "timestamp with time zone",
2629
+ "primaryKey": false,
2630
+ "notNull": true
2631
+ },
2632
+ "archived_at": {
2633
+ "name": "archived_at",
2634
+ "type": "timestamp with time zone",
2635
+ "primaryKey": false,
2636
+ "notNull": false
2637
+ },
2638
+ "pinned_at": {
2639
+ "name": "pinned_at",
2640
+ "type": "timestamp with time zone",
2641
+ "primaryKey": false,
2642
+ "notNull": false
2643
+ },
2644
+ "pin_position": {
2645
+ "name": "pin_position",
2646
+ "type": "integer",
2647
+ "primaryKey": false,
2648
+ "notNull": false
2649
+ },
2650
+ "auto_archive": {
2651
+ "name": "auto_archive",
2652
+ "type": "boolean",
2653
+ "primaryKey": false,
2654
+ "notNull": false
2655
+ },
2656
+ "unsubscribed_at": {
2657
+ "name": "unsubscribed_at",
2658
+ "type": "timestamp with time zone",
2659
+ "primaryKey": false,
2660
+ "notNull": false
2661
+ }
2662
+ },
2663
+ "indexes": {
2664
+ "junior_conversation_participants_user_activity_idx": {
2665
+ "name": "junior_conversation_participants_user_activity_idx",
2666
+ "columns": [
2667
+ {
2668
+ "expression": "user_id",
2669
+ "isExpression": false,
2670
+ "asc": true,
2671
+ "nulls": "last"
2672
+ },
2673
+ {
2674
+ "expression": "last_message_at",
2675
+ "isExpression": false,
2676
+ "asc": false,
2677
+ "nulls": "last"
2678
+ }
2679
+ ],
2680
+ "isUnique": false,
2681
+ "concurrently": false,
2682
+ "method": "btree",
2683
+ "with": {}
2684
+ },
2685
+ "junior_conversation_participants_root_idx": {
2686
+ "name": "junior_conversation_participants_root_idx",
2687
+ "columns": [
2688
+ {
2689
+ "expression": "root_conversation_id",
2690
+ "isExpression": false,
2691
+ "asc": true,
2692
+ "nulls": "last"
2693
+ }
2694
+ ],
2695
+ "isUnique": false,
2696
+ "concurrently": false,
2697
+ "method": "btree",
2698
+ "with": {}
2699
+ },
2700
+ "junior_conversation_participants_auto_archive_idx": {
2701
+ "name": "junior_conversation_participants_auto_archive_idx",
2702
+ "columns": [
2703
+ {
2704
+ "expression": "user_id",
2705
+ "isExpression": false,
2706
+ "asc": true,
2707
+ "nulls": "last"
2708
+ }
2709
+ ],
2710
+ "isUnique": false,
2711
+ "where": "\"junior_conversation_participants\".\"auto_archive\"",
2712
+ "concurrently": false,
2713
+ "method": "btree",
2714
+ "with": {}
2715
+ },
2716
+ "junior_conversation_participants_unsubscribed_idx": {
2717
+ "name": "junior_conversation_participants_unsubscribed_idx",
2718
+ "columns": [
2719
+ {
2720
+ "expression": "user_id",
2721
+ "isExpression": false,
2722
+ "asc": true,
2723
+ "nulls": "last"
2724
+ },
2725
+ {
2726
+ "expression": "root_conversation_id",
2727
+ "isExpression": false,
2728
+ "asc": true,
2729
+ "nulls": "last"
2730
+ }
2731
+ ],
2732
+ "isUnique": false,
2733
+ "where": "\"junior_conversation_participants\".\"unsubscribed_at\" is not null",
2734
+ "concurrently": false,
2735
+ "method": "btree",
2736
+ "with": {}
2737
+ }
2738
+ },
2739
+ "foreignKeys": {
2740
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
2741
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
2742
+ "tableFrom": "junior_conversation_participants",
2743
+ "tableTo": "junior_users",
2744
+ "columnsFrom": [
2745
+ "user_id"
2746
+ ],
2747
+ "columnsTo": [
2748
+ "id"
2749
+ ],
2750
+ "onDelete": "no action",
2751
+ "onUpdate": "no action"
2752
+ },
2753
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
2754
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
2755
+ "tableFrom": "junior_conversation_participants",
2756
+ "tableTo": "junior_conversations",
2757
+ "columnsFrom": [
2758
+ "root_conversation_id"
2759
+ ],
2760
+ "columnsTo": [
2761
+ "conversation_id"
2762
+ ],
2763
+ "onDelete": "no action",
2764
+ "onUpdate": "no action"
2765
+ }
2766
+ },
2767
+ "compositePrimaryKeys": {
2768
+ "junior_conversation_participants_user_root_pk": {
2769
+ "name": "junior_conversation_participants_user_root_pk",
2770
+ "columns": [
2771
+ "user_id",
2772
+ "root_conversation_id"
2773
+ ]
2774
+ }
2775
+ },
2776
+ "uniqueConstraints": {},
2777
+ "policies": {},
2778
+ "checkConstraints": {},
2779
+ "isRLSEnabled": false
2780
+ },
2781
+ "public.junior_conversation_read_positions": {
2782
+ "name": "junior_conversation_read_positions",
2783
+ "schema": "",
2784
+ "columns": {
2785
+ "user_id": {
2786
+ "name": "user_id",
2787
+ "type": "text",
2788
+ "primaryKey": false,
2789
+ "notNull": true
2790
+ },
2791
+ "conversation_id": {
2792
+ "name": "conversation_id",
2793
+ "type": "text",
2794
+ "primaryKey": false,
2795
+ "notNull": true
2796
+ },
2797
+ "last_read_seq": {
2798
+ "name": "last_read_seq",
2799
+ "type": "integer",
2800
+ "primaryKey": false,
2801
+ "notNull": true
2802
+ },
2803
+ "updated_at": {
2804
+ "name": "updated_at",
2805
+ "type": "timestamp with time zone",
2806
+ "primaryKey": false,
2807
+ "notNull": true
2808
+ }
2809
+ },
2810
+ "indexes": {},
2811
+ "foreignKeys": {
2812
+ "junior_conversation_read_positions_user_id_junior_users_id_fk": {
2813
+ "name": "junior_conversation_read_positions_user_id_junior_users_id_fk",
2814
+ "tableFrom": "junior_conversation_read_positions",
2815
+ "tableTo": "junior_users",
2816
+ "columnsFrom": [
2817
+ "user_id"
2818
+ ],
2819
+ "columnsTo": [
2820
+ "id"
2821
+ ],
2822
+ "onDelete": "no action",
2823
+ "onUpdate": "no action"
2824
+ },
2825
+ "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk": {
2826
+ "name": "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk",
2827
+ "tableFrom": "junior_conversation_read_positions",
2828
+ "tableTo": "junior_conversations",
2829
+ "columnsFrom": [
2830
+ "conversation_id"
2831
+ ],
2832
+ "columnsTo": [
2833
+ "conversation_id"
2834
+ ],
2835
+ "onDelete": "no action",
2836
+ "onUpdate": "no action"
2837
+ }
2838
+ },
2839
+ "compositePrimaryKeys": {
2840
+ "junior_conversation_read_positions_user_conversation_pk": {
2841
+ "name": "junior_conversation_read_positions_user_conversation_pk",
2842
+ "columns": [
2843
+ "user_id",
2844
+ "conversation_id"
2845
+ ]
2846
+ }
2847
+ },
2848
+ "uniqueConstraints": {},
2849
+ "policies": {},
2850
+ "checkConstraints": {},
2851
+ "isRLSEnabled": false
2852
+ },
2853
+ "public.junior_conversations": {
2854
+ "name": "junior_conversations",
2855
+ "schema": "",
2856
+ "columns": {
2857
+ "conversation_id": {
2858
+ "name": "conversation_id",
2859
+ "type": "text",
2860
+ "primaryKey": true,
2861
+ "notNull": true
2862
+ },
2863
+ "schema_version": {
2864
+ "name": "schema_version",
2865
+ "type": "integer",
2866
+ "primaryKey": false,
2867
+ "notNull": true,
2868
+ "default": 1
2869
+ },
2870
+ "source": {
2871
+ "name": "source",
2872
+ "type": "text",
2873
+ "primaryKey": false,
2874
+ "notNull": false
2875
+ },
2876
+ "source_json": {
2877
+ "name": "source_json",
2878
+ "type": "jsonb",
2879
+ "primaryKey": false,
2880
+ "notNull": false
2881
+ },
2882
+ "location_json": {
2883
+ "name": "location_json",
2884
+ "type": "jsonb",
2885
+ "primaryKey": false,
2886
+ "notNull": false
2887
+ },
2888
+ "destination_id": {
2889
+ "name": "destination_id",
2890
+ "type": "text",
2891
+ "primaryKey": false,
2892
+ "notNull": false
2893
+ },
2894
+ "destination_json": {
2895
+ "name": "destination_json",
2896
+ "type": "jsonb",
2897
+ "primaryKey": false,
2898
+ "notNull": false
2899
+ },
2900
+ "actor_identity_id": {
2901
+ "name": "actor_identity_id",
2902
+ "type": "text",
2903
+ "primaryKey": false,
2904
+ "notNull": false
2905
+ },
2906
+ "creator_identity_id": {
2907
+ "name": "creator_identity_id",
2908
+ "type": "text",
2909
+ "primaryKey": false,
2910
+ "notNull": false
2911
+ },
2912
+ "credential_subject_identity_id": {
2913
+ "name": "credential_subject_identity_id",
2914
+ "type": "text",
2915
+ "primaryKey": false,
2916
+ "notNull": false
2917
+ },
2918
+ "actor_json": {
2919
+ "name": "actor_json",
2920
+ "type": "jsonb",
2921
+ "primaryKey": false,
2922
+ "notNull": false
2923
+ },
2924
+ "channel_name": {
2925
+ "name": "channel_name",
2926
+ "type": "text",
2927
+ "primaryKey": false,
2928
+ "notNull": false
2929
+ },
2930
+ "title": {
2931
+ "name": "title",
2932
+ "type": "text",
2933
+ "primaryKey": false,
2934
+ "notNull": false
2935
+ },
2936
+ "created_at": {
2937
+ "name": "created_at",
2938
+ "type": "timestamp with time zone",
2939
+ "primaryKey": false,
2940
+ "notNull": true
2941
+ },
2942
+ "last_activity_at": {
2943
+ "name": "last_activity_at",
2944
+ "type": "timestamp with time zone",
2945
+ "primaryKey": false,
2946
+ "notNull": true
2947
+ },
2948
+ "last_message_at": {
2949
+ "name": "last_message_at",
2950
+ "type": "timestamp with time zone",
2951
+ "primaryKey": false,
2952
+ "notNull": false
2953
+ },
2954
+ "updated_at": {
2955
+ "name": "updated_at",
2956
+ "type": "timestamp with time zone",
2957
+ "primaryKey": false,
2958
+ "notNull": true
2959
+ },
2960
+ "execution_updated_at": {
2961
+ "name": "execution_updated_at",
2962
+ "type": "timestamp with time zone",
2963
+ "primaryKey": false,
2964
+ "notNull": false
2965
+ },
2966
+ "execution_status": {
2967
+ "name": "execution_status",
2968
+ "type": "text",
2969
+ "primaryKey": false,
2970
+ "notNull": true
2971
+ },
2972
+ "run_id": {
2973
+ "name": "run_id",
2974
+ "type": "text",
2975
+ "primaryKey": false,
2976
+ "notNull": false
2977
+ },
2978
+ "last_checkpoint_at": {
2979
+ "name": "last_checkpoint_at",
2980
+ "type": "timestamp with time zone",
2981
+ "primaryKey": false,
2982
+ "notNull": false
2983
+ },
2984
+ "last_enqueued_at": {
2985
+ "name": "last_enqueued_at",
2986
+ "type": "timestamp with time zone",
2987
+ "primaryKey": false,
2988
+ "notNull": false
2989
+ },
2990
+ "parent_conversation_id": {
2991
+ "name": "parent_conversation_id",
2992
+ "type": "text",
2993
+ "primaryKey": false,
2994
+ "notNull": false
2995
+ },
2996
+ "kind": {
2997
+ "name": "kind",
2998
+ "type": "text",
2999
+ "primaryKey": false,
3000
+ "notNull": false
3001
+ },
3002
+ "agent_config_json": {
3003
+ "name": "agent_config_json",
3004
+ "type": "jsonb",
3005
+ "primaryKey": false,
3006
+ "notNull": false
3007
+ },
3008
+ "archived_at": {
3009
+ "name": "archived_at",
3010
+ "type": "timestamp with time zone",
3011
+ "primaryKey": false,
3012
+ "notNull": false
3013
+ },
3014
+ "child_archived_at": {
3015
+ "name": "child_archived_at",
3016
+ "type": "timestamp with time zone",
3017
+ "primaryKey": false,
3018
+ "notNull": false
3019
+ },
3020
+ "forked_from_conversation_id": {
3021
+ "name": "forked_from_conversation_id",
3022
+ "type": "text",
3023
+ "primaryKey": false,
3024
+ "notNull": false
3025
+ },
3026
+ "quick_question_at": {
3027
+ "name": "quick_question_at",
3028
+ "type": "timestamp with time zone",
3029
+ "primaryKey": false,
3030
+ "notNull": false
3031
+ },
3032
+ "root_conversation_id": {
3033
+ "name": "root_conversation_id",
3034
+ "type": "text",
3035
+ "primaryKey": false,
3036
+ "notNull": false
3037
+ },
3038
+ "transcript_purged_at": {
3039
+ "name": "transcript_purged_at",
3040
+ "type": "timestamp with time zone",
3041
+ "primaryKey": false,
3042
+ "notNull": false
3043
+ },
3044
+ "stopped_at": {
3045
+ "name": "stopped_at",
3046
+ "type": "timestamp with time zone",
3047
+ "primaryKey": false,
3048
+ "notNull": false
3049
+ },
3050
+ "delivery_paused_at": {
3051
+ "name": "delivery_paused_at",
3052
+ "type": "timestamp with time zone",
3053
+ "primaryKey": false,
3054
+ "notNull": false
3055
+ },
3056
+ "duration_ms": {
3057
+ "name": "duration_ms",
3058
+ "type": "integer",
3059
+ "primaryKey": false,
3060
+ "notNull": true,
3061
+ "default": 0
3062
+ },
3063
+ "usage_json": {
3064
+ "name": "usage_json",
3065
+ "type": "jsonb",
3066
+ "primaryKey": false,
3067
+ "notNull": false
3068
+ },
3069
+ "execution_duration_ms": {
3070
+ "name": "execution_duration_ms",
3071
+ "type": "integer",
3072
+ "primaryKey": false,
3073
+ "notNull": true,
3074
+ "default": 0
3075
+ },
3076
+ "execution_usage_json": {
3077
+ "name": "execution_usage_json",
3078
+ "type": "jsonb",
3079
+ "primaryKey": false,
3080
+ "notNull": false
3081
+ },
3082
+ "metric_run_id": {
3083
+ "name": "metric_run_id",
3084
+ "type": "text",
3085
+ "primaryKey": false,
3086
+ "notNull": false
3087
+ },
3088
+ "detail_version": {
3089
+ "name": "detail_version",
3090
+ "type": "integer",
3091
+ "primaryKey": false,
3092
+ "notNull": true,
3093
+ "default": 0
3094
+ }
3095
+ },
3096
+ "indexes": {
3097
+ "junior_conversations_last_activity_idx": {
3098
+ "name": "junior_conversations_last_activity_idx",
3099
+ "columns": [
3100
+ {
3101
+ "expression": "last_activity_at",
3102
+ "isExpression": false,
3103
+ "asc": false,
3104
+ "nulls": "last"
3105
+ },
3106
+ {
3107
+ "expression": "conversation_id",
3108
+ "isExpression": false,
3109
+ "asc": true,
3110
+ "nulls": "last"
3111
+ }
3112
+ ],
3113
+ "isUnique": false,
3114
+ "concurrently": false,
3115
+ "method": "btree",
3116
+ "with": {}
3117
+ },
3118
+ "junior_conversations_active_idx": {
3119
+ "name": "junior_conversations_active_idx",
3120
+ "columns": [
3121
+ {
3122
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
3123
+ "asc": true,
3124
+ "isExpression": true,
3125
+ "nulls": "last"
3126
+ },
3127
+ {
3128
+ "expression": "conversation_id",
3129
+ "isExpression": false,
3130
+ "asc": true,
3131
+ "nulls": "last"
3132
+ }
3133
+ ],
3134
+ "isUnique": false,
3135
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
3136
+ "concurrently": false,
3137
+ "method": "btree",
3138
+ "with": {}
3139
+ },
3140
+ "junior_conversations_destination_activity_idx": {
3141
+ "name": "junior_conversations_destination_activity_idx",
3142
+ "columns": [
3143
+ {
3144
+ "expression": "destination_id",
3145
+ "isExpression": false,
3146
+ "asc": true,
3147
+ "nulls": "last"
3148
+ },
3149
+ {
3150
+ "expression": "last_activity_at",
3151
+ "isExpression": false,
3152
+ "asc": false,
3153
+ "nulls": "last"
3154
+ }
3155
+ ],
3156
+ "isUnique": false,
3157
+ "concurrently": false,
3158
+ "method": "btree",
3159
+ "with": {}
3160
+ },
3161
+ "junior_conversations_actor_activity_idx": {
3162
+ "name": "junior_conversations_actor_activity_idx",
3163
+ "columns": [
3164
+ {
3165
+ "expression": "actor_identity_id",
3166
+ "isExpression": false,
3167
+ "asc": true,
3168
+ "nulls": "last"
3169
+ },
3170
+ {
3171
+ "expression": "last_activity_at",
3172
+ "isExpression": false,
3173
+ "asc": false,
3174
+ "nulls": "last"
3175
+ }
3176
+ ],
3177
+ "isUnique": false,
3178
+ "concurrently": false,
3179
+ "method": "btree",
3180
+ "with": {}
3181
+ },
3182
+ "junior_conversations_parent_idx": {
3183
+ "name": "junior_conversations_parent_idx",
3184
+ "columns": [
3185
+ {
3186
+ "expression": "parent_conversation_id",
3187
+ "isExpression": false,
3188
+ "asc": true,
3189
+ "nulls": "last"
3190
+ }
3191
+ ],
3192
+ "isUnique": false,
3193
+ "concurrently": false,
3194
+ "method": "btree",
3195
+ "with": {}
3196
+ },
3197
+ "junior_conversations_forked_from_idx": {
3198
+ "name": "junior_conversations_forked_from_idx",
3199
+ "columns": [
3200
+ {
3201
+ "expression": "forked_from_conversation_id",
3202
+ "isExpression": false,
3203
+ "asc": true,
3204
+ "nulls": "last"
3205
+ }
3206
+ ],
3207
+ "isUnique": false,
3208
+ "concurrently": false,
3209
+ "method": "btree",
3210
+ "with": {}
3211
+ },
3212
+ "junior_conversations_root_idx": {
3213
+ "name": "junior_conversations_root_idx",
3214
+ "columns": [
3215
+ {
3216
+ "expression": "root_conversation_id",
3217
+ "isExpression": false,
3218
+ "asc": true,
3219
+ "nulls": "last"
3220
+ }
3221
+ ],
3222
+ "isUnique": false,
3223
+ "concurrently": false,
3224
+ "method": "btree",
3225
+ "with": {}
3226
+ }
3227
+ },
3228
+ "foreignKeys": {
3229
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
3230
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
3231
+ "tableFrom": "junior_conversations",
3232
+ "tableTo": "junior_destinations",
3233
+ "columnsFrom": [
3234
+ "destination_id"
3235
+ ],
3236
+ "columnsTo": [
3237
+ "id"
3238
+ ],
3239
+ "onDelete": "no action",
3240
+ "onUpdate": "no action"
3241
+ },
3242
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
3243
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
3244
+ "tableFrom": "junior_conversations",
3245
+ "tableTo": "junior_identities",
3246
+ "columnsFrom": [
3247
+ "actor_identity_id"
3248
+ ],
3249
+ "columnsTo": [
3250
+ "id"
3251
+ ],
3252
+ "onDelete": "no action",
3253
+ "onUpdate": "no action"
3254
+ },
3255
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
3256
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
3257
+ "tableFrom": "junior_conversations",
3258
+ "tableTo": "junior_identities",
3259
+ "columnsFrom": [
3260
+ "creator_identity_id"
3261
+ ],
3262
+ "columnsTo": [
3263
+ "id"
3264
+ ],
3265
+ "onDelete": "no action",
3266
+ "onUpdate": "no action"
3267
+ },
3268
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
3269
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
3270
+ "tableFrom": "junior_conversations",
3271
+ "tableTo": "junior_identities",
3272
+ "columnsFrom": [
3273
+ "credential_subject_identity_id"
3274
+ ],
3275
+ "columnsTo": [
3276
+ "id"
3277
+ ],
3278
+ "onDelete": "no action",
3279
+ "onUpdate": "no action"
3280
+ },
3281
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
3282
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
3283
+ "tableFrom": "junior_conversations",
3284
+ "tableTo": "junior_conversations",
3285
+ "columnsFrom": [
3286
+ "parent_conversation_id"
3287
+ ],
3288
+ "columnsTo": [
3289
+ "conversation_id"
3290
+ ],
3291
+ "onDelete": "no action",
3292
+ "onUpdate": "no action"
3293
+ },
3294
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
3295
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
3296
+ "tableFrom": "junior_conversations",
3297
+ "tableTo": "junior_conversations",
3298
+ "columnsFrom": [
3299
+ "forked_from_conversation_id"
3300
+ ],
3301
+ "columnsTo": [
3302
+ "conversation_id"
3303
+ ],
3304
+ "onDelete": "set null",
3305
+ "onUpdate": "no action"
3306
+ },
3307
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
3308
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
3309
+ "tableFrom": "junior_conversations",
3310
+ "tableTo": "junior_conversations",
3311
+ "columnsFrom": [
3312
+ "root_conversation_id"
3313
+ ],
3314
+ "columnsTo": [
3315
+ "conversation_id"
3316
+ ],
3317
+ "onDelete": "no action",
3318
+ "onUpdate": "no action"
3319
+ }
3320
+ },
3321
+ "compositePrimaryKeys": {},
3322
+ "uniqueConstraints": {},
3323
+ "policies": {},
3324
+ "checkConstraints": {
3325
+ "junior_conversations_kind_check": {
3326
+ "name": "junior_conversations_kind_check",
3327
+ "value": "\"junior_conversations\".\"kind\" in ('root', 'automation', 'thread', 'task')"
3328
+ },
3329
+ "junior_conversations_kind_parent_check": {
3330
+ "name": "junior_conversations_kind_parent_check",
3331
+ "value": "\"junior_conversations\".\"kind\" is null or ((\"junior_conversations\".\"kind\" in ('root', 'automation')) = (\"junior_conversations\".\"parent_conversation_id\" is null))"
3332
+ }
3333
+ },
3334
+ "isRLSEnabled": false
3335
+ },
3336
+ "public.junior_destinations": {
3337
+ "name": "junior_destinations",
3338
+ "schema": "",
3339
+ "columns": {
3340
+ "id": {
3341
+ "name": "id",
3342
+ "type": "text",
3343
+ "primaryKey": true,
3344
+ "notNull": true
3345
+ },
3346
+ "provider": {
3347
+ "name": "provider",
3348
+ "type": "text",
3349
+ "primaryKey": false,
3350
+ "notNull": true
3351
+ },
3352
+ "provider_tenant_id": {
3353
+ "name": "provider_tenant_id",
3354
+ "type": "text",
3355
+ "primaryKey": false,
3356
+ "notNull": true,
3357
+ "default": "''"
3358
+ },
3359
+ "provider_destination_id": {
3360
+ "name": "provider_destination_id",
3361
+ "type": "text",
3362
+ "primaryKey": false,
3363
+ "notNull": true
3364
+ },
3365
+ "kind": {
3366
+ "name": "kind",
3367
+ "type": "text",
3368
+ "primaryKey": false,
3369
+ "notNull": true
3370
+ },
3371
+ "parent_destination_id": {
3372
+ "name": "parent_destination_id",
3373
+ "type": "text",
3374
+ "primaryKey": false,
3375
+ "notNull": false
3376
+ },
3377
+ "display_name": {
3378
+ "name": "display_name",
3379
+ "type": "text",
3380
+ "primaryKey": false,
3381
+ "notNull": false
3382
+ },
3383
+ "visibility": {
3384
+ "name": "visibility",
3385
+ "type": "text",
3386
+ "primaryKey": false,
3387
+ "notNull": true,
3388
+ "default": "'unknown'"
3389
+ },
3390
+ "metadata_json": {
3391
+ "name": "metadata_json",
3392
+ "type": "jsonb",
3393
+ "primaryKey": false,
3394
+ "notNull": false
3395
+ },
3396
+ "created_at": {
3397
+ "name": "created_at",
3398
+ "type": "timestamp with time zone",
3399
+ "primaryKey": false,
3400
+ "notNull": true
3401
+ },
3402
+ "updated_at": {
3403
+ "name": "updated_at",
3404
+ "type": "timestamp with time zone",
3405
+ "primaryKey": false,
3406
+ "notNull": true
3407
+ }
3408
+ },
3409
+ "indexes": {
3410
+ "junior_destinations_provider_destination_uidx": {
3411
+ "name": "junior_destinations_provider_destination_uidx",
3412
+ "columns": [
3413
+ {
3414
+ "expression": "provider",
3415
+ "isExpression": false,
3416
+ "asc": true,
3417
+ "nulls": "last"
3418
+ },
3419
+ {
3420
+ "expression": "provider_tenant_id",
3421
+ "isExpression": false,
3422
+ "asc": true,
3423
+ "nulls": "last"
3424
+ },
3425
+ {
3426
+ "expression": "provider_destination_id",
3427
+ "isExpression": false,
3428
+ "asc": true,
3429
+ "nulls": "last"
3430
+ }
3431
+ ],
3432
+ "isUnique": true,
3433
+ "concurrently": false,
3434
+ "method": "btree",
3435
+ "with": {}
3436
+ },
3437
+ "junior_destinations_provider_kind_idx": {
3438
+ "name": "junior_destinations_provider_kind_idx",
3439
+ "columns": [
3440
+ {
3441
+ "expression": "provider",
3442
+ "isExpression": false,
3443
+ "asc": true,
3444
+ "nulls": "last"
3445
+ },
3446
+ {
3447
+ "expression": "kind",
3448
+ "isExpression": false,
3449
+ "asc": true,
3450
+ "nulls": "last"
3451
+ }
3452
+ ],
3453
+ "isUnique": false,
3454
+ "concurrently": false,
3455
+ "method": "btree",
3456
+ "with": {}
3457
+ }
3458
+ },
3459
+ "foreignKeys": {},
3460
+ "compositePrimaryKeys": {},
3461
+ "uniqueConstraints": {},
3462
+ "policies": {},
3463
+ "checkConstraints": {},
3464
+ "isRLSEnabled": false
3465
+ },
3466
+ "public.junior_identities": {
3467
+ "name": "junior_identities",
3468
+ "schema": "",
3469
+ "columns": {
3470
+ "id": {
3471
+ "name": "id",
3472
+ "type": "text",
3473
+ "primaryKey": true,
3474
+ "notNull": true
3475
+ },
3476
+ "kind": {
3477
+ "name": "kind",
3478
+ "type": "text",
3479
+ "primaryKey": false,
3480
+ "notNull": true
3481
+ },
3482
+ "provider": {
3483
+ "name": "provider",
3484
+ "type": "text",
3485
+ "primaryKey": false,
3486
+ "notNull": true
3487
+ },
3488
+ "provider_tenant_id": {
3489
+ "name": "provider_tenant_id",
3490
+ "type": "text",
3491
+ "primaryKey": false,
3492
+ "notNull": true,
3493
+ "default": "''"
3494
+ },
3495
+ "provider_subject_id": {
3496
+ "name": "provider_subject_id",
3497
+ "type": "text",
3498
+ "primaryKey": false,
3499
+ "notNull": true
3500
+ },
3501
+ "display_name": {
3502
+ "name": "display_name",
3503
+ "type": "text",
3504
+ "primaryKey": false,
3505
+ "notNull": false
3506
+ },
3507
+ "handle": {
3508
+ "name": "handle",
3509
+ "type": "text",
3510
+ "primaryKey": false,
3511
+ "notNull": false
3512
+ },
3513
+ "email": {
3514
+ "name": "email",
3515
+ "type": "text",
3516
+ "primaryKey": false,
3517
+ "notNull": false
3518
+ },
3519
+ "avatar_url": {
3520
+ "name": "avatar_url",
3521
+ "type": "text",
3522
+ "primaryKey": false,
3523
+ "notNull": false
3524
+ },
3525
+ "metadata_json": {
3526
+ "name": "metadata_json",
3527
+ "type": "jsonb",
3528
+ "primaryKey": false,
3529
+ "notNull": false
3530
+ },
3531
+ "created_at": {
3532
+ "name": "created_at",
3533
+ "type": "timestamp with time zone",
3534
+ "primaryKey": false,
3535
+ "notNull": true
3536
+ },
3537
+ "updated_at": {
3538
+ "name": "updated_at",
3539
+ "type": "timestamp with time zone",
3540
+ "primaryKey": false,
3541
+ "notNull": true
3542
+ },
3543
+ "user_id": {
3544
+ "name": "user_id",
3545
+ "type": "text",
3546
+ "primaryKey": false,
3547
+ "notNull": false
3548
+ },
3549
+ "email_normalized": {
3550
+ "name": "email_normalized",
3551
+ "type": "text",
3552
+ "primaryKey": false,
3553
+ "notNull": false
3554
+ },
3555
+ "email_verified": {
3556
+ "name": "email_verified",
3557
+ "type": "boolean",
3558
+ "primaryKey": false,
3559
+ "notNull": true,
3560
+ "default": false
3561
+ },
3562
+ "signed_in_at": {
3563
+ "name": "signed_in_at",
3564
+ "type": "timestamp with time zone",
3565
+ "primaryKey": false,
3566
+ "notNull": false
3567
+ }
3568
+ },
3569
+ "indexes": {
3570
+ "junior_identities_provider_subject_uidx": {
3571
+ "name": "junior_identities_provider_subject_uidx",
3572
+ "columns": [
3573
+ {
3574
+ "expression": "provider",
3575
+ "isExpression": false,
3576
+ "asc": true,
3577
+ "nulls": "last"
3578
+ },
3579
+ {
3580
+ "expression": "provider_tenant_id",
3581
+ "isExpression": false,
3582
+ "asc": true,
3583
+ "nulls": "last"
3584
+ },
3585
+ {
3586
+ "expression": "provider_subject_id",
3587
+ "isExpression": false,
3588
+ "asc": true,
3589
+ "nulls": "last"
3590
+ }
3591
+ ],
3592
+ "isUnique": true,
3593
+ "concurrently": false,
3594
+ "method": "btree",
3595
+ "with": {}
3596
+ },
3597
+ "junior_identities_user_idx": {
3598
+ "name": "junior_identities_user_idx",
3599
+ "columns": [
3600
+ {
3601
+ "expression": "user_id",
3602
+ "isExpression": false,
3603
+ "asc": true,
3604
+ "nulls": "last"
3605
+ }
3606
+ ],
3607
+ "isUnique": false,
3608
+ "concurrently": false,
3609
+ "method": "btree",
3610
+ "with": {}
3611
+ },
3612
+ "junior_identities_verified_email_idx": {
3613
+ "name": "junior_identities_verified_email_idx",
3614
+ "columns": [
3615
+ {
3616
+ "expression": "email_normalized",
3617
+ "isExpression": false,
3618
+ "asc": true,
3619
+ "nulls": "last"
3620
+ }
3621
+ ],
3622
+ "isUnique": false,
3623
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
3624
+ "concurrently": false,
3625
+ "method": "btree",
3626
+ "with": {}
3627
+ },
3628
+ "junior_identities_kind_provider_idx": {
3629
+ "name": "junior_identities_kind_provider_idx",
3630
+ "columns": [
3631
+ {
3632
+ "expression": "kind",
3633
+ "isExpression": false,
3634
+ "asc": true,
3635
+ "nulls": "last"
3636
+ },
3637
+ {
3638
+ "expression": "provider",
3639
+ "isExpression": false,
3640
+ "asc": true,
3641
+ "nulls": "last"
3642
+ }
3643
+ ],
3644
+ "isUnique": false,
3645
+ "concurrently": false,
3646
+ "method": "btree",
3647
+ "with": {}
3648
+ }
3649
+ },
3650
+ "foreignKeys": {
3651
+ "junior_identities_user_id_junior_users_id_fk": {
3652
+ "name": "junior_identities_user_id_junior_users_id_fk",
3653
+ "tableFrom": "junior_identities",
3654
+ "tableTo": "junior_users",
3655
+ "columnsFrom": [
3656
+ "user_id"
3657
+ ],
3658
+ "columnsTo": [
3659
+ "id"
3660
+ ],
3661
+ "onDelete": "no action",
3662
+ "onUpdate": "no action"
3663
+ }
3664
+ },
3665
+ "compositePrimaryKeys": {},
3666
+ "uniqueConstraints": {},
3667
+ "policies": {},
3668
+ "checkConstraints": {},
3669
+ "isRLSEnabled": false
3670
+ },
3671
+ "public.junior_location_configurations": {
3672
+ "name": "junior_location_configurations",
3673
+ "schema": "",
3674
+ "columns": {
3675
+ "location_id": {
3676
+ "name": "location_id",
3677
+ "type": "text",
3678
+ "primaryKey": false,
3679
+ "notNull": true
3680
+ },
3681
+ "key": {
3682
+ "name": "key",
3683
+ "type": "text",
3684
+ "primaryKey": false,
3685
+ "notNull": true
3686
+ },
3687
+ "value": {
3688
+ "name": "value",
3689
+ "type": "text",
3690
+ "primaryKey": false,
3691
+ "notNull": true
3692
+ },
3693
+ "updated_at": {
3694
+ "name": "updated_at",
3695
+ "type": "timestamp with time zone",
3696
+ "primaryKey": false,
3697
+ "notNull": true
3698
+ },
3699
+ "updated_by": {
3700
+ "name": "updated_by",
3701
+ "type": "text",
3702
+ "primaryKey": false,
3703
+ "notNull": false
3704
+ },
3705
+ "source": {
3706
+ "name": "source",
3707
+ "type": "text",
3708
+ "primaryKey": false,
3709
+ "notNull": false
3710
+ },
3711
+ "expires_at": {
3712
+ "name": "expires_at",
3713
+ "type": "text",
3714
+ "primaryKey": false,
3715
+ "notNull": false
3716
+ }
3717
+ },
3718
+ "indexes": {},
3719
+ "foreignKeys": {
3720
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3721
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3722
+ "tableFrom": "junior_location_configurations",
3723
+ "tableTo": "junior_destinations",
3724
+ "columnsFrom": [
3725
+ "location_id"
3726
+ ],
3727
+ "columnsTo": [
3728
+ "id"
3729
+ ],
3730
+ "onDelete": "cascade",
3731
+ "onUpdate": "no action"
3732
+ }
3733
+ },
3734
+ "compositePrimaryKeys": {
3735
+ "junior_location_configurations_location_id_key_pk": {
3736
+ "name": "junior_location_configurations_location_id_key_pk",
3737
+ "columns": [
3738
+ "location_id",
3739
+ "key"
3740
+ ]
3741
+ }
3742
+ },
3743
+ "uniqueConstraints": {},
3744
+ "policies": {},
3745
+ "checkConstraints": {},
3746
+ "isRLSEnabled": false
3747
+ },
3748
+ "public.junior_push_subscriptions": {
3749
+ "name": "junior_push_subscriptions",
3750
+ "schema": "",
3751
+ "columns": {
3752
+ "id": {
3753
+ "name": "id",
3754
+ "type": "text",
3755
+ "primaryKey": true,
3756
+ "notNull": true
3757
+ },
3758
+ "user_id": {
3759
+ "name": "user_id",
3760
+ "type": "text",
3761
+ "primaryKey": false,
3762
+ "notNull": true
3763
+ },
3764
+ "endpoint": {
3765
+ "name": "endpoint",
3766
+ "type": "text",
3767
+ "primaryKey": false,
3768
+ "notNull": true
3769
+ },
3770
+ "p256dh": {
3771
+ "name": "p256dh",
3772
+ "type": "text",
3773
+ "primaryKey": false,
3774
+ "notNull": true
3775
+ },
3776
+ "auth": {
3777
+ "name": "auth",
3778
+ "type": "text",
3779
+ "primaryKey": false,
3780
+ "notNull": true
3781
+ },
3782
+ "created_at": {
3783
+ "name": "created_at",
3784
+ "type": "timestamp with time zone",
3785
+ "primaryKey": false,
3786
+ "notNull": true
3787
+ },
3788
+ "updated_at": {
3789
+ "name": "updated_at",
3790
+ "type": "timestamp with time zone",
3791
+ "primaryKey": false,
3792
+ "notNull": true
3793
+ }
3794
+ },
3795
+ "indexes": {
3796
+ "junior_push_subscriptions_endpoint_uidx": {
3797
+ "name": "junior_push_subscriptions_endpoint_uidx",
3798
+ "columns": [
3799
+ {
3800
+ "expression": "endpoint",
3801
+ "isExpression": false,
3802
+ "asc": true,
3803
+ "nulls": "last"
3804
+ }
3805
+ ],
3806
+ "isUnique": true,
3807
+ "concurrently": false,
3808
+ "method": "btree",
3809
+ "with": {}
3810
+ },
3811
+ "junior_push_subscriptions_user_idx": {
3812
+ "name": "junior_push_subscriptions_user_idx",
3813
+ "columns": [
3814
+ {
3815
+ "expression": "user_id",
3816
+ "isExpression": false,
3817
+ "asc": true,
3818
+ "nulls": "last"
3819
+ }
3820
+ ],
3821
+ "isUnique": false,
3822
+ "concurrently": false,
3823
+ "method": "btree",
3824
+ "with": {}
3825
+ }
3826
+ },
3827
+ "foreignKeys": {
3828
+ "junior_push_subscriptions_user_id_junior_users_id_fk": {
3829
+ "name": "junior_push_subscriptions_user_id_junior_users_id_fk",
3830
+ "tableFrom": "junior_push_subscriptions",
3831
+ "tableTo": "junior_users",
3832
+ "columnsFrom": [
3833
+ "user_id"
3834
+ ],
3835
+ "columnsTo": [
3836
+ "id"
3837
+ ],
3838
+ "onDelete": "cascade",
3839
+ "onUpdate": "no action"
3840
+ }
3841
+ },
3842
+ "compositePrimaryKeys": {},
3843
+ "uniqueConstraints": {},
3844
+ "policies": {},
3845
+ "checkConstraints": {},
3846
+ "isRLSEnabled": false
3847
+ },
3848
+ "public.junior_review_item_assignees": {
3849
+ "name": "junior_review_item_assignees",
3850
+ "schema": "",
3851
+ "columns": {
3852
+ "item_id": {
3853
+ "name": "item_id",
3854
+ "type": "text",
3855
+ "primaryKey": false,
3856
+ "notNull": true
3857
+ },
3858
+ "user_id": {
3859
+ "name": "user_id",
3860
+ "type": "text",
3861
+ "primaryKey": false,
3862
+ "notNull": true
3863
+ }
3864
+ },
3865
+ "indexes": {
3866
+ "junior_review_item_assignees_user_idx": {
3867
+ "name": "junior_review_item_assignees_user_idx",
3868
+ "columns": [
3869
+ {
3870
+ "expression": "user_id",
3871
+ "isExpression": false,
3872
+ "asc": true,
3873
+ "nulls": "last"
3874
+ }
3875
+ ],
3876
+ "isUnique": false,
3877
+ "concurrently": false,
3878
+ "method": "btree",
3879
+ "with": {}
3880
+ }
3881
+ },
3882
+ "foreignKeys": {
3883
+ "junior_review_item_assignees_item_id_junior_review_items_id_fk": {
3884
+ "name": "junior_review_item_assignees_item_id_junior_review_items_id_fk",
3885
+ "tableFrom": "junior_review_item_assignees",
3886
+ "tableTo": "junior_review_items",
3887
+ "columnsFrom": [
3888
+ "item_id"
3889
+ ],
3890
+ "columnsTo": [
3891
+ "id"
3892
+ ],
3893
+ "onDelete": "cascade",
3894
+ "onUpdate": "no action"
3895
+ },
3896
+ "junior_review_item_assignees_user_id_junior_users_id_fk": {
3897
+ "name": "junior_review_item_assignees_user_id_junior_users_id_fk",
3898
+ "tableFrom": "junior_review_item_assignees",
3899
+ "tableTo": "junior_users",
3900
+ "columnsFrom": [
3901
+ "user_id"
3902
+ ],
3903
+ "columnsTo": [
3904
+ "id"
3905
+ ],
3906
+ "onDelete": "cascade",
3907
+ "onUpdate": "no action"
3908
+ }
3909
+ },
3910
+ "compositePrimaryKeys": {
3911
+ "junior_review_item_assignees_item_id_user_id_pk": {
3912
+ "name": "junior_review_item_assignees_item_id_user_id_pk",
3913
+ "columns": [
3914
+ "item_id",
3915
+ "user_id"
3916
+ ]
3917
+ }
3918
+ },
3919
+ "uniqueConstraints": {},
3920
+ "policies": {},
3921
+ "checkConstraints": {},
3922
+ "isRLSEnabled": false
3923
+ },
3924
+ "public.junior_review_item_conversations": {
3925
+ "name": "junior_review_item_conversations",
3926
+ "schema": "",
3927
+ "columns": {
3928
+ "item_id": {
3929
+ "name": "item_id",
3930
+ "type": "text",
3931
+ "primaryKey": false,
3932
+ "notNull": true
3933
+ },
3934
+ "conversation_id": {
3935
+ "name": "conversation_id",
3936
+ "type": "text",
3937
+ "primaryKey": false,
3938
+ "notNull": true
3939
+ }
3940
+ },
3941
+ "indexes": {
3942
+ "junior_review_item_conversations_conversation_idx": {
3943
+ "name": "junior_review_item_conversations_conversation_idx",
3944
+ "columns": [
3945
+ {
3946
+ "expression": "conversation_id",
3947
+ "isExpression": false,
3948
+ "asc": true,
3949
+ "nulls": "last"
3950
+ }
3951
+ ],
3952
+ "isUnique": false,
3953
+ "concurrently": false,
3954
+ "method": "btree",
3955
+ "with": {}
3956
+ }
3957
+ },
3958
+ "foreignKeys": {
3959
+ "junior_review_item_conversations_item_id_junior_review_items_id_fk": {
3960
+ "name": "junior_review_item_conversations_item_id_junior_review_items_id_fk",
3961
+ "tableFrom": "junior_review_item_conversations",
3962
+ "tableTo": "junior_review_items",
3963
+ "columnsFrom": [
3964
+ "item_id"
3965
+ ],
3966
+ "columnsTo": [
3967
+ "id"
3968
+ ],
3969
+ "onDelete": "cascade",
3970
+ "onUpdate": "no action"
3971
+ },
3972
+ "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk": {
3973
+ "name": "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk",
3974
+ "tableFrom": "junior_review_item_conversations",
3975
+ "tableTo": "junior_conversations",
3976
+ "columnsFrom": [
3977
+ "conversation_id"
3978
+ ],
3979
+ "columnsTo": [
3980
+ "conversation_id"
3981
+ ],
3982
+ "onDelete": "cascade",
3983
+ "onUpdate": "no action"
3984
+ }
3985
+ },
3986
+ "compositePrimaryKeys": {
3987
+ "junior_review_item_conversations_item_id_conversation_id_pk": {
3988
+ "name": "junior_review_item_conversations_item_id_conversation_id_pk",
3989
+ "columns": [
3990
+ "item_id",
3991
+ "conversation_id"
3992
+ ]
3993
+ }
3994
+ },
3995
+ "uniqueConstraints": {},
3996
+ "policies": {},
3997
+ "checkConstraints": {},
3998
+ "isRLSEnabled": false
3999
+ },
4000
+ "public.junior_review_item_slack_cards": {
4001
+ "name": "junior_review_item_slack_cards",
4002
+ "schema": "",
4003
+ "columns": {
4004
+ "item_id": {
4005
+ "name": "item_id",
4006
+ "type": "text",
4007
+ "primaryKey": false,
4008
+ "notNull": true
4009
+ },
4010
+ "conversation_id": {
4011
+ "name": "conversation_id",
4012
+ "type": "text",
4013
+ "primaryKey": false,
4014
+ "notNull": true
4015
+ },
4016
+ "team_id": {
4017
+ "name": "team_id",
4018
+ "type": "text",
4019
+ "primaryKey": false,
4020
+ "notNull": true
4021
+ },
4022
+ "channel_id": {
4023
+ "name": "channel_id",
4024
+ "type": "text",
4025
+ "primaryKey": false,
4026
+ "notNull": true
4027
+ },
4028
+ "message_ts": {
4029
+ "name": "message_ts",
4030
+ "type": "text",
4031
+ "primaryKey": false,
4032
+ "notNull": true
4033
+ }
4034
+ },
4035
+ "indexes": {},
4036
+ "foreignKeys": {
4037
+ "junior_review_item_slack_cards_item_id_junior_review_items_id_fk": {
4038
+ "name": "junior_review_item_slack_cards_item_id_junior_review_items_id_fk",
4039
+ "tableFrom": "junior_review_item_slack_cards",
4040
+ "tableTo": "junior_review_items",
4041
+ "columnsFrom": [
4042
+ "item_id"
4043
+ ],
4044
+ "columnsTo": [
4045
+ "id"
4046
+ ],
4047
+ "onDelete": "cascade",
4048
+ "onUpdate": "no action"
4049
+ },
4050
+ "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk": {
4051
+ "name": "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk",
4052
+ "tableFrom": "junior_review_item_slack_cards",
4053
+ "tableTo": "junior_conversations",
4054
+ "columnsFrom": [
4055
+ "conversation_id"
4056
+ ],
4057
+ "columnsTo": [
4058
+ "conversation_id"
4059
+ ],
4060
+ "onDelete": "cascade",
4061
+ "onUpdate": "no action"
4062
+ }
4063
+ },
4064
+ "compositePrimaryKeys": {
4065
+ "junior_review_item_slack_cards_item_id_conversation_id_pk": {
4066
+ "name": "junior_review_item_slack_cards_item_id_conversation_id_pk",
4067
+ "columns": [
4068
+ "item_id",
4069
+ "conversation_id"
4070
+ ]
4071
+ }
4072
+ },
4073
+ "uniqueConstraints": {},
4074
+ "policies": {},
4075
+ "checkConstraints": {},
4076
+ "isRLSEnabled": false
4077
+ },
4078
+ "public.junior_review_items": {
4079
+ "name": "junior_review_items",
4080
+ "schema": "",
4081
+ "columns": {
4082
+ "id": {
4083
+ "name": "id",
4084
+ "type": "text",
4085
+ "primaryKey": true,
4086
+ "notNull": true
4087
+ },
4088
+ "kind": {
4089
+ "name": "kind",
4090
+ "type": "text",
4091
+ "primaryKey": false,
4092
+ "notNull": true
4093
+ },
4094
+ "status": {
4095
+ "name": "status",
4096
+ "type": "text",
4097
+ "primaryKey": false,
4098
+ "notNull": true
4099
+ },
4100
+ "visibility": {
4101
+ "name": "visibility",
4102
+ "type": "text",
4103
+ "primaryKey": false,
4104
+ "notNull": true
4105
+ },
4106
+ "title": {
4107
+ "name": "title",
4108
+ "type": "text",
4109
+ "primaryKey": false,
4110
+ "notNull": true
4111
+ },
4112
+ "body": {
4113
+ "name": "body",
4114
+ "type": "text",
4115
+ "primaryKey": false,
4116
+ "notNull": true
4117
+ },
4118
+ "request": {
4119
+ "name": "request",
4120
+ "type": "jsonb",
4121
+ "primaryKey": false,
4122
+ "notNull": false
4123
+ },
4124
+ "answer": {
4125
+ "name": "answer",
4126
+ "type": "jsonb",
4127
+ "primaryKey": false,
4128
+ "notNull": false
4129
+ },
4130
+ "assigned_to_everyone": {
4131
+ "name": "assigned_to_everyone",
4132
+ "type": "boolean",
4133
+ "primaryKey": false,
4134
+ "notNull": true,
4135
+ "default": false
4136
+ },
4137
+ "dedupe_key": {
4138
+ "name": "dedupe_key",
4139
+ "type": "text",
4140
+ "primaryKey": false,
4141
+ "notNull": true
4142
+ },
4143
+ "subject_id": {
4144
+ "name": "subject_id",
4145
+ "type": "text",
4146
+ "primaryKey": false,
4147
+ "notNull": false
4148
+ },
4149
+ "subject_title": {
4150
+ "name": "subject_title",
4151
+ "type": "text",
4152
+ "primaryKey": false,
4153
+ "notNull": false
4154
+ },
4155
+ "subject_url": {
4156
+ "name": "subject_url",
4157
+ "type": "text",
4158
+ "primaryKey": false,
4159
+ "notNull": false
4160
+ },
4161
+ "added_by_conversation_id": {
4162
+ "name": "added_by_conversation_id",
4163
+ "type": "text",
4164
+ "primaryKey": false,
4165
+ "notNull": true
4166
+ },
4167
+ "added_by_turn_id": {
4168
+ "name": "added_by_turn_id",
4169
+ "type": "text",
4170
+ "primaryKey": false,
4171
+ "notNull": false
4172
+ },
4173
+ "provider": {
4174
+ "name": "provider",
4175
+ "type": "text",
4176
+ "primaryKey": false,
4177
+ "notNull": false
4178
+ },
4179
+ "provider_tenant_id": {
4180
+ "name": "provider_tenant_id",
4181
+ "type": "text",
4182
+ "primaryKey": false,
4183
+ "notNull": false
4184
+ },
4185
+ "automation_id": {
4186
+ "name": "automation_id",
4187
+ "type": "text",
4188
+ "primaryKey": false,
4189
+ "notNull": false
4190
+ },
4191
+ "closed_at": {
4192
+ "name": "closed_at",
4193
+ "type": "timestamp with time zone",
4194
+ "primaryKey": false,
4195
+ "notNull": false
4196
+ },
4197
+ "closed_by_user_id": {
4198
+ "name": "closed_by_user_id",
4199
+ "type": "text",
4200
+ "primaryKey": false,
4201
+ "notNull": false
4202
+ },
4203
+ "close_reason": {
4204
+ "name": "close_reason",
4205
+ "type": "text",
4206
+ "primaryKey": false,
4207
+ "notNull": false
4208
+ },
4209
+ "created_at": {
4210
+ "name": "created_at",
4211
+ "type": "timestamp with time zone",
4212
+ "primaryKey": false,
4213
+ "notNull": true
4214
+ },
4215
+ "updated_at": {
4216
+ "name": "updated_at",
4217
+ "type": "timestamp with time zone",
4218
+ "primaryKey": false,
4219
+ "notNull": true
4220
+ }
4221
+ },
4222
+ "indexes": {
4223
+ "junior_review_items_open_dedupe_uidx": {
4224
+ "name": "junior_review_items_open_dedupe_uidx",
4225
+ "columns": [
4226
+ {
4227
+ "expression": "coalesce(\"provider\", '')",
4228
+ "asc": true,
4229
+ "isExpression": true,
4230
+ "nulls": "last"
4231
+ },
4232
+ {
4233
+ "expression": "coalesce(\"provider_tenant_id\", '')",
4234
+ "asc": true,
4235
+ "isExpression": true,
4236
+ "nulls": "last"
4237
+ },
4238
+ {
4239
+ "expression": "dedupe_key",
4240
+ "isExpression": false,
4241
+ "asc": true,
4242
+ "nulls": "last"
4243
+ }
4244
+ ],
4245
+ "isUnique": true,
4246
+ "where": "\"junior_review_items\".\"status\" = 'open'",
4247
+ "concurrently": false,
4248
+ "method": "btree",
4249
+ "with": {}
4250
+ },
4251
+ "junior_review_items_status_idx": {
4252
+ "name": "junior_review_items_status_idx",
4253
+ "columns": [
4254
+ {
4255
+ "expression": "status",
4256
+ "isExpression": false,
4257
+ "asc": true,
4258
+ "nulls": "last"
4259
+ },
4260
+ {
4261
+ "expression": "updated_at",
4262
+ "isExpression": false,
4263
+ "asc": true,
4264
+ "nulls": "last"
4265
+ },
4266
+ {
4267
+ "expression": "id",
4268
+ "isExpression": false,
4269
+ "asc": true,
4270
+ "nulls": "last"
4271
+ }
4272
+ ],
4273
+ "isUnique": false,
4274
+ "concurrently": false,
4275
+ "method": "btree",
4276
+ "with": {}
4277
+ },
4278
+ "junior_review_items_subject_idx": {
4279
+ "name": "junior_review_items_subject_idx",
4280
+ "columns": [
4281
+ {
4282
+ "expression": "subject_id",
4283
+ "isExpression": false,
4284
+ "asc": true,
4285
+ "nulls": "last"
4286
+ },
4287
+ {
4288
+ "expression": "status",
4289
+ "isExpression": false,
4290
+ "asc": true,
4291
+ "nulls": "last"
4292
+ }
4293
+ ],
4294
+ "isUnique": false,
4295
+ "concurrently": false,
4296
+ "method": "btree",
4297
+ "with": {}
4298
+ },
4299
+ "junior_review_items_automation_idx": {
4300
+ "name": "junior_review_items_automation_idx",
4301
+ "columns": [
4302
+ {
4303
+ "expression": "automation_id",
4304
+ "isExpression": false,
4305
+ "asc": true,
4306
+ "nulls": "last"
4307
+ },
4308
+ {
4309
+ "expression": "status",
4310
+ "isExpression": false,
4311
+ "asc": true,
4312
+ "nulls": "last"
4313
+ }
4314
+ ],
4315
+ "isUnique": false,
4316
+ "concurrently": false,
4317
+ "method": "btree",
4318
+ "with": {}
4319
+ }
4320
+ },
4321
+ "foreignKeys": {
4322
+ "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk": {
4323
+ "name": "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk",
4324
+ "tableFrom": "junior_review_items",
4325
+ "tableTo": "junior_conversations",
4326
+ "columnsFrom": [
4327
+ "added_by_conversation_id"
4328
+ ],
4329
+ "columnsTo": [
4330
+ "conversation_id"
4331
+ ],
4332
+ "onDelete": "cascade",
4333
+ "onUpdate": "no action"
4334
+ },
4335
+ "junior_review_items_automation_id_junior_automations_id_fk": {
4336
+ "name": "junior_review_items_automation_id_junior_automations_id_fk",
4337
+ "tableFrom": "junior_review_items",
4338
+ "tableTo": "junior_automations",
4339
+ "columnsFrom": [
4340
+ "automation_id"
4341
+ ],
4342
+ "columnsTo": [
4343
+ "id"
4344
+ ],
4345
+ "onDelete": "set null",
4346
+ "onUpdate": "no action"
4347
+ },
4348
+ "junior_review_items_closed_by_user_id_junior_users_id_fk": {
4349
+ "name": "junior_review_items_closed_by_user_id_junior_users_id_fk",
4350
+ "tableFrom": "junior_review_items",
4351
+ "tableTo": "junior_users",
4352
+ "columnsFrom": [
4353
+ "closed_by_user_id"
4354
+ ],
4355
+ "columnsTo": [
4356
+ "id"
4357
+ ],
4358
+ "onDelete": "set null",
4359
+ "onUpdate": "no action"
4360
+ }
4361
+ },
4362
+ "compositePrimaryKeys": {},
4363
+ "uniqueConstraints": {},
4364
+ "policies": {},
4365
+ "checkConstraints": {
4366
+ "junior_review_items_kind_check": {
4367
+ "name": "junior_review_items_kind_check",
4368
+ "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)))"
4369
+ },
4370
+ "junior_review_items_status_check": {
4371
+ "name": "junior_review_items_status_check",
4372
+ "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)"
4373
+ },
4374
+ "junior_review_items_tenant_check": {
4375
+ "name": "junior_review_items_tenant_check",
4376
+ "value": "(\"junior_review_items\".\"provider\" is null) = (\"junior_review_items\".\"provider_tenant_id\" is null)"
4377
+ },
4378
+ "junior_review_items_visibility_check": {
4379
+ "name": "junior_review_items_visibility_check",
4380
+ "value": "\"junior_review_items\".\"visibility\" = 'public' or not \"junior_review_items\".\"assigned_to_everyone\""
4381
+ }
4382
+ },
4383
+ "isRLSEnabled": false
4384
+ },
4385
+ "public.junior_snapshots": {
4386
+ "name": "junior_snapshots",
4387
+ "schema": "",
4388
+ "columns": {
4389
+ "id": {
4390
+ "name": "id",
4391
+ "type": "text",
4392
+ "primaryKey": true,
4393
+ "notNull": true
4394
+ },
4395
+ "workspace_id": {
4396
+ "name": "workspace_id",
4397
+ "type": "text",
4398
+ "primaryKey": false,
4399
+ "notNull": true
4400
+ },
4401
+ "profile_hash": {
4402
+ "name": "profile_hash",
4403
+ "type": "text",
4404
+ "primaryKey": false,
4405
+ "notNull": true
4406
+ },
4407
+ "status": {
4408
+ "name": "status",
4409
+ "type": "text",
4410
+ "primaryKey": false,
4411
+ "notNull": true
4412
+ },
4413
+ "snapshot_id": {
4414
+ "name": "snapshot_id",
4415
+ "type": "text",
4416
+ "primaryKey": false,
4417
+ "notNull": false
4418
+ },
4419
+ "build_duration_ms": {
4420
+ "name": "build_duration_ms",
4421
+ "type": "integer",
4422
+ "primaryKey": false,
4423
+ "notNull": false
4424
+ },
4425
+ "size_bytes": {
4426
+ "name": "size_bytes",
4427
+ "type": "bigint",
4428
+ "primaryKey": false,
4429
+ "notNull": false
4430
+ },
4431
+ "generated_at": {
4432
+ "name": "generated_at",
4433
+ "type": "timestamp with time zone",
4434
+ "primaryKey": false,
4435
+ "notNull": false
4436
+ },
4437
+ "build_started_at": {
4438
+ "name": "build_started_at",
4439
+ "type": "timestamp with time zone",
4440
+ "primaryKey": false,
4441
+ "notNull": false
4442
+ },
4443
+ "build_phase": {
4444
+ "name": "build_phase",
4445
+ "type": "text",
4446
+ "primaryKey": false,
4447
+ "notNull": false
4448
+ },
4449
+ "build_sandbox_name": {
4450
+ "name": "build_sandbox_name",
4451
+ "type": "text",
4452
+ "primaryKey": false,
4453
+ "notNull": false
4454
+ },
4455
+ "build_command_id": {
4456
+ "name": "build_command_id",
4457
+ "type": "text",
4458
+ "primaryKey": false,
4459
+ "notNull": false
4460
+ },
4461
+ "build_error": {
4462
+ "name": "build_error",
4463
+ "type": "text",
4464
+ "primaryKey": false,
4465
+ "notNull": false
4466
+ },
4467
+ "created_at": {
4468
+ "name": "created_at",
4469
+ "type": "timestamp with time zone",
4470
+ "primaryKey": false,
4471
+ "notNull": true
4472
+ },
4473
+ "updated_at": {
4474
+ "name": "updated_at",
4475
+ "type": "timestamp with time zone",
4476
+ "primaryKey": false,
4477
+ "notNull": true
4478
+ }
4479
+ },
4480
+ "indexes": {
4481
+ "junior_snapshots_snapshot_id_uidx": {
4482
+ "name": "junior_snapshots_snapshot_id_uidx",
4483
+ "columns": [
4484
+ {
4485
+ "expression": "snapshot_id",
4486
+ "isExpression": false,
4487
+ "asc": true,
4488
+ "nulls": "last"
4489
+ }
4490
+ ],
4491
+ "isUnique": true,
4492
+ "concurrently": false,
4493
+ "method": "btree",
4494
+ "with": {}
4495
+ },
4496
+ "junior_snapshots_workspace_idx": {
4497
+ "name": "junior_snapshots_workspace_idx",
4498
+ "columns": [
4499
+ {
4500
+ "expression": "workspace_id",
4501
+ "isExpression": false,
4502
+ "asc": true,
4503
+ "nulls": "last"
4504
+ }
4505
+ ],
4506
+ "isUnique": false,
4507
+ "concurrently": false,
4508
+ "method": "btree",
4509
+ "with": {}
4510
+ },
4511
+ "junior_snapshots_workspace_profile_status_idx": {
4512
+ "name": "junior_snapshots_workspace_profile_status_idx",
4513
+ "columns": [
4514
+ {
4515
+ "expression": "workspace_id",
4516
+ "isExpression": false,
4517
+ "asc": true,
4518
+ "nulls": "last"
4519
+ },
4520
+ {
4521
+ "expression": "profile_hash",
4522
+ "isExpression": false,
4523
+ "asc": true,
4524
+ "nulls": "last"
4525
+ },
4526
+ {
4527
+ "expression": "status",
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_active_build_uidx": {
4539
+ "name": "junior_snapshots_active_build_uidx",
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
+ "isUnique": true,
4555
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
4556
+ "concurrently": false,
4557
+ "method": "btree",
4558
+ "with": {}
4559
+ },
4560
+ "junior_snapshots_workspace_status_idx": {
4561
+ "name": "junior_snapshots_workspace_status_idx",
4562
+ "columns": [
4563
+ {
4564
+ "expression": "workspace_id",
4565
+ "isExpression": false,
4566
+ "asc": true,
4567
+ "nulls": "last"
4568
+ },
4569
+ {
4570
+ "expression": "status",
4571
+ "isExpression": false,
4572
+ "asc": true,
4573
+ "nulls": "last"
4574
+ }
4575
+ ],
4576
+ "isUnique": false,
4577
+ "concurrently": false,
4578
+ "method": "btree",
4579
+ "with": {}
4580
+ }
4581
+ },
4582
+ "foreignKeys": {
4583
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
4584
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
4585
+ "tableFrom": "junior_snapshots",
4586
+ "tableTo": "junior_workspaces",
4587
+ "columnsFrom": [
4588
+ "workspace_id"
4589
+ ],
4590
+ "columnsTo": [
4591
+ "id"
4592
+ ],
4593
+ "onDelete": "cascade",
4594
+ "onUpdate": "no action"
4595
+ }
4596
+ },
4597
+ "compositePrimaryKeys": {},
4598
+ "uniqueConstraints": {},
4599
+ "policies": {},
4600
+ "checkConstraints": {
4601
+ "junior_snapshots_status_check": {
4602
+ "name": "junior_snapshots_status_check",
4603
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
4604
+ },
4605
+ "junior_snapshots_build_phase_check": {
4606
+ "name": "junior_snapshots_build_phase_check",
4607
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
4608
+ },
4609
+ "junior_snapshots_ready_fields_check": {
4610
+ "name": "junior_snapshots_ready_fields_check",
4611
+ "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)"
4612
+ },
4613
+ "junior_snapshots_build_fields_check": {
4614
+ "name": "junior_snapshots_build_fields_check",
4615
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
4616
+ },
4617
+ "junior_snapshots_build_duration_check": {
4618
+ "name": "junior_snapshots_build_duration_check",
4619
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
4620
+ },
4621
+ "junior_snapshots_size_bytes_check": {
4622
+ "name": "junior_snapshots_size_bytes_check",
4623
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
4624
+ }
4625
+ },
4626
+ "isRLSEnabled": false
4627
+ },
4628
+ "public.junior_stats": {
4629
+ "name": "junior_stats",
4630
+ "schema": "",
4631
+ "columns": {
4632
+ "date": {
4633
+ "name": "date",
4634
+ "type": "date",
4635
+ "primaryKey": false,
4636
+ "notNull": true
4637
+ },
4638
+ "namespace": {
4639
+ "name": "namespace",
4640
+ "type": "text",
4641
+ "primaryKey": false,
4642
+ "notNull": true
4643
+ },
4644
+ "metric": {
4645
+ "name": "metric",
4646
+ "type": "text",
4647
+ "primaryKey": false,
4648
+ "notNull": true
4649
+ },
4650
+ "name": {
4651
+ "name": "name",
4652
+ "type": "text",
4653
+ "primaryKey": false,
4654
+ "notNull": true
4655
+ },
4656
+ "count": {
4657
+ "name": "count",
4658
+ "type": "integer",
4659
+ "primaryKey": false,
4660
+ "notNull": true,
4661
+ "default": 0
4662
+ }
4663
+ },
4664
+ "indexes": {},
4665
+ "foreignKeys": {},
4666
+ "compositePrimaryKeys": {
4667
+ "junior_stats_date_namespace_metric_name_pk": {
4668
+ "name": "junior_stats_date_namespace_metric_name_pk",
4669
+ "columns": [
4670
+ "date",
4671
+ "namespace",
4672
+ "metric",
4673
+ "name"
4674
+ ]
4675
+ }
4676
+ },
4677
+ "uniqueConstraints": {},
4678
+ "policies": {},
4679
+ "checkConstraints": {},
4680
+ "isRLSEnabled": false
4681
+ },
4682
+ "public.junior_users": {
4683
+ "name": "junior_users",
4684
+ "schema": "",
4685
+ "columns": {
4686
+ "id": {
4687
+ "name": "id",
4688
+ "type": "text",
4689
+ "primaryKey": true,
4690
+ "notNull": true
4691
+ },
4692
+ "primary_email": {
4693
+ "name": "primary_email",
4694
+ "type": "text",
4695
+ "primaryKey": false,
4696
+ "notNull": true
4697
+ },
4698
+ "primary_email_normalized": {
4699
+ "name": "primary_email_normalized",
4700
+ "type": "text",
4701
+ "primaryKey": false,
4702
+ "notNull": true
4703
+ },
4704
+ "display_name": {
4705
+ "name": "display_name",
4706
+ "type": "text",
4707
+ "primaryKey": false,
4708
+ "notNull": false
4709
+ },
4710
+ "timezone": {
4711
+ "name": "timezone",
4712
+ "type": "text",
4713
+ "primaryKey": false,
4714
+ "notNull": false
4715
+ },
4716
+ "customization": {
4717
+ "name": "customization",
4718
+ "type": "text",
4719
+ "primaryKey": false,
4720
+ "notNull": false
4721
+ },
4722
+ "notification_schedule": {
4723
+ "name": "notification_schedule",
4724
+ "type": "jsonb",
4725
+ "primaryKey": false,
4726
+ "notNull": false
4727
+ },
4728
+ "is_admin": {
4729
+ "name": "is_admin",
4730
+ "type": "boolean",
4731
+ "primaryKey": false,
4732
+ "notNull": true,
4733
+ "default": false
4734
+ },
4735
+ "auto_archive_default": {
4736
+ "name": "auto_archive_default",
4737
+ "type": "boolean",
4738
+ "primaryKey": false,
4739
+ "notNull": true,
4740
+ "default": false
4741
+ },
4742
+ "auto_archive_grace_hours": {
4743
+ "name": "auto_archive_grace_hours",
4744
+ "type": "integer",
4745
+ "primaryKey": false,
4746
+ "notNull": true,
4747
+ "default": 24
4748
+ },
4749
+ "preferences": {
4750
+ "name": "preferences",
4751
+ "type": "jsonb",
4752
+ "primaryKey": false,
4753
+ "notNull": true,
4754
+ "default": "'{}'::jsonb"
4755
+ },
4756
+ "created_at": {
4757
+ "name": "created_at",
4758
+ "type": "timestamp with time zone",
4759
+ "primaryKey": false,
4760
+ "notNull": true
4761
+ },
4762
+ "updated_at": {
4763
+ "name": "updated_at",
4764
+ "type": "timestamp with time zone",
4765
+ "primaryKey": false,
4766
+ "notNull": true
4767
+ }
4768
+ },
4769
+ "indexes": {
4770
+ "junior_users_primary_email_normalized_uidx": {
4771
+ "name": "junior_users_primary_email_normalized_uidx",
4772
+ "columns": [
4773
+ {
4774
+ "expression": "primary_email_normalized",
4775
+ "isExpression": false,
4776
+ "asc": true,
4777
+ "nulls": "last"
4778
+ }
4779
+ ],
4780
+ "isUnique": true,
4781
+ "concurrently": false,
4782
+ "method": "btree",
4783
+ "with": {}
4784
+ }
4785
+ },
4786
+ "foreignKeys": {},
4787
+ "compositePrimaryKeys": {},
4788
+ "uniqueConstraints": {},
4789
+ "policies": {},
4790
+ "checkConstraints": {},
4791
+ "isRLSEnabled": false
4792
+ },
4793
+ "public.junior_workspace_repos": {
4794
+ "name": "junior_workspace_repos",
4795
+ "schema": "",
4796
+ "columns": {
4797
+ "workspace_id": {
4798
+ "name": "workspace_id",
4799
+ "type": "text",
4800
+ "primaryKey": false,
4801
+ "notNull": true
4802
+ },
4803
+ "provider": {
4804
+ "name": "provider",
4805
+ "type": "text",
4806
+ "primaryKey": false,
4807
+ "notNull": true
4808
+ },
4809
+ "repo": {
4810
+ "name": "repo",
4811
+ "type": "text",
4812
+ "primaryKey": false,
4813
+ "notNull": true
4814
+ }
4815
+ },
4816
+ "indexes": {},
4817
+ "foreignKeys": {
4818
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
4819
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
4820
+ "tableFrom": "junior_workspace_repos",
4821
+ "tableTo": "junior_workspaces",
4822
+ "columnsFrom": [
4823
+ "workspace_id"
4824
+ ],
4825
+ "columnsTo": [
4826
+ "id"
4827
+ ],
4828
+ "onDelete": "cascade",
4829
+ "onUpdate": "no action"
4830
+ }
4831
+ },
4832
+ "compositePrimaryKeys": {
4833
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
4834
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
4835
+ "columns": [
4836
+ "workspace_id",
4837
+ "provider",
4838
+ "repo"
4839
+ ]
4840
+ }
4841
+ },
4842
+ "uniqueConstraints": {},
4843
+ "policies": {},
4844
+ "checkConstraints": {},
4845
+ "isRLSEnabled": false
4846
+ },
4847
+ "public.junior_workspaces": {
4848
+ "name": "junior_workspaces",
4849
+ "schema": "",
4850
+ "columns": {
4851
+ "id": {
4852
+ "name": "id",
4853
+ "type": "text",
4854
+ "primaryKey": true,
4855
+ "notNull": true
4856
+ },
4857
+ "name": {
4858
+ "name": "name",
4859
+ "type": "text",
4860
+ "primaryKey": false,
4861
+ "notNull": true
4862
+ },
4863
+ "setup_script": {
4864
+ "name": "setup_script",
4865
+ "type": "text",
4866
+ "primaryKey": false,
4867
+ "notNull": true,
4868
+ "default": "''"
4869
+ },
4870
+ "vcpus": {
4871
+ "name": "vcpus",
4872
+ "type": "integer",
4873
+ "primaryKey": false,
4874
+ "notNull": false
4875
+ },
4876
+ "created_at": {
4877
+ "name": "created_at",
4878
+ "type": "timestamp with time zone",
4879
+ "primaryKey": false,
4880
+ "notNull": true
4881
+ },
4882
+ "updated_at": {
4883
+ "name": "updated_at",
4884
+ "type": "timestamp with time zone",
4885
+ "primaryKey": false,
4886
+ "notNull": true
4887
+ }
4888
+ },
4889
+ "indexes": {
4890
+ "junior_workspaces_name_idx": {
4891
+ "name": "junior_workspaces_name_idx",
4892
+ "columns": [
4893
+ {
4894
+ "expression": "name",
4895
+ "isExpression": false,
4896
+ "asc": true,
4897
+ "nulls": "last"
4898
+ }
4899
+ ],
4900
+ "isUnique": true,
4901
+ "concurrently": false,
4902
+ "method": "btree",
4903
+ "with": {}
4904
+ }
4905
+ },
4906
+ "foreignKeys": {},
4907
+ "compositePrimaryKeys": {},
4908
+ "uniqueConstraints": {},
4909
+ "policies": {},
4910
+ "checkConstraints": {},
4911
+ "isRLSEnabled": false
4912
+ }
4913
+ },
4914
+ "enums": {},
4915
+ "schemas": {},
4916
+ "sequences": {},
4917
+ "roles": {},
4918
+ "policies": {},
4919
+ "views": {},
4920
+ "_meta": {
4921
+ "columns": {},
4922
+ "schemas": {},
4923
+ "tables": {}
4924
+ }
4925
+ }