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