@sentry/junior 0.299.0 → 0.300.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 (78) hide show
  1. package/dist/{adapter-AgCNqqsG.js → adapter-S5UkjNK3.js} +5 -4
  2. package/dist/{admin-1VwEXztm.js → admin-UrTniSPO.js} +2 -2
  3. package/dist/{agent-runner-Ciet8_nn.js → agent-runner-bY4_0UPm.js} +508 -203
  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 +293 -61
  8. package/dist/{app--ky-Eu33.d.ts → app-D-AcIcCV.d.ts} +13 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +57 -219
  11. package/dist/{automation-M3RFJUBf.js → automation-Dw82oQ-h.js} +2 -2
  12. package/dist/{background-compaction-queue-CnimvRdk.js → background-compaction-queue-B6U3060-.js} +8 -4
  13. package/dist/{briefs-CwzvgdCa.js → briefs-DqiwWu-n.js} +3 -3
  14. package/dist/{catalog-runtime-DaBaHY7u.js → catalog-runtime-D1oYNv04.js} +1 -1
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +5 -5
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +4 -4
  22. package/dist/{config-CAXIpWQb.js → config-9nHoFiJP.js} +39 -8
  23. package/dist/{connections-Dy0hPdUq.js → connections-DZjTN3JC.js} +6 -6
  24. package/dist/{continue-in-slack-DIOjFj76.js → continue-in-slack-Dtv7_U42.js} +6 -6
  25. package/dist/{conversation-fCWD9Az3.js → conversation-Dyjq2CZ8.js} +19 -8
  26. package/dist/{conversation-feed-BPK8vkkZ.js → conversation-feed-CcDxlrlQ.js} +23 -2
  27. package/dist/{conversation-privacy-DUgtRkf8.js → conversation-privacy-D-5HTXjS.js} +1 -1
  28. package/dist/{conversation-turn-DkJB6yMF.js → conversation-turn-Cxl8WZD7.js} +17 -17
  29. package/dist/{credential-sync-RX24Y8aY.js → credential-sync-C49ClwDX.js} +15 -15
  30. package/dist/{db-B07FtU9g.d.ts → db-2resqBh1.d.ts} +1 -1
  31. package/dist/{db-COYOGzYS.js → db-BJNo6fK5.js} +13 -8
  32. package/dist/{executor-BWmAgSyi.js → executor-DBIaOeJ_.js} +9 -4
  33. package/dist/instrumentation.js +14 -5
  34. package/dist/{lineage-D-5jm_oj.js → lineage-0dereG7H.js} +2 -2
  35. package/dist/{logging-DPLEa8Bn.js → logging-BIclibct.js} +1 -1
  36. package/dist/{message-BIHR1yRk.js → message-dkOl-Iii.js} +8 -8
  37. package/dist/{model-input-BPZYH8Nd.js → model-input-CLo9TaUd.js} +4 -4
  38. package/dist/nitro.d.ts +1 -1
  39. package/dist/nitro.js +4 -4
  40. package/dist/{oauth-callback-server-R7qvSzFG.js → oauth-callback-server-WmpjfJgQ.js} +2 -2
  41. package/dist/{plugins-CBW2Prb_.js → plugins-BBX07Jzt.js} +1 -1
  42. package/dist/{projection-DEdP1q6f.js → projection-w_X-zi7v.js} +3742 -3624
  43. package/dist/{prompt-4M98h_tC.js → prompt-B1Xw46-S.js} +4 -4
  44. package/dist/{registry-BTKmKM-r.js → registry-BmP5vnlj.js} +2 -2
  45. package/dist/{resolve-B8hXNVZ3.js → resolve-goo34bJK.js} +3 -3
  46. package/dist/{result-g-XAaOj6.js → result-PVBeU0Wf.js} +9 -9
  47. package/dist/{runner-BlPSA5A8.js → runner-DKrfvNV6.js} +9 -9
  48. package/dist/{sandbox-egress-signals-Pai-MzEY.js → sandbox-egress-signals-DsUcqrI0.js} +1 -1
  49. package/dist/{schema-BNnY_trV.js → schema-C9iNFz5n.js} +20 -16
  50. package/dist/{schema-DbuWR-DN.d.ts → schema-Dns-sTas.d.ts} +219 -6
  51. package/dist/{service-account-BYGZ08DQ.js → service-account-CMAAloAL.js} +3 -3
  52. package/dist/{service-account-9OLNQMyz.js → service-account-CmowamcB.js} +4 -4
  53. package/dist/{session-stop-2XJrcNCy.js → session-stop-BcAXze8a.js} +15 -41
  54. package/dist/{skills-DpBQoeHV.js → skills-DfsazET6.js} +2 -2
  55. package/dist/{slack-conversation-unfurl-BcDIWo67.js → slack-conversation-unfurl-CzQonuWz.js} +7 -7
  56. package/dist/{spawn-09GssFod.js → spawn-C7o0FDDp.js} +6 -6
  57. package/dist/{state-Cufq0_rH.js → state-zSilNpbi.js} +2 -2
  58. package/dist/{statuses-B8mUfghF.js → statuses-Hn-HsOph.js} +86 -2
  59. package/dist/{stop-U7iUrR1g.js → stop-CFOujp8C.js} +2938 -76
  60. package/dist/{store-CSgUTMdv.js → store-Dkeis_8o.js} +9 -9
  61. package/dist/{store-BHiaHCQu.js → store-E3x2Fg_F.js} +5 -5
  62. package/dist/{task-queue-bMNq0clp.js → task-queue-D-hCqdZW.js} +3 -3
  63. package/dist/{task-runner-B__rxwxU.js → task-runner-vohUPLHe.js} +8 -8
  64. package/dist/{thread-context-d0ceWbVT.js → thread-context-BzvdkgI9.js} +8 -8
  65. package/dist/{turn-session-routing-BVZHBFCF.js → turn-session-routing-Bo_LxFum.js} +5 -5
  66. package/dist/{turn-user-message-BEw7acTP.js → turn-user-message-D5RnVmxQ.js} +3 -3
  67. package/dist/{users-BK3dbxZL.js → users-2bggndVg.js} +3 -3
  68. package/dist/{validation-BDVJjO2E.js → validation-BbWikeSa.js} +1 -1
  69. package/dist/{version-DQgZoQ3D.js → version-GVBMW2jA.js} +1 -1
  70. package/dist/version.js +1 -1
  71. package/dist/{viewer-CAWfFo29.js → viewer-BpxRliyO.js} +16 -114
  72. package/dist/{warmup-9ySPacF9.js → warmup-BW2qwnal.js} +18 -16
  73. package/dist/{worker-D8jJO-WO.js → worker-Cbd-iuwZ.js} +24 -20
  74. package/migrations/0107_attachment_deferred_download.sql +2 -0
  75. package/migrations/meta/0107_snapshot.json +4617 -0
  76. package/migrations/meta/_journal.json +7 -0
  77. package/package.json +10 -8
  78. package/dist/media-BAHvgkok.js +0 -85
@@ -0,0 +1,4617 @@
1
+ {
2
+ "id": "60fd2cf9-e028-493b-996c-98c8196dbcf9",
3
+ "prevId": "df55d2df-8ffd-443f-ab18-573457ae4c17",
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_events": {
1936
+ "name": "junior_conversation_events",
1937
+ "schema": "",
1938
+ "columns": {
1939
+ "conversation_id": {
1940
+ "name": "conversation_id",
1941
+ "type": "text",
1942
+ "primaryKey": false,
1943
+ "notNull": true
1944
+ },
1945
+ "seq": {
1946
+ "name": "seq",
1947
+ "type": "integer",
1948
+ "primaryKey": false,
1949
+ "notNull": true
1950
+ },
1951
+ "history_version": {
1952
+ "name": "history_version",
1953
+ "type": "integer",
1954
+ "primaryKey": false,
1955
+ "notNull": true
1956
+ },
1957
+ "schema_version": {
1958
+ "name": "schema_version",
1959
+ "type": "integer",
1960
+ "primaryKey": false,
1961
+ "notNull": true,
1962
+ "default": 1
1963
+ },
1964
+ "idempotency_key": {
1965
+ "name": "idempotency_key",
1966
+ "type": "text",
1967
+ "primaryKey": false,
1968
+ "notNull": false
1969
+ },
1970
+ "type": {
1971
+ "name": "type",
1972
+ "type": "text",
1973
+ "primaryKey": false,
1974
+ "notNull": true
1975
+ },
1976
+ "payload": {
1977
+ "name": "payload",
1978
+ "type": "jsonb",
1979
+ "primaryKey": false,
1980
+ "notNull": true
1981
+ },
1982
+ "actor_identity_id": {
1983
+ "name": "actor_identity_id",
1984
+ "type": "text",
1985
+ "primaryKey": false,
1986
+ "notNull": false
1987
+ },
1988
+ "created_at": {
1989
+ "name": "created_at",
1990
+ "type": "timestamp with time zone",
1991
+ "primaryKey": false,
1992
+ "notNull": true
1993
+ }
1994
+ },
1995
+ "indexes": {
1996
+ "junior_conversation_events_history_version_idx": {
1997
+ "name": "junior_conversation_events_history_version_idx",
1998
+ "columns": [
1999
+ {
2000
+ "expression": "conversation_id",
2001
+ "isExpression": false,
2002
+ "asc": true,
2003
+ "nulls": "last"
2004
+ },
2005
+ {
2006
+ "expression": "history_version",
2007
+ "isExpression": false,
2008
+ "asc": true,
2009
+ "nulls": "last"
2010
+ },
2011
+ {
2012
+ "expression": "seq",
2013
+ "isExpression": false,
2014
+ "asc": true,
2015
+ "nulls": "last"
2016
+ }
2017
+ ],
2018
+ "isUnique": false,
2019
+ "concurrently": false,
2020
+ "method": "btree",
2021
+ "with": {}
2022
+ },
2023
+ "junior_conversation_events_type_idx": {
2024
+ "name": "junior_conversation_events_type_idx",
2025
+ "columns": [
2026
+ {
2027
+ "expression": "conversation_id",
2028
+ "isExpression": false,
2029
+ "asc": true,
2030
+ "nulls": "last"
2031
+ },
2032
+ {
2033
+ "expression": "type",
2034
+ "isExpression": false,
2035
+ "asc": true,
2036
+ "nulls": "last"
2037
+ },
2038
+ {
2039
+ "expression": "seq",
2040
+ "isExpression": false,
2041
+ "asc": true,
2042
+ "nulls": "last"
2043
+ }
2044
+ ],
2045
+ "isUnique": false,
2046
+ "concurrently": false,
2047
+ "method": "btree",
2048
+ "with": {}
2049
+ },
2050
+ "junior_conversation_events_plugin_report_idx": {
2051
+ "name": "junior_conversation_events_plugin_report_idx",
2052
+ "columns": [
2053
+ {
2054
+ "expression": "(\"payload\"->>'namespace')",
2055
+ "asc": true,
2056
+ "isExpression": true,
2057
+ "nulls": "last"
2058
+ },
2059
+ {
2060
+ "expression": "(\"payload\"->>'name')",
2061
+ "asc": true,
2062
+ "isExpression": true,
2063
+ "nulls": "last"
2064
+ },
2065
+ {
2066
+ "expression": "created_at",
2067
+ "isExpression": false,
2068
+ "asc": true,
2069
+ "nulls": "last"
2070
+ }
2071
+ ],
2072
+ "isUnique": false,
2073
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
2074
+ "concurrently": false,
2075
+ "method": "btree",
2076
+ "with": {}
2077
+ },
2078
+ "junior_conversation_events_guardian_review_time_idx": {
2079
+ "name": "junior_conversation_events_guardian_review_time_idx",
2080
+ "columns": [
2081
+ {
2082
+ "expression": "created_at",
2083
+ "isExpression": false,
2084
+ "asc": true,
2085
+ "nulls": "last"
2086
+ }
2087
+ ],
2088
+ "isUnique": false,
2089
+ "where": "\"junior_conversation_events\".\"type\" = 'guardian_action_reviewed'",
2090
+ "concurrently": false,
2091
+ "method": "btree",
2092
+ "with": {}
2093
+ },
2094
+ "junior_conversation_events_plugin_conversation_idx": {
2095
+ "name": "junior_conversation_events_plugin_conversation_idx",
2096
+ "columns": [
2097
+ {
2098
+ "expression": "conversation_id",
2099
+ "isExpression": false,
2100
+ "asc": true,
2101
+ "nulls": "last"
2102
+ },
2103
+ {
2104
+ "expression": "(\"payload\"->>'namespace')",
2105
+ "asc": true,
2106
+ "isExpression": true,
2107
+ "nulls": "last"
2108
+ },
2109
+ {
2110
+ "expression": "(\"payload\"->>'name')",
2111
+ "asc": true,
2112
+ "isExpression": true,
2113
+ "nulls": "last"
2114
+ },
2115
+ {
2116
+ "expression": "seq",
2117
+ "isExpression": false,
2118
+ "asc": true,
2119
+ "nulls": "last"
2120
+ }
2121
+ ],
2122
+ "isUnique": false,
2123
+ "where": "\"junior_conversation_events\".\"type\" = 'structured_event'",
2124
+ "concurrently": false,
2125
+ "method": "btree",
2126
+ "with": {}
2127
+ },
2128
+ "junior_conversation_events_actor_identity_idx": {
2129
+ "name": "junior_conversation_events_actor_identity_idx",
2130
+ "columns": [
2131
+ {
2132
+ "expression": "actor_identity_id",
2133
+ "isExpression": false,
2134
+ "asc": true,
2135
+ "nulls": "last"
2136
+ },
2137
+ {
2138
+ "expression": "conversation_id",
2139
+ "isExpression": false,
2140
+ "asc": true,
2141
+ "nulls": "last"
2142
+ },
2143
+ {
2144
+ "expression": "seq",
2145
+ "isExpression": false,
2146
+ "asc": true,
2147
+ "nulls": "last"
2148
+ }
2149
+ ],
2150
+ "isUnique": false,
2151
+ "concurrently": false,
2152
+ "method": "btree",
2153
+ "with": {}
2154
+ },
2155
+ "junior_conversation_events_author_idx": {
2156
+ "name": "junior_conversation_events_author_idx",
2157
+ "columns": [
2158
+ {
2159
+ "expression": "conversation_id",
2160
+ "isExpression": false,
2161
+ "asc": true,
2162
+ "nulls": "last"
2163
+ },
2164
+ {
2165
+ "expression": "actor_identity_id",
2166
+ "isExpression": false,
2167
+ "asc": true,
2168
+ "nulls": "last"
2169
+ },
2170
+ {
2171
+ "expression": "seq",
2172
+ "isExpression": false,
2173
+ "asc": true,
2174
+ "nulls": "last"
2175
+ }
2176
+ ],
2177
+ "isUnique": false,
2178
+ "where": "\"junior_conversation_events\".\"actor_identity_id\" is not null",
2179
+ "concurrently": false,
2180
+ "method": "btree",
2181
+ "with": {}
2182
+ },
2183
+ "junior_conversation_events_message_role_idx": {
2184
+ "name": "junior_conversation_events_message_role_idx",
2185
+ "columns": [
2186
+ {
2187
+ "expression": "conversation_id",
2188
+ "isExpression": false,
2189
+ "asc": true,
2190
+ "nulls": "last"
2191
+ },
2192
+ {
2193
+ "expression": "(\"payload\"->>'role')",
2194
+ "asc": true,
2195
+ "isExpression": true,
2196
+ "nulls": "last"
2197
+ },
2198
+ {
2199
+ "expression": "created_at",
2200
+ "isExpression": false,
2201
+ "asc": true,
2202
+ "nulls": "last"
2203
+ },
2204
+ {
2205
+ "expression": "seq",
2206
+ "isExpression": false,
2207
+ "asc": true,
2208
+ "nulls": "last"
2209
+ }
2210
+ ],
2211
+ "isUnique": false,
2212
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2213
+ "concurrently": false,
2214
+ "method": "btree",
2215
+ "with": {}
2216
+ },
2217
+ "junior_conversation_events_user_message_time_idx": {
2218
+ "name": "junior_conversation_events_user_message_time_idx",
2219
+ "columns": [
2220
+ {
2221
+ "expression": "conversation_id",
2222
+ "isExpression": false,
2223
+ "asc": true,
2224
+ "nulls": "last"
2225
+ },
2226
+ {
2227
+ "expression": "created_at",
2228
+ "isExpression": false,
2229
+ "asc": true,
2230
+ "nulls": "last"
2231
+ },
2232
+ {
2233
+ "expression": "seq",
2234
+ "isExpression": false,
2235
+ "asc": true,
2236
+ "nulls": "last"
2237
+ }
2238
+ ],
2239
+ "isUnique": false,
2240
+ "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')",
2241
+ "concurrently": false,
2242
+ "method": "btree",
2243
+ "with": {}
2244
+ },
2245
+ "junior_conversation_events_message_search_idx": {
2246
+ "name": "junior_conversation_events_message_search_idx",
2247
+ "columns": [
2248
+ {
2249
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
2250
+ "asc": true,
2251
+ "isExpression": true,
2252
+ "nulls": "last"
2253
+ }
2254
+ ],
2255
+ "isUnique": false,
2256
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
2257
+ "concurrently": false,
2258
+ "method": "gin",
2259
+ "with": {}
2260
+ },
2261
+ "junior_conversation_events_idempotency_idx": {
2262
+ "name": "junior_conversation_events_idempotency_idx",
2263
+ "columns": [
2264
+ {
2265
+ "expression": "conversation_id",
2266
+ "isExpression": false,
2267
+ "asc": true,
2268
+ "nulls": "last"
2269
+ },
2270
+ {
2271
+ "expression": "idempotency_key",
2272
+ "isExpression": false,
2273
+ "asc": true,
2274
+ "nulls": "last"
2275
+ }
2276
+ ],
2277
+ "isUnique": true,
2278
+ "concurrently": false,
2279
+ "method": "btree",
2280
+ "with": {}
2281
+ }
2282
+ },
2283
+ "foreignKeys": {
2284
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
2285
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
2286
+ "tableFrom": "junior_conversation_events",
2287
+ "tableTo": "junior_identities",
2288
+ "columnsFrom": ["actor_identity_id"],
2289
+ "columnsTo": ["id"],
2290
+ "onDelete": "no action",
2291
+ "onUpdate": "no action"
2292
+ },
2293
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
2294
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
2295
+ "tableFrom": "junior_conversation_events",
2296
+ "tableTo": "junior_conversations",
2297
+ "columnsFrom": ["conversation_id"],
2298
+ "columnsTo": ["conversation_id"],
2299
+ "onDelete": "no action",
2300
+ "onUpdate": "no action"
2301
+ }
2302
+ },
2303
+ "compositePrimaryKeys": {
2304
+ "junior_conversation_events_conversation_id_seq_pk": {
2305
+ "name": "junior_conversation_events_conversation_id_seq_pk",
2306
+ "columns": ["conversation_id", "seq"]
2307
+ }
2308
+ },
2309
+ "uniqueConstraints": {},
2310
+ "policies": {},
2311
+ "checkConstraints": {},
2312
+ "isRLSEnabled": false
2313
+ },
2314
+ "public.junior_conversation_metrics": {
2315
+ "name": "junior_conversation_metrics",
2316
+ "schema": "",
2317
+ "columns": {
2318
+ "conversation_id": {
2319
+ "name": "conversation_id",
2320
+ "type": "text",
2321
+ "primaryKey": false,
2322
+ "notNull": true
2323
+ },
2324
+ "run_id": {
2325
+ "name": "run_id",
2326
+ "type": "text",
2327
+ "primaryKey": false,
2328
+ "notNull": true
2329
+ },
2330
+ "metric": {
2331
+ "name": "metric",
2332
+ "type": "text",
2333
+ "primaryKey": false,
2334
+ "notNull": true
2335
+ },
2336
+ "actor_identity_id": {
2337
+ "name": "actor_identity_id",
2338
+ "type": "text",
2339
+ "primaryKey": false,
2340
+ "notNull": false
2341
+ },
2342
+ "value": {
2343
+ "name": "value",
2344
+ "type": "double precision",
2345
+ "primaryKey": false,
2346
+ "notNull": true
2347
+ },
2348
+ "occurred_at": {
2349
+ "name": "occurred_at",
2350
+ "type": "timestamp with time zone",
2351
+ "primaryKey": false,
2352
+ "notNull": true
2353
+ },
2354
+ "updated_at": {
2355
+ "name": "updated_at",
2356
+ "type": "timestamp with time zone",
2357
+ "primaryKey": false,
2358
+ "notNull": true
2359
+ }
2360
+ },
2361
+ "indexes": {
2362
+ "junior_conversation_metrics_actor_identity_occurred_at_idx": {
2363
+ "name": "junior_conversation_metrics_actor_identity_occurred_at_idx",
2364
+ "columns": [
2365
+ {
2366
+ "expression": "actor_identity_id",
2367
+ "isExpression": false,
2368
+ "asc": true,
2369
+ "nulls": "last"
2370
+ },
2371
+ {
2372
+ "expression": "occurred_at",
2373
+ "isExpression": false,
2374
+ "asc": true,
2375
+ "nulls": "last"
2376
+ }
2377
+ ],
2378
+ "isUnique": false,
2379
+ "concurrently": false,
2380
+ "method": "btree",
2381
+ "with": {}
2382
+ },
2383
+ "junior_conversation_metrics_occurred_at_metric_idx": {
2384
+ "name": "junior_conversation_metrics_occurred_at_metric_idx",
2385
+ "columns": [
2386
+ {
2387
+ "expression": "occurred_at",
2388
+ "isExpression": false,
2389
+ "asc": true,
2390
+ "nulls": "last"
2391
+ },
2392
+ {
2393
+ "expression": "metric",
2394
+ "isExpression": false,
2395
+ "asc": true,
2396
+ "nulls": "last"
2397
+ }
2398
+ ],
2399
+ "isUnique": false,
2400
+ "concurrently": false,
2401
+ "method": "btree",
2402
+ "with": {}
2403
+ }
2404
+ },
2405
+ "foreignKeys": {
2406
+ "junior_conversation_metrics_actor_identity_id_junior_identities_id_fk": {
2407
+ "name": "junior_conversation_metrics_actor_identity_id_junior_identities_id_fk",
2408
+ "tableFrom": "junior_conversation_metrics",
2409
+ "tableTo": "junior_identities",
2410
+ "columnsFrom": ["actor_identity_id"],
2411
+ "columnsTo": ["id"],
2412
+ "onDelete": "no action",
2413
+ "onUpdate": "no action"
2414
+ },
2415
+ "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk": {
2416
+ "name": "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
2417
+ "tableFrom": "junior_conversation_metrics",
2418
+ "tableTo": "junior_conversations",
2419
+ "columnsFrom": ["conversation_id"],
2420
+ "columnsTo": ["conversation_id"],
2421
+ "onDelete": "no action",
2422
+ "onUpdate": "no action"
2423
+ }
2424
+ },
2425
+ "compositePrimaryKeys": {
2426
+ "junior_conversation_metrics_conversation_id_run_id_metric_pk": {
2427
+ "name": "junior_conversation_metrics_conversation_id_run_id_metric_pk",
2428
+ "columns": ["conversation_id", "run_id", "metric"]
2429
+ }
2430
+ },
2431
+ "uniqueConstraints": {},
2432
+ "policies": {},
2433
+ "checkConstraints": {},
2434
+ "isRLSEnabled": false
2435
+ },
2436
+ "public.junior_conversation_participants": {
2437
+ "name": "junior_conversation_participants",
2438
+ "schema": "",
2439
+ "columns": {
2440
+ "user_id": {
2441
+ "name": "user_id",
2442
+ "type": "text",
2443
+ "primaryKey": false,
2444
+ "notNull": true
2445
+ },
2446
+ "root_conversation_id": {
2447
+ "name": "root_conversation_id",
2448
+ "type": "text",
2449
+ "primaryKey": false,
2450
+ "notNull": true
2451
+ },
2452
+ "last_message_at": {
2453
+ "name": "last_message_at",
2454
+ "type": "timestamp with time zone",
2455
+ "primaryKey": false,
2456
+ "notNull": true
2457
+ },
2458
+ "archived_at": {
2459
+ "name": "archived_at",
2460
+ "type": "timestamp with time zone",
2461
+ "primaryKey": false,
2462
+ "notNull": false
2463
+ },
2464
+ "pinned_at": {
2465
+ "name": "pinned_at",
2466
+ "type": "timestamp with time zone",
2467
+ "primaryKey": false,
2468
+ "notNull": false
2469
+ },
2470
+ "pin_position": {
2471
+ "name": "pin_position",
2472
+ "type": "integer",
2473
+ "primaryKey": false,
2474
+ "notNull": false
2475
+ },
2476
+ "auto_archive": {
2477
+ "name": "auto_archive",
2478
+ "type": "boolean",
2479
+ "primaryKey": false,
2480
+ "notNull": false
2481
+ },
2482
+ "unsubscribed_at": {
2483
+ "name": "unsubscribed_at",
2484
+ "type": "timestamp with time zone",
2485
+ "primaryKey": false,
2486
+ "notNull": false
2487
+ }
2488
+ },
2489
+ "indexes": {
2490
+ "junior_conversation_participants_user_activity_idx": {
2491
+ "name": "junior_conversation_participants_user_activity_idx",
2492
+ "columns": [
2493
+ {
2494
+ "expression": "user_id",
2495
+ "isExpression": false,
2496
+ "asc": true,
2497
+ "nulls": "last"
2498
+ },
2499
+ {
2500
+ "expression": "last_message_at",
2501
+ "isExpression": false,
2502
+ "asc": false,
2503
+ "nulls": "last"
2504
+ }
2505
+ ],
2506
+ "isUnique": false,
2507
+ "concurrently": false,
2508
+ "method": "btree",
2509
+ "with": {}
2510
+ },
2511
+ "junior_conversation_participants_root_idx": {
2512
+ "name": "junior_conversation_participants_root_idx",
2513
+ "columns": [
2514
+ {
2515
+ "expression": "root_conversation_id",
2516
+ "isExpression": false,
2517
+ "asc": true,
2518
+ "nulls": "last"
2519
+ }
2520
+ ],
2521
+ "isUnique": false,
2522
+ "concurrently": false,
2523
+ "method": "btree",
2524
+ "with": {}
2525
+ },
2526
+ "junior_conversation_participants_auto_archive_idx": {
2527
+ "name": "junior_conversation_participants_auto_archive_idx",
2528
+ "columns": [
2529
+ {
2530
+ "expression": "user_id",
2531
+ "isExpression": false,
2532
+ "asc": true,
2533
+ "nulls": "last"
2534
+ }
2535
+ ],
2536
+ "isUnique": false,
2537
+ "where": "\"junior_conversation_participants\".\"auto_archive\"",
2538
+ "concurrently": false,
2539
+ "method": "btree",
2540
+ "with": {}
2541
+ },
2542
+ "junior_conversation_participants_unsubscribed_idx": {
2543
+ "name": "junior_conversation_participants_unsubscribed_idx",
2544
+ "columns": [
2545
+ {
2546
+ "expression": "user_id",
2547
+ "isExpression": false,
2548
+ "asc": true,
2549
+ "nulls": "last"
2550
+ },
2551
+ {
2552
+ "expression": "root_conversation_id",
2553
+ "isExpression": false,
2554
+ "asc": true,
2555
+ "nulls": "last"
2556
+ }
2557
+ ],
2558
+ "isUnique": false,
2559
+ "where": "\"junior_conversation_participants\".\"unsubscribed_at\" is not null",
2560
+ "concurrently": false,
2561
+ "method": "btree",
2562
+ "with": {}
2563
+ }
2564
+ },
2565
+ "foreignKeys": {
2566
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
2567
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
2568
+ "tableFrom": "junior_conversation_participants",
2569
+ "tableTo": "junior_users",
2570
+ "columnsFrom": ["user_id"],
2571
+ "columnsTo": ["id"],
2572
+ "onDelete": "no action",
2573
+ "onUpdate": "no action"
2574
+ },
2575
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
2576
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
2577
+ "tableFrom": "junior_conversation_participants",
2578
+ "tableTo": "junior_conversations",
2579
+ "columnsFrom": ["root_conversation_id"],
2580
+ "columnsTo": ["conversation_id"],
2581
+ "onDelete": "no action",
2582
+ "onUpdate": "no action"
2583
+ }
2584
+ },
2585
+ "compositePrimaryKeys": {
2586
+ "junior_conversation_participants_user_root_pk": {
2587
+ "name": "junior_conversation_participants_user_root_pk",
2588
+ "columns": ["user_id", "root_conversation_id"]
2589
+ }
2590
+ },
2591
+ "uniqueConstraints": {},
2592
+ "policies": {},
2593
+ "checkConstraints": {},
2594
+ "isRLSEnabled": false
2595
+ },
2596
+ "public.junior_conversation_read_positions": {
2597
+ "name": "junior_conversation_read_positions",
2598
+ "schema": "",
2599
+ "columns": {
2600
+ "user_id": {
2601
+ "name": "user_id",
2602
+ "type": "text",
2603
+ "primaryKey": false,
2604
+ "notNull": true
2605
+ },
2606
+ "conversation_id": {
2607
+ "name": "conversation_id",
2608
+ "type": "text",
2609
+ "primaryKey": false,
2610
+ "notNull": true
2611
+ },
2612
+ "last_read_seq": {
2613
+ "name": "last_read_seq",
2614
+ "type": "integer",
2615
+ "primaryKey": false,
2616
+ "notNull": true
2617
+ },
2618
+ "updated_at": {
2619
+ "name": "updated_at",
2620
+ "type": "timestamp with time zone",
2621
+ "primaryKey": false,
2622
+ "notNull": true
2623
+ }
2624
+ },
2625
+ "indexes": {},
2626
+ "foreignKeys": {
2627
+ "junior_conversation_read_positions_user_id_junior_users_id_fk": {
2628
+ "name": "junior_conversation_read_positions_user_id_junior_users_id_fk",
2629
+ "tableFrom": "junior_conversation_read_positions",
2630
+ "tableTo": "junior_users",
2631
+ "columnsFrom": ["user_id"],
2632
+ "columnsTo": ["id"],
2633
+ "onDelete": "no action",
2634
+ "onUpdate": "no action"
2635
+ },
2636
+ "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk": {
2637
+ "name": "junior_conversation_read_positions_conversation_id_junior_conversations_conversation_id_fk",
2638
+ "tableFrom": "junior_conversation_read_positions",
2639
+ "tableTo": "junior_conversations",
2640
+ "columnsFrom": ["conversation_id"],
2641
+ "columnsTo": ["conversation_id"],
2642
+ "onDelete": "no action",
2643
+ "onUpdate": "no action"
2644
+ }
2645
+ },
2646
+ "compositePrimaryKeys": {
2647
+ "junior_conversation_read_positions_user_conversation_pk": {
2648
+ "name": "junior_conversation_read_positions_user_conversation_pk",
2649
+ "columns": ["user_id", "conversation_id"]
2650
+ }
2651
+ },
2652
+ "uniqueConstraints": {},
2653
+ "policies": {},
2654
+ "checkConstraints": {},
2655
+ "isRLSEnabled": false
2656
+ },
2657
+ "public.junior_conversations": {
2658
+ "name": "junior_conversations",
2659
+ "schema": "",
2660
+ "columns": {
2661
+ "conversation_id": {
2662
+ "name": "conversation_id",
2663
+ "type": "text",
2664
+ "primaryKey": true,
2665
+ "notNull": true
2666
+ },
2667
+ "schema_version": {
2668
+ "name": "schema_version",
2669
+ "type": "integer",
2670
+ "primaryKey": false,
2671
+ "notNull": true,
2672
+ "default": 1
2673
+ },
2674
+ "source": {
2675
+ "name": "source",
2676
+ "type": "text",
2677
+ "primaryKey": false,
2678
+ "notNull": false
2679
+ },
2680
+ "source_json": {
2681
+ "name": "source_json",
2682
+ "type": "jsonb",
2683
+ "primaryKey": false,
2684
+ "notNull": false
2685
+ },
2686
+ "location_json": {
2687
+ "name": "location_json",
2688
+ "type": "jsonb",
2689
+ "primaryKey": false,
2690
+ "notNull": false
2691
+ },
2692
+ "destination_id": {
2693
+ "name": "destination_id",
2694
+ "type": "text",
2695
+ "primaryKey": false,
2696
+ "notNull": false
2697
+ },
2698
+ "destination_json": {
2699
+ "name": "destination_json",
2700
+ "type": "jsonb",
2701
+ "primaryKey": false,
2702
+ "notNull": false
2703
+ },
2704
+ "actor_identity_id": {
2705
+ "name": "actor_identity_id",
2706
+ "type": "text",
2707
+ "primaryKey": false,
2708
+ "notNull": false
2709
+ },
2710
+ "creator_identity_id": {
2711
+ "name": "creator_identity_id",
2712
+ "type": "text",
2713
+ "primaryKey": false,
2714
+ "notNull": false
2715
+ },
2716
+ "credential_subject_identity_id": {
2717
+ "name": "credential_subject_identity_id",
2718
+ "type": "text",
2719
+ "primaryKey": false,
2720
+ "notNull": false
2721
+ },
2722
+ "actor_json": {
2723
+ "name": "actor_json",
2724
+ "type": "jsonb",
2725
+ "primaryKey": false,
2726
+ "notNull": false
2727
+ },
2728
+ "channel_name": {
2729
+ "name": "channel_name",
2730
+ "type": "text",
2731
+ "primaryKey": false,
2732
+ "notNull": false
2733
+ },
2734
+ "title": {
2735
+ "name": "title",
2736
+ "type": "text",
2737
+ "primaryKey": false,
2738
+ "notNull": false
2739
+ },
2740
+ "created_at": {
2741
+ "name": "created_at",
2742
+ "type": "timestamp with time zone",
2743
+ "primaryKey": false,
2744
+ "notNull": true
2745
+ },
2746
+ "last_activity_at": {
2747
+ "name": "last_activity_at",
2748
+ "type": "timestamp with time zone",
2749
+ "primaryKey": false,
2750
+ "notNull": true
2751
+ },
2752
+ "last_message_at": {
2753
+ "name": "last_message_at",
2754
+ "type": "timestamp with time zone",
2755
+ "primaryKey": false,
2756
+ "notNull": false
2757
+ },
2758
+ "updated_at": {
2759
+ "name": "updated_at",
2760
+ "type": "timestamp with time zone",
2761
+ "primaryKey": false,
2762
+ "notNull": true
2763
+ },
2764
+ "execution_updated_at": {
2765
+ "name": "execution_updated_at",
2766
+ "type": "timestamp with time zone",
2767
+ "primaryKey": false,
2768
+ "notNull": false
2769
+ },
2770
+ "execution_status": {
2771
+ "name": "execution_status",
2772
+ "type": "text",
2773
+ "primaryKey": false,
2774
+ "notNull": true
2775
+ },
2776
+ "run_id": {
2777
+ "name": "run_id",
2778
+ "type": "text",
2779
+ "primaryKey": false,
2780
+ "notNull": false
2781
+ },
2782
+ "last_checkpoint_at": {
2783
+ "name": "last_checkpoint_at",
2784
+ "type": "timestamp with time zone",
2785
+ "primaryKey": false,
2786
+ "notNull": false
2787
+ },
2788
+ "last_enqueued_at": {
2789
+ "name": "last_enqueued_at",
2790
+ "type": "timestamp with time zone",
2791
+ "primaryKey": false,
2792
+ "notNull": false
2793
+ },
2794
+ "parent_conversation_id": {
2795
+ "name": "parent_conversation_id",
2796
+ "type": "text",
2797
+ "primaryKey": false,
2798
+ "notNull": false
2799
+ },
2800
+ "kind": {
2801
+ "name": "kind",
2802
+ "type": "text",
2803
+ "primaryKey": false,
2804
+ "notNull": false
2805
+ },
2806
+ "agent_config_json": {
2807
+ "name": "agent_config_json",
2808
+ "type": "jsonb",
2809
+ "primaryKey": false,
2810
+ "notNull": false
2811
+ },
2812
+ "archived_at": {
2813
+ "name": "archived_at",
2814
+ "type": "timestamp with time zone",
2815
+ "primaryKey": false,
2816
+ "notNull": false
2817
+ },
2818
+ "child_archived_at": {
2819
+ "name": "child_archived_at",
2820
+ "type": "timestamp with time zone",
2821
+ "primaryKey": false,
2822
+ "notNull": false
2823
+ },
2824
+ "forked_from_conversation_id": {
2825
+ "name": "forked_from_conversation_id",
2826
+ "type": "text",
2827
+ "primaryKey": false,
2828
+ "notNull": false
2829
+ },
2830
+ "quick_question_at": {
2831
+ "name": "quick_question_at",
2832
+ "type": "timestamp with time zone",
2833
+ "primaryKey": false,
2834
+ "notNull": false
2835
+ },
2836
+ "root_conversation_id": {
2837
+ "name": "root_conversation_id",
2838
+ "type": "text",
2839
+ "primaryKey": false,
2840
+ "notNull": false
2841
+ },
2842
+ "transcript_purged_at": {
2843
+ "name": "transcript_purged_at",
2844
+ "type": "timestamp with time zone",
2845
+ "primaryKey": false,
2846
+ "notNull": false
2847
+ },
2848
+ "stopped_at": {
2849
+ "name": "stopped_at",
2850
+ "type": "timestamp with time zone",
2851
+ "primaryKey": false,
2852
+ "notNull": false
2853
+ },
2854
+ "delivery_paused_at": {
2855
+ "name": "delivery_paused_at",
2856
+ "type": "timestamp with time zone",
2857
+ "primaryKey": false,
2858
+ "notNull": false
2859
+ },
2860
+ "duration_ms": {
2861
+ "name": "duration_ms",
2862
+ "type": "integer",
2863
+ "primaryKey": false,
2864
+ "notNull": true,
2865
+ "default": 0
2866
+ },
2867
+ "usage_json": {
2868
+ "name": "usage_json",
2869
+ "type": "jsonb",
2870
+ "primaryKey": false,
2871
+ "notNull": false
2872
+ },
2873
+ "execution_duration_ms": {
2874
+ "name": "execution_duration_ms",
2875
+ "type": "integer",
2876
+ "primaryKey": false,
2877
+ "notNull": true,
2878
+ "default": 0
2879
+ },
2880
+ "execution_usage_json": {
2881
+ "name": "execution_usage_json",
2882
+ "type": "jsonb",
2883
+ "primaryKey": false,
2884
+ "notNull": false
2885
+ },
2886
+ "metric_run_id": {
2887
+ "name": "metric_run_id",
2888
+ "type": "text",
2889
+ "primaryKey": false,
2890
+ "notNull": false
2891
+ },
2892
+ "detail_version": {
2893
+ "name": "detail_version",
2894
+ "type": "integer",
2895
+ "primaryKey": false,
2896
+ "notNull": true,
2897
+ "default": 0
2898
+ }
2899
+ },
2900
+ "indexes": {
2901
+ "junior_conversations_last_activity_idx": {
2902
+ "name": "junior_conversations_last_activity_idx",
2903
+ "columns": [
2904
+ {
2905
+ "expression": "last_activity_at",
2906
+ "isExpression": false,
2907
+ "asc": false,
2908
+ "nulls": "last"
2909
+ },
2910
+ {
2911
+ "expression": "conversation_id",
2912
+ "isExpression": false,
2913
+ "asc": true,
2914
+ "nulls": "last"
2915
+ }
2916
+ ],
2917
+ "isUnique": false,
2918
+ "concurrently": false,
2919
+ "method": "btree",
2920
+ "with": {}
2921
+ },
2922
+ "junior_conversations_active_idx": {
2923
+ "name": "junior_conversations_active_idx",
2924
+ "columns": [
2925
+ {
2926
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
2927
+ "asc": true,
2928
+ "isExpression": true,
2929
+ "nulls": "last"
2930
+ },
2931
+ {
2932
+ "expression": "conversation_id",
2933
+ "isExpression": false,
2934
+ "asc": true,
2935
+ "nulls": "last"
2936
+ }
2937
+ ],
2938
+ "isUnique": false,
2939
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
2940
+ "concurrently": false,
2941
+ "method": "btree",
2942
+ "with": {}
2943
+ },
2944
+ "junior_conversations_destination_activity_idx": {
2945
+ "name": "junior_conversations_destination_activity_idx",
2946
+ "columns": [
2947
+ {
2948
+ "expression": "destination_id",
2949
+ "isExpression": false,
2950
+ "asc": true,
2951
+ "nulls": "last"
2952
+ },
2953
+ {
2954
+ "expression": "last_activity_at",
2955
+ "isExpression": false,
2956
+ "asc": false,
2957
+ "nulls": "last"
2958
+ }
2959
+ ],
2960
+ "isUnique": false,
2961
+ "concurrently": false,
2962
+ "method": "btree",
2963
+ "with": {}
2964
+ },
2965
+ "junior_conversations_actor_activity_idx": {
2966
+ "name": "junior_conversations_actor_activity_idx",
2967
+ "columns": [
2968
+ {
2969
+ "expression": "actor_identity_id",
2970
+ "isExpression": false,
2971
+ "asc": true,
2972
+ "nulls": "last"
2973
+ },
2974
+ {
2975
+ "expression": "last_activity_at",
2976
+ "isExpression": false,
2977
+ "asc": false,
2978
+ "nulls": "last"
2979
+ }
2980
+ ],
2981
+ "isUnique": false,
2982
+ "concurrently": false,
2983
+ "method": "btree",
2984
+ "with": {}
2985
+ },
2986
+ "junior_conversations_parent_idx": {
2987
+ "name": "junior_conversations_parent_idx",
2988
+ "columns": [
2989
+ {
2990
+ "expression": "parent_conversation_id",
2991
+ "isExpression": false,
2992
+ "asc": true,
2993
+ "nulls": "last"
2994
+ }
2995
+ ],
2996
+ "isUnique": false,
2997
+ "concurrently": false,
2998
+ "method": "btree",
2999
+ "with": {}
3000
+ },
3001
+ "junior_conversations_forked_from_idx": {
3002
+ "name": "junior_conversations_forked_from_idx",
3003
+ "columns": [
3004
+ {
3005
+ "expression": "forked_from_conversation_id",
3006
+ "isExpression": false,
3007
+ "asc": true,
3008
+ "nulls": "last"
3009
+ }
3010
+ ],
3011
+ "isUnique": false,
3012
+ "concurrently": false,
3013
+ "method": "btree",
3014
+ "with": {}
3015
+ },
3016
+ "junior_conversations_root_idx": {
3017
+ "name": "junior_conversations_root_idx",
3018
+ "columns": [
3019
+ {
3020
+ "expression": "root_conversation_id",
3021
+ "isExpression": false,
3022
+ "asc": true,
3023
+ "nulls": "last"
3024
+ }
3025
+ ],
3026
+ "isUnique": false,
3027
+ "concurrently": false,
3028
+ "method": "btree",
3029
+ "with": {}
3030
+ }
3031
+ },
3032
+ "foreignKeys": {
3033
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
3034
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
3035
+ "tableFrom": "junior_conversations",
3036
+ "tableTo": "junior_destinations",
3037
+ "columnsFrom": ["destination_id"],
3038
+ "columnsTo": ["id"],
3039
+ "onDelete": "no action",
3040
+ "onUpdate": "no action"
3041
+ },
3042
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
3043
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
3044
+ "tableFrom": "junior_conversations",
3045
+ "tableTo": "junior_identities",
3046
+ "columnsFrom": ["actor_identity_id"],
3047
+ "columnsTo": ["id"],
3048
+ "onDelete": "no action",
3049
+ "onUpdate": "no action"
3050
+ },
3051
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
3052
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
3053
+ "tableFrom": "junior_conversations",
3054
+ "tableTo": "junior_identities",
3055
+ "columnsFrom": ["creator_identity_id"],
3056
+ "columnsTo": ["id"],
3057
+ "onDelete": "no action",
3058
+ "onUpdate": "no action"
3059
+ },
3060
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
3061
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
3062
+ "tableFrom": "junior_conversations",
3063
+ "tableTo": "junior_identities",
3064
+ "columnsFrom": ["credential_subject_identity_id"],
3065
+ "columnsTo": ["id"],
3066
+ "onDelete": "no action",
3067
+ "onUpdate": "no action"
3068
+ },
3069
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
3070
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
3071
+ "tableFrom": "junior_conversations",
3072
+ "tableTo": "junior_conversations",
3073
+ "columnsFrom": ["parent_conversation_id"],
3074
+ "columnsTo": ["conversation_id"],
3075
+ "onDelete": "no action",
3076
+ "onUpdate": "no action"
3077
+ },
3078
+ "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk": {
3079
+ "name": "junior_conversations_forked_from_conversation_id_junior_conversations_conversation_id_fk",
3080
+ "tableFrom": "junior_conversations",
3081
+ "tableTo": "junior_conversations",
3082
+ "columnsFrom": ["forked_from_conversation_id"],
3083
+ "columnsTo": ["conversation_id"],
3084
+ "onDelete": "set null",
3085
+ "onUpdate": "no action"
3086
+ },
3087
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
3088
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
3089
+ "tableFrom": "junior_conversations",
3090
+ "tableTo": "junior_conversations",
3091
+ "columnsFrom": ["root_conversation_id"],
3092
+ "columnsTo": ["conversation_id"],
3093
+ "onDelete": "no action",
3094
+ "onUpdate": "no action"
3095
+ }
3096
+ },
3097
+ "compositePrimaryKeys": {},
3098
+ "uniqueConstraints": {},
3099
+ "policies": {},
3100
+ "checkConstraints": {
3101
+ "junior_conversations_kind_check": {
3102
+ "name": "junior_conversations_kind_check",
3103
+ "value": "\"junior_conversations\".\"kind\" in ('root', 'automation', 'thread', 'task')"
3104
+ },
3105
+ "junior_conversations_kind_parent_check": {
3106
+ "name": "junior_conversations_kind_parent_check",
3107
+ "value": "\"junior_conversations\".\"kind\" is null or ((\"junior_conversations\".\"kind\" in ('root', 'automation')) = (\"junior_conversations\".\"parent_conversation_id\" is null))"
3108
+ }
3109
+ },
3110
+ "isRLSEnabled": false
3111
+ },
3112
+ "public.junior_destinations": {
3113
+ "name": "junior_destinations",
3114
+ "schema": "",
3115
+ "columns": {
3116
+ "id": {
3117
+ "name": "id",
3118
+ "type": "text",
3119
+ "primaryKey": true,
3120
+ "notNull": true
3121
+ },
3122
+ "provider": {
3123
+ "name": "provider",
3124
+ "type": "text",
3125
+ "primaryKey": false,
3126
+ "notNull": true
3127
+ },
3128
+ "provider_tenant_id": {
3129
+ "name": "provider_tenant_id",
3130
+ "type": "text",
3131
+ "primaryKey": false,
3132
+ "notNull": true,
3133
+ "default": "''"
3134
+ },
3135
+ "provider_destination_id": {
3136
+ "name": "provider_destination_id",
3137
+ "type": "text",
3138
+ "primaryKey": false,
3139
+ "notNull": true
3140
+ },
3141
+ "kind": {
3142
+ "name": "kind",
3143
+ "type": "text",
3144
+ "primaryKey": false,
3145
+ "notNull": true
3146
+ },
3147
+ "parent_destination_id": {
3148
+ "name": "parent_destination_id",
3149
+ "type": "text",
3150
+ "primaryKey": false,
3151
+ "notNull": false
3152
+ },
3153
+ "display_name": {
3154
+ "name": "display_name",
3155
+ "type": "text",
3156
+ "primaryKey": false,
3157
+ "notNull": false
3158
+ },
3159
+ "visibility": {
3160
+ "name": "visibility",
3161
+ "type": "text",
3162
+ "primaryKey": false,
3163
+ "notNull": true,
3164
+ "default": "'unknown'"
3165
+ },
3166
+ "metadata_json": {
3167
+ "name": "metadata_json",
3168
+ "type": "jsonb",
3169
+ "primaryKey": false,
3170
+ "notNull": false
3171
+ },
3172
+ "created_at": {
3173
+ "name": "created_at",
3174
+ "type": "timestamp with time zone",
3175
+ "primaryKey": false,
3176
+ "notNull": true
3177
+ },
3178
+ "updated_at": {
3179
+ "name": "updated_at",
3180
+ "type": "timestamp with time zone",
3181
+ "primaryKey": false,
3182
+ "notNull": true
3183
+ }
3184
+ },
3185
+ "indexes": {
3186
+ "junior_destinations_provider_destination_uidx": {
3187
+ "name": "junior_destinations_provider_destination_uidx",
3188
+ "columns": [
3189
+ {
3190
+ "expression": "provider",
3191
+ "isExpression": false,
3192
+ "asc": true,
3193
+ "nulls": "last"
3194
+ },
3195
+ {
3196
+ "expression": "provider_tenant_id",
3197
+ "isExpression": false,
3198
+ "asc": true,
3199
+ "nulls": "last"
3200
+ },
3201
+ {
3202
+ "expression": "provider_destination_id",
3203
+ "isExpression": false,
3204
+ "asc": true,
3205
+ "nulls": "last"
3206
+ }
3207
+ ],
3208
+ "isUnique": true,
3209
+ "concurrently": false,
3210
+ "method": "btree",
3211
+ "with": {}
3212
+ },
3213
+ "junior_destinations_provider_kind_idx": {
3214
+ "name": "junior_destinations_provider_kind_idx",
3215
+ "columns": [
3216
+ {
3217
+ "expression": "provider",
3218
+ "isExpression": false,
3219
+ "asc": true,
3220
+ "nulls": "last"
3221
+ },
3222
+ {
3223
+ "expression": "kind",
3224
+ "isExpression": false,
3225
+ "asc": true,
3226
+ "nulls": "last"
3227
+ }
3228
+ ],
3229
+ "isUnique": false,
3230
+ "concurrently": false,
3231
+ "method": "btree",
3232
+ "with": {}
3233
+ }
3234
+ },
3235
+ "foreignKeys": {},
3236
+ "compositePrimaryKeys": {},
3237
+ "uniqueConstraints": {},
3238
+ "policies": {},
3239
+ "checkConstraints": {},
3240
+ "isRLSEnabled": false
3241
+ },
3242
+ "public.junior_identities": {
3243
+ "name": "junior_identities",
3244
+ "schema": "",
3245
+ "columns": {
3246
+ "id": {
3247
+ "name": "id",
3248
+ "type": "text",
3249
+ "primaryKey": true,
3250
+ "notNull": true
3251
+ },
3252
+ "kind": {
3253
+ "name": "kind",
3254
+ "type": "text",
3255
+ "primaryKey": false,
3256
+ "notNull": true
3257
+ },
3258
+ "provider": {
3259
+ "name": "provider",
3260
+ "type": "text",
3261
+ "primaryKey": false,
3262
+ "notNull": true
3263
+ },
3264
+ "provider_tenant_id": {
3265
+ "name": "provider_tenant_id",
3266
+ "type": "text",
3267
+ "primaryKey": false,
3268
+ "notNull": true,
3269
+ "default": "''"
3270
+ },
3271
+ "provider_subject_id": {
3272
+ "name": "provider_subject_id",
3273
+ "type": "text",
3274
+ "primaryKey": false,
3275
+ "notNull": true
3276
+ },
3277
+ "display_name": {
3278
+ "name": "display_name",
3279
+ "type": "text",
3280
+ "primaryKey": false,
3281
+ "notNull": false
3282
+ },
3283
+ "handle": {
3284
+ "name": "handle",
3285
+ "type": "text",
3286
+ "primaryKey": false,
3287
+ "notNull": false
3288
+ },
3289
+ "email": {
3290
+ "name": "email",
3291
+ "type": "text",
3292
+ "primaryKey": false,
3293
+ "notNull": false
3294
+ },
3295
+ "avatar_url": {
3296
+ "name": "avatar_url",
3297
+ "type": "text",
3298
+ "primaryKey": false,
3299
+ "notNull": false
3300
+ },
3301
+ "metadata_json": {
3302
+ "name": "metadata_json",
3303
+ "type": "jsonb",
3304
+ "primaryKey": false,
3305
+ "notNull": false
3306
+ },
3307
+ "created_at": {
3308
+ "name": "created_at",
3309
+ "type": "timestamp with time zone",
3310
+ "primaryKey": false,
3311
+ "notNull": true
3312
+ },
3313
+ "updated_at": {
3314
+ "name": "updated_at",
3315
+ "type": "timestamp with time zone",
3316
+ "primaryKey": false,
3317
+ "notNull": true
3318
+ },
3319
+ "user_id": {
3320
+ "name": "user_id",
3321
+ "type": "text",
3322
+ "primaryKey": false,
3323
+ "notNull": false
3324
+ },
3325
+ "email_normalized": {
3326
+ "name": "email_normalized",
3327
+ "type": "text",
3328
+ "primaryKey": false,
3329
+ "notNull": false
3330
+ },
3331
+ "email_verified": {
3332
+ "name": "email_verified",
3333
+ "type": "boolean",
3334
+ "primaryKey": false,
3335
+ "notNull": true,
3336
+ "default": false
3337
+ },
3338
+ "signed_in_at": {
3339
+ "name": "signed_in_at",
3340
+ "type": "timestamp with time zone",
3341
+ "primaryKey": false,
3342
+ "notNull": false
3343
+ }
3344
+ },
3345
+ "indexes": {
3346
+ "junior_identities_provider_subject_uidx": {
3347
+ "name": "junior_identities_provider_subject_uidx",
3348
+ "columns": [
3349
+ {
3350
+ "expression": "provider",
3351
+ "isExpression": false,
3352
+ "asc": true,
3353
+ "nulls": "last"
3354
+ },
3355
+ {
3356
+ "expression": "provider_tenant_id",
3357
+ "isExpression": false,
3358
+ "asc": true,
3359
+ "nulls": "last"
3360
+ },
3361
+ {
3362
+ "expression": "provider_subject_id",
3363
+ "isExpression": false,
3364
+ "asc": true,
3365
+ "nulls": "last"
3366
+ }
3367
+ ],
3368
+ "isUnique": true,
3369
+ "concurrently": false,
3370
+ "method": "btree",
3371
+ "with": {}
3372
+ },
3373
+ "junior_identities_user_idx": {
3374
+ "name": "junior_identities_user_idx",
3375
+ "columns": [
3376
+ {
3377
+ "expression": "user_id",
3378
+ "isExpression": false,
3379
+ "asc": true,
3380
+ "nulls": "last"
3381
+ }
3382
+ ],
3383
+ "isUnique": false,
3384
+ "concurrently": false,
3385
+ "method": "btree",
3386
+ "with": {}
3387
+ },
3388
+ "junior_identities_verified_email_idx": {
3389
+ "name": "junior_identities_verified_email_idx",
3390
+ "columns": [
3391
+ {
3392
+ "expression": "email_normalized",
3393
+ "isExpression": false,
3394
+ "asc": true,
3395
+ "nulls": "last"
3396
+ }
3397
+ ],
3398
+ "isUnique": false,
3399
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
3400
+ "concurrently": false,
3401
+ "method": "btree",
3402
+ "with": {}
3403
+ },
3404
+ "junior_identities_kind_provider_idx": {
3405
+ "name": "junior_identities_kind_provider_idx",
3406
+ "columns": [
3407
+ {
3408
+ "expression": "kind",
3409
+ "isExpression": false,
3410
+ "asc": true,
3411
+ "nulls": "last"
3412
+ },
3413
+ {
3414
+ "expression": "provider",
3415
+ "isExpression": false,
3416
+ "asc": true,
3417
+ "nulls": "last"
3418
+ }
3419
+ ],
3420
+ "isUnique": false,
3421
+ "concurrently": false,
3422
+ "method": "btree",
3423
+ "with": {}
3424
+ }
3425
+ },
3426
+ "foreignKeys": {
3427
+ "junior_identities_user_id_junior_users_id_fk": {
3428
+ "name": "junior_identities_user_id_junior_users_id_fk",
3429
+ "tableFrom": "junior_identities",
3430
+ "tableTo": "junior_users",
3431
+ "columnsFrom": ["user_id"],
3432
+ "columnsTo": ["id"],
3433
+ "onDelete": "no action",
3434
+ "onUpdate": "no action"
3435
+ }
3436
+ },
3437
+ "compositePrimaryKeys": {},
3438
+ "uniqueConstraints": {},
3439
+ "policies": {},
3440
+ "checkConstraints": {},
3441
+ "isRLSEnabled": false
3442
+ },
3443
+ "public.junior_location_configurations": {
3444
+ "name": "junior_location_configurations",
3445
+ "schema": "",
3446
+ "columns": {
3447
+ "location_id": {
3448
+ "name": "location_id",
3449
+ "type": "text",
3450
+ "primaryKey": false,
3451
+ "notNull": true
3452
+ },
3453
+ "key": {
3454
+ "name": "key",
3455
+ "type": "text",
3456
+ "primaryKey": false,
3457
+ "notNull": true
3458
+ },
3459
+ "value": {
3460
+ "name": "value",
3461
+ "type": "text",
3462
+ "primaryKey": false,
3463
+ "notNull": true
3464
+ },
3465
+ "updated_at": {
3466
+ "name": "updated_at",
3467
+ "type": "timestamp with time zone",
3468
+ "primaryKey": false,
3469
+ "notNull": true
3470
+ },
3471
+ "updated_by": {
3472
+ "name": "updated_by",
3473
+ "type": "text",
3474
+ "primaryKey": false,
3475
+ "notNull": false
3476
+ },
3477
+ "source": {
3478
+ "name": "source",
3479
+ "type": "text",
3480
+ "primaryKey": false,
3481
+ "notNull": false
3482
+ },
3483
+ "expires_at": {
3484
+ "name": "expires_at",
3485
+ "type": "text",
3486
+ "primaryKey": false,
3487
+ "notNull": false
3488
+ }
3489
+ },
3490
+ "indexes": {},
3491
+ "foreignKeys": {
3492
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
3493
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
3494
+ "tableFrom": "junior_location_configurations",
3495
+ "tableTo": "junior_destinations",
3496
+ "columnsFrom": ["location_id"],
3497
+ "columnsTo": ["id"],
3498
+ "onDelete": "cascade",
3499
+ "onUpdate": "no action"
3500
+ }
3501
+ },
3502
+ "compositePrimaryKeys": {
3503
+ "junior_location_configurations_location_id_key_pk": {
3504
+ "name": "junior_location_configurations_location_id_key_pk",
3505
+ "columns": ["location_id", "key"]
3506
+ }
3507
+ },
3508
+ "uniqueConstraints": {},
3509
+ "policies": {},
3510
+ "checkConstraints": {},
3511
+ "isRLSEnabled": false
3512
+ },
3513
+ "public.junior_push_subscriptions": {
3514
+ "name": "junior_push_subscriptions",
3515
+ "schema": "",
3516
+ "columns": {
3517
+ "id": {
3518
+ "name": "id",
3519
+ "type": "text",
3520
+ "primaryKey": true,
3521
+ "notNull": true
3522
+ },
3523
+ "user_id": {
3524
+ "name": "user_id",
3525
+ "type": "text",
3526
+ "primaryKey": false,
3527
+ "notNull": true
3528
+ },
3529
+ "endpoint": {
3530
+ "name": "endpoint",
3531
+ "type": "text",
3532
+ "primaryKey": false,
3533
+ "notNull": true
3534
+ },
3535
+ "p256dh": {
3536
+ "name": "p256dh",
3537
+ "type": "text",
3538
+ "primaryKey": false,
3539
+ "notNull": true
3540
+ },
3541
+ "auth": {
3542
+ "name": "auth",
3543
+ "type": "text",
3544
+ "primaryKey": false,
3545
+ "notNull": true
3546
+ },
3547
+ "created_at": {
3548
+ "name": "created_at",
3549
+ "type": "timestamp with time zone",
3550
+ "primaryKey": false,
3551
+ "notNull": true
3552
+ },
3553
+ "updated_at": {
3554
+ "name": "updated_at",
3555
+ "type": "timestamp with time zone",
3556
+ "primaryKey": false,
3557
+ "notNull": true
3558
+ }
3559
+ },
3560
+ "indexes": {
3561
+ "junior_push_subscriptions_endpoint_uidx": {
3562
+ "name": "junior_push_subscriptions_endpoint_uidx",
3563
+ "columns": [
3564
+ {
3565
+ "expression": "endpoint",
3566
+ "isExpression": false,
3567
+ "asc": true,
3568
+ "nulls": "last"
3569
+ }
3570
+ ],
3571
+ "isUnique": true,
3572
+ "concurrently": false,
3573
+ "method": "btree",
3574
+ "with": {}
3575
+ },
3576
+ "junior_push_subscriptions_user_idx": {
3577
+ "name": "junior_push_subscriptions_user_idx",
3578
+ "columns": [
3579
+ {
3580
+ "expression": "user_id",
3581
+ "isExpression": false,
3582
+ "asc": true,
3583
+ "nulls": "last"
3584
+ }
3585
+ ],
3586
+ "isUnique": false,
3587
+ "concurrently": false,
3588
+ "method": "btree",
3589
+ "with": {}
3590
+ }
3591
+ },
3592
+ "foreignKeys": {
3593
+ "junior_push_subscriptions_user_id_junior_users_id_fk": {
3594
+ "name": "junior_push_subscriptions_user_id_junior_users_id_fk",
3595
+ "tableFrom": "junior_push_subscriptions",
3596
+ "tableTo": "junior_users",
3597
+ "columnsFrom": ["user_id"],
3598
+ "columnsTo": ["id"],
3599
+ "onDelete": "cascade",
3600
+ "onUpdate": "no action"
3601
+ }
3602
+ },
3603
+ "compositePrimaryKeys": {},
3604
+ "uniqueConstraints": {},
3605
+ "policies": {},
3606
+ "checkConstraints": {},
3607
+ "isRLSEnabled": false
3608
+ },
3609
+ "public.junior_review_item_assignees": {
3610
+ "name": "junior_review_item_assignees",
3611
+ "schema": "",
3612
+ "columns": {
3613
+ "item_id": {
3614
+ "name": "item_id",
3615
+ "type": "text",
3616
+ "primaryKey": false,
3617
+ "notNull": true
3618
+ },
3619
+ "user_id": {
3620
+ "name": "user_id",
3621
+ "type": "text",
3622
+ "primaryKey": false,
3623
+ "notNull": true
3624
+ }
3625
+ },
3626
+ "indexes": {
3627
+ "junior_review_item_assignees_user_idx": {
3628
+ "name": "junior_review_item_assignees_user_idx",
3629
+ "columns": [
3630
+ {
3631
+ "expression": "user_id",
3632
+ "isExpression": false,
3633
+ "asc": true,
3634
+ "nulls": "last"
3635
+ }
3636
+ ],
3637
+ "isUnique": false,
3638
+ "concurrently": false,
3639
+ "method": "btree",
3640
+ "with": {}
3641
+ }
3642
+ },
3643
+ "foreignKeys": {
3644
+ "junior_review_item_assignees_item_id_junior_review_items_id_fk": {
3645
+ "name": "junior_review_item_assignees_item_id_junior_review_items_id_fk",
3646
+ "tableFrom": "junior_review_item_assignees",
3647
+ "tableTo": "junior_review_items",
3648
+ "columnsFrom": ["item_id"],
3649
+ "columnsTo": ["id"],
3650
+ "onDelete": "cascade",
3651
+ "onUpdate": "no action"
3652
+ },
3653
+ "junior_review_item_assignees_user_id_junior_users_id_fk": {
3654
+ "name": "junior_review_item_assignees_user_id_junior_users_id_fk",
3655
+ "tableFrom": "junior_review_item_assignees",
3656
+ "tableTo": "junior_users",
3657
+ "columnsFrom": ["user_id"],
3658
+ "columnsTo": ["id"],
3659
+ "onDelete": "cascade",
3660
+ "onUpdate": "no action"
3661
+ }
3662
+ },
3663
+ "compositePrimaryKeys": {
3664
+ "junior_review_item_assignees_item_id_user_id_pk": {
3665
+ "name": "junior_review_item_assignees_item_id_user_id_pk",
3666
+ "columns": ["item_id", "user_id"]
3667
+ }
3668
+ },
3669
+ "uniqueConstraints": {},
3670
+ "policies": {},
3671
+ "checkConstraints": {},
3672
+ "isRLSEnabled": false
3673
+ },
3674
+ "public.junior_review_item_conversations": {
3675
+ "name": "junior_review_item_conversations",
3676
+ "schema": "",
3677
+ "columns": {
3678
+ "item_id": {
3679
+ "name": "item_id",
3680
+ "type": "text",
3681
+ "primaryKey": false,
3682
+ "notNull": true
3683
+ },
3684
+ "conversation_id": {
3685
+ "name": "conversation_id",
3686
+ "type": "text",
3687
+ "primaryKey": false,
3688
+ "notNull": true
3689
+ }
3690
+ },
3691
+ "indexes": {
3692
+ "junior_review_item_conversations_conversation_idx": {
3693
+ "name": "junior_review_item_conversations_conversation_idx",
3694
+ "columns": [
3695
+ {
3696
+ "expression": "conversation_id",
3697
+ "isExpression": false,
3698
+ "asc": true,
3699
+ "nulls": "last"
3700
+ }
3701
+ ],
3702
+ "isUnique": false,
3703
+ "concurrently": false,
3704
+ "method": "btree",
3705
+ "with": {}
3706
+ }
3707
+ },
3708
+ "foreignKeys": {
3709
+ "junior_review_item_conversations_item_id_junior_review_items_id_fk": {
3710
+ "name": "junior_review_item_conversations_item_id_junior_review_items_id_fk",
3711
+ "tableFrom": "junior_review_item_conversations",
3712
+ "tableTo": "junior_review_items",
3713
+ "columnsFrom": ["item_id"],
3714
+ "columnsTo": ["id"],
3715
+ "onDelete": "cascade",
3716
+ "onUpdate": "no action"
3717
+ },
3718
+ "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk": {
3719
+ "name": "junior_review_item_conversations_conversation_id_junior_conversations_conversation_id_fk",
3720
+ "tableFrom": "junior_review_item_conversations",
3721
+ "tableTo": "junior_conversations",
3722
+ "columnsFrom": ["conversation_id"],
3723
+ "columnsTo": ["conversation_id"],
3724
+ "onDelete": "cascade",
3725
+ "onUpdate": "no action"
3726
+ }
3727
+ },
3728
+ "compositePrimaryKeys": {
3729
+ "junior_review_item_conversations_item_id_conversation_id_pk": {
3730
+ "name": "junior_review_item_conversations_item_id_conversation_id_pk",
3731
+ "columns": ["item_id", "conversation_id"]
3732
+ }
3733
+ },
3734
+ "uniqueConstraints": {},
3735
+ "policies": {},
3736
+ "checkConstraints": {},
3737
+ "isRLSEnabled": false
3738
+ },
3739
+ "public.junior_review_item_slack_cards": {
3740
+ "name": "junior_review_item_slack_cards",
3741
+ "schema": "",
3742
+ "columns": {
3743
+ "item_id": {
3744
+ "name": "item_id",
3745
+ "type": "text",
3746
+ "primaryKey": false,
3747
+ "notNull": true
3748
+ },
3749
+ "conversation_id": {
3750
+ "name": "conversation_id",
3751
+ "type": "text",
3752
+ "primaryKey": false,
3753
+ "notNull": true
3754
+ },
3755
+ "team_id": {
3756
+ "name": "team_id",
3757
+ "type": "text",
3758
+ "primaryKey": false,
3759
+ "notNull": true
3760
+ },
3761
+ "channel_id": {
3762
+ "name": "channel_id",
3763
+ "type": "text",
3764
+ "primaryKey": false,
3765
+ "notNull": true
3766
+ },
3767
+ "message_ts": {
3768
+ "name": "message_ts",
3769
+ "type": "text",
3770
+ "primaryKey": false,
3771
+ "notNull": true
3772
+ }
3773
+ },
3774
+ "indexes": {},
3775
+ "foreignKeys": {
3776
+ "junior_review_item_slack_cards_item_id_junior_review_items_id_fk": {
3777
+ "name": "junior_review_item_slack_cards_item_id_junior_review_items_id_fk",
3778
+ "tableFrom": "junior_review_item_slack_cards",
3779
+ "tableTo": "junior_review_items",
3780
+ "columnsFrom": ["item_id"],
3781
+ "columnsTo": ["id"],
3782
+ "onDelete": "cascade",
3783
+ "onUpdate": "no action"
3784
+ },
3785
+ "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk": {
3786
+ "name": "junior_review_item_slack_cards_conversation_id_junior_conversations_conversation_id_fk",
3787
+ "tableFrom": "junior_review_item_slack_cards",
3788
+ "tableTo": "junior_conversations",
3789
+ "columnsFrom": ["conversation_id"],
3790
+ "columnsTo": ["conversation_id"],
3791
+ "onDelete": "cascade",
3792
+ "onUpdate": "no action"
3793
+ }
3794
+ },
3795
+ "compositePrimaryKeys": {
3796
+ "junior_review_item_slack_cards_item_id_conversation_id_pk": {
3797
+ "name": "junior_review_item_slack_cards_item_id_conversation_id_pk",
3798
+ "columns": ["item_id", "conversation_id"]
3799
+ }
3800
+ },
3801
+ "uniqueConstraints": {},
3802
+ "policies": {},
3803
+ "checkConstraints": {},
3804
+ "isRLSEnabled": false
3805
+ },
3806
+ "public.junior_review_items": {
3807
+ "name": "junior_review_items",
3808
+ "schema": "",
3809
+ "columns": {
3810
+ "id": {
3811
+ "name": "id",
3812
+ "type": "text",
3813
+ "primaryKey": true,
3814
+ "notNull": true
3815
+ },
3816
+ "kind": {
3817
+ "name": "kind",
3818
+ "type": "text",
3819
+ "primaryKey": false,
3820
+ "notNull": true
3821
+ },
3822
+ "status": {
3823
+ "name": "status",
3824
+ "type": "text",
3825
+ "primaryKey": false,
3826
+ "notNull": true
3827
+ },
3828
+ "visibility": {
3829
+ "name": "visibility",
3830
+ "type": "text",
3831
+ "primaryKey": false,
3832
+ "notNull": true
3833
+ },
3834
+ "title": {
3835
+ "name": "title",
3836
+ "type": "text",
3837
+ "primaryKey": false,
3838
+ "notNull": true
3839
+ },
3840
+ "body": {
3841
+ "name": "body",
3842
+ "type": "text",
3843
+ "primaryKey": false,
3844
+ "notNull": true
3845
+ },
3846
+ "request": {
3847
+ "name": "request",
3848
+ "type": "jsonb",
3849
+ "primaryKey": false,
3850
+ "notNull": false
3851
+ },
3852
+ "answer": {
3853
+ "name": "answer",
3854
+ "type": "jsonb",
3855
+ "primaryKey": false,
3856
+ "notNull": false
3857
+ },
3858
+ "assigned_to_everyone": {
3859
+ "name": "assigned_to_everyone",
3860
+ "type": "boolean",
3861
+ "primaryKey": false,
3862
+ "notNull": true,
3863
+ "default": false
3864
+ },
3865
+ "dedupe_key": {
3866
+ "name": "dedupe_key",
3867
+ "type": "text",
3868
+ "primaryKey": false,
3869
+ "notNull": true
3870
+ },
3871
+ "subject_id": {
3872
+ "name": "subject_id",
3873
+ "type": "text",
3874
+ "primaryKey": false,
3875
+ "notNull": false
3876
+ },
3877
+ "subject_title": {
3878
+ "name": "subject_title",
3879
+ "type": "text",
3880
+ "primaryKey": false,
3881
+ "notNull": false
3882
+ },
3883
+ "subject_url": {
3884
+ "name": "subject_url",
3885
+ "type": "text",
3886
+ "primaryKey": false,
3887
+ "notNull": false
3888
+ },
3889
+ "added_by_conversation_id": {
3890
+ "name": "added_by_conversation_id",
3891
+ "type": "text",
3892
+ "primaryKey": false,
3893
+ "notNull": true
3894
+ },
3895
+ "added_by_turn_id": {
3896
+ "name": "added_by_turn_id",
3897
+ "type": "text",
3898
+ "primaryKey": false,
3899
+ "notNull": false
3900
+ },
3901
+ "provider": {
3902
+ "name": "provider",
3903
+ "type": "text",
3904
+ "primaryKey": false,
3905
+ "notNull": false
3906
+ },
3907
+ "provider_tenant_id": {
3908
+ "name": "provider_tenant_id",
3909
+ "type": "text",
3910
+ "primaryKey": false,
3911
+ "notNull": false
3912
+ },
3913
+ "automation_id": {
3914
+ "name": "automation_id",
3915
+ "type": "text",
3916
+ "primaryKey": false,
3917
+ "notNull": false
3918
+ },
3919
+ "closed_at": {
3920
+ "name": "closed_at",
3921
+ "type": "timestamp with time zone",
3922
+ "primaryKey": false,
3923
+ "notNull": false
3924
+ },
3925
+ "closed_by_user_id": {
3926
+ "name": "closed_by_user_id",
3927
+ "type": "text",
3928
+ "primaryKey": false,
3929
+ "notNull": false
3930
+ },
3931
+ "close_reason": {
3932
+ "name": "close_reason",
3933
+ "type": "text",
3934
+ "primaryKey": false,
3935
+ "notNull": false
3936
+ },
3937
+ "created_at": {
3938
+ "name": "created_at",
3939
+ "type": "timestamp with time zone",
3940
+ "primaryKey": false,
3941
+ "notNull": true
3942
+ },
3943
+ "updated_at": {
3944
+ "name": "updated_at",
3945
+ "type": "timestamp with time zone",
3946
+ "primaryKey": false,
3947
+ "notNull": true
3948
+ }
3949
+ },
3950
+ "indexes": {
3951
+ "junior_review_items_open_dedupe_uidx": {
3952
+ "name": "junior_review_items_open_dedupe_uidx",
3953
+ "columns": [
3954
+ {
3955
+ "expression": "coalesce(\"provider\", '')",
3956
+ "asc": true,
3957
+ "isExpression": true,
3958
+ "nulls": "last"
3959
+ },
3960
+ {
3961
+ "expression": "coalesce(\"provider_tenant_id\", '')",
3962
+ "asc": true,
3963
+ "isExpression": true,
3964
+ "nulls": "last"
3965
+ },
3966
+ {
3967
+ "expression": "dedupe_key",
3968
+ "isExpression": false,
3969
+ "asc": true,
3970
+ "nulls": "last"
3971
+ }
3972
+ ],
3973
+ "isUnique": true,
3974
+ "where": "\"junior_review_items\".\"status\" = 'open'",
3975
+ "concurrently": false,
3976
+ "method": "btree",
3977
+ "with": {}
3978
+ },
3979
+ "junior_review_items_status_idx": {
3980
+ "name": "junior_review_items_status_idx",
3981
+ "columns": [
3982
+ {
3983
+ "expression": "status",
3984
+ "isExpression": false,
3985
+ "asc": true,
3986
+ "nulls": "last"
3987
+ },
3988
+ {
3989
+ "expression": "updated_at",
3990
+ "isExpression": false,
3991
+ "asc": true,
3992
+ "nulls": "last"
3993
+ },
3994
+ {
3995
+ "expression": "id",
3996
+ "isExpression": false,
3997
+ "asc": true,
3998
+ "nulls": "last"
3999
+ }
4000
+ ],
4001
+ "isUnique": false,
4002
+ "concurrently": false,
4003
+ "method": "btree",
4004
+ "with": {}
4005
+ },
4006
+ "junior_review_items_subject_idx": {
4007
+ "name": "junior_review_items_subject_idx",
4008
+ "columns": [
4009
+ {
4010
+ "expression": "subject_id",
4011
+ "isExpression": false,
4012
+ "asc": true,
4013
+ "nulls": "last"
4014
+ },
4015
+ {
4016
+ "expression": "status",
4017
+ "isExpression": false,
4018
+ "asc": true,
4019
+ "nulls": "last"
4020
+ }
4021
+ ],
4022
+ "isUnique": false,
4023
+ "concurrently": false,
4024
+ "method": "btree",
4025
+ "with": {}
4026
+ },
4027
+ "junior_review_items_automation_idx": {
4028
+ "name": "junior_review_items_automation_idx",
4029
+ "columns": [
4030
+ {
4031
+ "expression": "automation_id",
4032
+ "isExpression": false,
4033
+ "asc": true,
4034
+ "nulls": "last"
4035
+ },
4036
+ {
4037
+ "expression": "status",
4038
+ "isExpression": false,
4039
+ "asc": true,
4040
+ "nulls": "last"
4041
+ }
4042
+ ],
4043
+ "isUnique": false,
4044
+ "concurrently": false,
4045
+ "method": "btree",
4046
+ "with": {}
4047
+ }
4048
+ },
4049
+ "foreignKeys": {
4050
+ "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk": {
4051
+ "name": "junior_review_items_added_by_conversation_id_junior_conversations_conversation_id_fk",
4052
+ "tableFrom": "junior_review_items",
4053
+ "tableTo": "junior_conversations",
4054
+ "columnsFrom": ["added_by_conversation_id"],
4055
+ "columnsTo": ["conversation_id"],
4056
+ "onDelete": "cascade",
4057
+ "onUpdate": "no action"
4058
+ },
4059
+ "junior_review_items_automation_id_junior_automations_id_fk": {
4060
+ "name": "junior_review_items_automation_id_junior_automations_id_fk",
4061
+ "tableFrom": "junior_review_items",
4062
+ "tableTo": "junior_automations",
4063
+ "columnsFrom": ["automation_id"],
4064
+ "columnsTo": ["id"],
4065
+ "onDelete": "set null",
4066
+ "onUpdate": "no action"
4067
+ },
4068
+ "junior_review_items_closed_by_user_id_junior_users_id_fk": {
4069
+ "name": "junior_review_items_closed_by_user_id_junior_users_id_fk",
4070
+ "tableFrom": "junior_review_items",
4071
+ "tableTo": "junior_users",
4072
+ "columnsFrom": ["closed_by_user_id"],
4073
+ "columnsTo": ["id"],
4074
+ "onDelete": "set null",
4075
+ "onUpdate": "no action"
4076
+ }
4077
+ },
4078
+ "compositePrimaryKeys": {},
4079
+ "uniqueConstraints": {},
4080
+ "policies": {},
4081
+ "checkConstraints": {
4082
+ "junior_review_items_kind_check": {
4083
+ "name": "junior_review_items_kind_check",
4084
+ "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)))"
4085
+ },
4086
+ "junior_review_items_status_check": {
4087
+ "name": "junior_review_items_status_check",
4088
+ "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)"
4089
+ },
4090
+ "junior_review_items_tenant_check": {
4091
+ "name": "junior_review_items_tenant_check",
4092
+ "value": "(\"junior_review_items\".\"provider\" is null) = (\"junior_review_items\".\"provider_tenant_id\" is null)"
4093
+ },
4094
+ "junior_review_items_visibility_check": {
4095
+ "name": "junior_review_items_visibility_check",
4096
+ "value": "\"junior_review_items\".\"visibility\" = 'public' or not \"junior_review_items\".\"assigned_to_everyone\""
4097
+ }
4098
+ },
4099
+ "isRLSEnabled": false
4100
+ },
4101
+ "public.junior_snapshots": {
4102
+ "name": "junior_snapshots",
4103
+ "schema": "",
4104
+ "columns": {
4105
+ "id": {
4106
+ "name": "id",
4107
+ "type": "text",
4108
+ "primaryKey": true,
4109
+ "notNull": true
4110
+ },
4111
+ "workspace_id": {
4112
+ "name": "workspace_id",
4113
+ "type": "text",
4114
+ "primaryKey": false,
4115
+ "notNull": true
4116
+ },
4117
+ "profile_hash": {
4118
+ "name": "profile_hash",
4119
+ "type": "text",
4120
+ "primaryKey": false,
4121
+ "notNull": true
4122
+ },
4123
+ "status": {
4124
+ "name": "status",
4125
+ "type": "text",
4126
+ "primaryKey": false,
4127
+ "notNull": true
4128
+ },
4129
+ "snapshot_id": {
4130
+ "name": "snapshot_id",
4131
+ "type": "text",
4132
+ "primaryKey": false,
4133
+ "notNull": false
4134
+ },
4135
+ "build_duration_ms": {
4136
+ "name": "build_duration_ms",
4137
+ "type": "integer",
4138
+ "primaryKey": false,
4139
+ "notNull": false
4140
+ },
4141
+ "size_bytes": {
4142
+ "name": "size_bytes",
4143
+ "type": "bigint",
4144
+ "primaryKey": false,
4145
+ "notNull": false
4146
+ },
4147
+ "generated_at": {
4148
+ "name": "generated_at",
4149
+ "type": "timestamp with time zone",
4150
+ "primaryKey": false,
4151
+ "notNull": false
4152
+ },
4153
+ "build_started_at": {
4154
+ "name": "build_started_at",
4155
+ "type": "timestamp with time zone",
4156
+ "primaryKey": false,
4157
+ "notNull": false
4158
+ },
4159
+ "build_phase": {
4160
+ "name": "build_phase",
4161
+ "type": "text",
4162
+ "primaryKey": false,
4163
+ "notNull": false
4164
+ },
4165
+ "build_sandbox_name": {
4166
+ "name": "build_sandbox_name",
4167
+ "type": "text",
4168
+ "primaryKey": false,
4169
+ "notNull": false
4170
+ },
4171
+ "build_command_id": {
4172
+ "name": "build_command_id",
4173
+ "type": "text",
4174
+ "primaryKey": false,
4175
+ "notNull": false
4176
+ },
4177
+ "build_error": {
4178
+ "name": "build_error",
4179
+ "type": "text",
4180
+ "primaryKey": false,
4181
+ "notNull": false
4182
+ },
4183
+ "created_at": {
4184
+ "name": "created_at",
4185
+ "type": "timestamp with time zone",
4186
+ "primaryKey": false,
4187
+ "notNull": true
4188
+ },
4189
+ "updated_at": {
4190
+ "name": "updated_at",
4191
+ "type": "timestamp with time zone",
4192
+ "primaryKey": false,
4193
+ "notNull": true
4194
+ }
4195
+ },
4196
+ "indexes": {
4197
+ "junior_snapshots_snapshot_id_uidx": {
4198
+ "name": "junior_snapshots_snapshot_id_uidx",
4199
+ "columns": [
4200
+ {
4201
+ "expression": "snapshot_id",
4202
+ "isExpression": false,
4203
+ "asc": true,
4204
+ "nulls": "last"
4205
+ }
4206
+ ],
4207
+ "isUnique": true,
4208
+ "concurrently": false,
4209
+ "method": "btree",
4210
+ "with": {}
4211
+ },
4212
+ "junior_snapshots_workspace_idx": {
4213
+ "name": "junior_snapshots_workspace_idx",
4214
+ "columns": [
4215
+ {
4216
+ "expression": "workspace_id",
4217
+ "isExpression": false,
4218
+ "asc": true,
4219
+ "nulls": "last"
4220
+ }
4221
+ ],
4222
+ "isUnique": false,
4223
+ "concurrently": false,
4224
+ "method": "btree",
4225
+ "with": {}
4226
+ },
4227
+ "junior_snapshots_workspace_profile_status_idx": {
4228
+ "name": "junior_snapshots_workspace_profile_status_idx",
4229
+ "columns": [
4230
+ {
4231
+ "expression": "workspace_id",
4232
+ "isExpression": false,
4233
+ "asc": true,
4234
+ "nulls": "last"
4235
+ },
4236
+ {
4237
+ "expression": "profile_hash",
4238
+ "isExpression": false,
4239
+ "asc": true,
4240
+ "nulls": "last"
4241
+ },
4242
+ {
4243
+ "expression": "status",
4244
+ "isExpression": false,
4245
+ "asc": true,
4246
+ "nulls": "last"
4247
+ }
4248
+ ],
4249
+ "isUnique": false,
4250
+ "concurrently": false,
4251
+ "method": "btree",
4252
+ "with": {}
4253
+ },
4254
+ "junior_snapshots_active_build_uidx": {
4255
+ "name": "junior_snapshots_active_build_uidx",
4256
+ "columns": [
4257
+ {
4258
+ "expression": "workspace_id",
4259
+ "isExpression": false,
4260
+ "asc": true,
4261
+ "nulls": "last"
4262
+ },
4263
+ {
4264
+ "expression": "profile_hash",
4265
+ "isExpression": false,
4266
+ "asc": true,
4267
+ "nulls": "last"
4268
+ }
4269
+ ],
4270
+ "isUnique": true,
4271
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
4272
+ "concurrently": false,
4273
+ "method": "btree",
4274
+ "with": {}
4275
+ },
4276
+ "junior_snapshots_workspace_status_idx": {
4277
+ "name": "junior_snapshots_workspace_status_idx",
4278
+ "columns": [
4279
+ {
4280
+ "expression": "workspace_id",
4281
+ "isExpression": false,
4282
+ "asc": true,
4283
+ "nulls": "last"
4284
+ },
4285
+ {
4286
+ "expression": "status",
4287
+ "isExpression": false,
4288
+ "asc": true,
4289
+ "nulls": "last"
4290
+ }
4291
+ ],
4292
+ "isUnique": false,
4293
+ "concurrently": false,
4294
+ "method": "btree",
4295
+ "with": {}
4296
+ }
4297
+ },
4298
+ "foreignKeys": {
4299
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
4300
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
4301
+ "tableFrom": "junior_snapshots",
4302
+ "tableTo": "junior_workspaces",
4303
+ "columnsFrom": ["workspace_id"],
4304
+ "columnsTo": ["id"],
4305
+ "onDelete": "cascade",
4306
+ "onUpdate": "no action"
4307
+ }
4308
+ },
4309
+ "compositePrimaryKeys": {},
4310
+ "uniqueConstraints": {},
4311
+ "policies": {},
4312
+ "checkConstraints": {
4313
+ "junior_snapshots_status_check": {
4314
+ "name": "junior_snapshots_status_check",
4315
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
4316
+ },
4317
+ "junior_snapshots_build_phase_check": {
4318
+ "name": "junior_snapshots_build_phase_check",
4319
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
4320
+ },
4321
+ "junior_snapshots_ready_fields_check": {
4322
+ "name": "junior_snapshots_ready_fields_check",
4323
+ "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)"
4324
+ },
4325
+ "junior_snapshots_build_fields_check": {
4326
+ "name": "junior_snapshots_build_fields_check",
4327
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
4328
+ },
4329
+ "junior_snapshots_build_duration_check": {
4330
+ "name": "junior_snapshots_build_duration_check",
4331
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
4332
+ },
4333
+ "junior_snapshots_size_bytes_check": {
4334
+ "name": "junior_snapshots_size_bytes_check",
4335
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
4336
+ }
4337
+ },
4338
+ "isRLSEnabled": false
4339
+ },
4340
+ "public.junior_stats": {
4341
+ "name": "junior_stats",
4342
+ "schema": "",
4343
+ "columns": {
4344
+ "date": {
4345
+ "name": "date",
4346
+ "type": "date",
4347
+ "primaryKey": false,
4348
+ "notNull": true
4349
+ },
4350
+ "namespace": {
4351
+ "name": "namespace",
4352
+ "type": "text",
4353
+ "primaryKey": false,
4354
+ "notNull": true
4355
+ },
4356
+ "metric": {
4357
+ "name": "metric",
4358
+ "type": "text",
4359
+ "primaryKey": false,
4360
+ "notNull": true
4361
+ },
4362
+ "name": {
4363
+ "name": "name",
4364
+ "type": "text",
4365
+ "primaryKey": false,
4366
+ "notNull": true
4367
+ },
4368
+ "count": {
4369
+ "name": "count",
4370
+ "type": "integer",
4371
+ "primaryKey": false,
4372
+ "notNull": true,
4373
+ "default": 0
4374
+ }
4375
+ },
4376
+ "indexes": {},
4377
+ "foreignKeys": {},
4378
+ "compositePrimaryKeys": {
4379
+ "junior_stats_date_namespace_metric_name_pk": {
4380
+ "name": "junior_stats_date_namespace_metric_name_pk",
4381
+ "columns": ["date", "namespace", "metric", "name"]
4382
+ }
4383
+ },
4384
+ "uniqueConstraints": {},
4385
+ "policies": {},
4386
+ "checkConstraints": {},
4387
+ "isRLSEnabled": false
4388
+ },
4389
+ "public.junior_users": {
4390
+ "name": "junior_users",
4391
+ "schema": "",
4392
+ "columns": {
4393
+ "id": {
4394
+ "name": "id",
4395
+ "type": "text",
4396
+ "primaryKey": true,
4397
+ "notNull": true
4398
+ },
4399
+ "primary_email": {
4400
+ "name": "primary_email",
4401
+ "type": "text",
4402
+ "primaryKey": false,
4403
+ "notNull": true
4404
+ },
4405
+ "primary_email_normalized": {
4406
+ "name": "primary_email_normalized",
4407
+ "type": "text",
4408
+ "primaryKey": false,
4409
+ "notNull": true
4410
+ },
4411
+ "display_name": {
4412
+ "name": "display_name",
4413
+ "type": "text",
4414
+ "primaryKey": false,
4415
+ "notNull": false
4416
+ },
4417
+ "timezone": {
4418
+ "name": "timezone",
4419
+ "type": "text",
4420
+ "primaryKey": false,
4421
+ "notNull": false
4422
+ },
4423
+ "customization": {
4424
+ "name": "customization",
4425
+ "type": "text",
4426
+ "primaryKey": false,
4427
+ "notNull": false
4428
+ },
4429
+ "notification_schedule": {
4430
+ "name": "notification_schedule",
4431
+ "type": "jsonb",
4432
+ "primaryKey": false,
4433
+ "notNull": false
4434
+ },
4435
+ "is_admin": {
4436
+ "name": "is_admin",
4437
+ "type": "boolean",
4438
+ "primaryKey": false,
4439
+ "notNull": true,
4440
+ "default": false
4441
+ },
4442
+ "auto_archive_default": {
4443
+ "name": "auto_archive_default",
4444
+ "type": "boolean",
4445
+ "primaryKey": false,
4446
+ "notNull": true,
4447
+ "default": false
4448
+ },
4449
+ "auto_archive_grace_hours": {
4450
+ "name": "auto_archive_grace_hours",
4451
+ "type": "integer",
4452
+ "primaryKey": false,
4453
+ "notNull": true,
4454
+ "default": 24
4455
+ },
4456
+ "created_at": {
4457
+ "name": "created_at",
4458
+ "type": "timestamp with time zone",
4459
+ "primaryKey": false,
4460
+ "notNull": true
4461
+ },
4462
+ "updated_at": {
4463
+ "name": "updated_at",
4464
+ "type": "timestamp with time zone",
4465
+ "primaryKey": false,
4466
+ "notNull": true
4467
+ }
4468
+ },
4469
+ "indexes": {
4470
+ "junior_users_primary_email_normalized_uidx": {
4471
+ "name": "junior_users_primary_email_normalized_uidx",
4472
+ "columns": [
4473
+ {
4474
+ "expression": "primary_email_normalized",
4475
+ "isExpression": false,
4476
+ "asc": true,
4477
+ "nulls": "last"
4478
+ }
4479
+ ],
4480
+ "isUnique": true,
4481
+ "concurrently": false,
4482
+ "method": "btree",
4483
+ "with": {}
4484
+ }
4485
+ },
4486
+ "foreignKeys": {},
4487
+ "compositePrimaryKeys": {},
4488
+ "uniqueConstraints": {},
4489
+ "policies": {},
4490
+ "checkConstraints": {},
4491
+ "isRLSEnabled": false
4492
+ },
4493
+ "public.junior_workspace_repos": {
4494
+ "name": "junior_workspace_repos",
4495
+ "schema": "",
4496
+ "columns": {
4497
+ "workspace_id": {
4498
+ "name": "workspace_id",
4499
+ "type": "text",
4500
+ "primaryKey": false,
4501
+ "notNull": true
4502
+ },
4503
+ "provider": {
4504
+ "name": "provider",
4505
+ "type": "text",
4506
+ "primaryKey": false,
4507
+ "notNull": true
4508
+ },
4509
+ "repo": {
4510
+ "name": "repo",
4511
+ "type": "text",
4512
+ "primaryKey": false,
4513
+ "notNull": true
4514
+ }
4515
+ },
4516
+ "indexes": {},
4517
+ "foreignKeys": {
4518
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
4519
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
4520
+ "tableFrom": "junior_workspace_repos",
4521
+ "tableTo": "junior_workspaces",
4522
+ "columnsFrom": ["workspace_id"],
4523
+ "columnsTo": ["id"],
4524
+ "onDelete": "cascade",
4525
+ "onUpdate": "no action"
4526
+ }
4527
+ },
4528
+ "compositePrimaryKeys": {
4529
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
4530
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
4531
+ "columns": ["workspace_id", "provider", "repo"]
4532
+ }
4533
+ },
4534
+ "uniqueConstraints": {},
4535
+ "policies": {},
4536
+ "checkConstraints": {},
4537
+ "isRLSEnabled": false
4538
+ },
4539
+ "public.junior_workspaces": {
4540
+ "name": "junior_workspaces",
4541
+ "schema": "",
4542
+ "columns": {
4543
+ "id": {
4544
+ "name": "id",
4545
+ "type": "text",
4546
+ "primaryKey": true,
4547
+ "notNull": true
4548
+ },
4549
+ "name": {
4550
+ "name": "name",
4551
+ "type": "text",
4552
+ "primaryKey": false,
4553
+ "notNull": true
4554
+ },
4555
+ "setup_script": {
4556
+ "name": "setup_script",
4557
+ "type": "text",
4558
+ "primaryKey": false,
4559
+ "notNull": true,
4560
+ "default": "''"
4561
+ },
4562
+ "vcpus": {
4563
+ "name": "vcpus",
4564
+ "type": "integer",
4565
+ "primaryKey": false,
4566
+ "notNull": false
4567
+ },
4568
+ "created_at": {
4569
+ "name": "created_at",
4570
+ "type": "timestamp with time zone",
4571
+ "primaryKey": false,
4572
+ "notNull": true
4573
+ },
4574
+ "updated_at": {
4575
+ "name": "updated_at",
4576
+ "type": "timestamp with time zone",
4577
+ "primaryKey": false,
4578
+ "notNull": true
4579
+ }
4580
+ },
4581
+ "indexes": {
4582
+ "junior_workspaces_name_idx": {
4583
+ "name": "junior_workspaces_name_idx",
4584
+ "columns": [
4585
+ {
4586
+ "expression": "name",
4587
+ "isExpression": false,
4588
+ "asc": true,
4589
+ "nulls": "last"
4590
+ }
4591
+ ],
4592
+ "isUnique": true,
4593
+ "concurrently": false,
4594
+ "method": "btree",
4595
+ "with": {}
4596
+ }
4597
+ },
4598
+ "foreignKeys": {},
4599
+ "compositePrimaryKeys": {},
4600
+ "uniqueConstraints": {},
4601
+ "policies": {},
4602
+ "checkConstraints": {},
4603
+ "isRLSEnabled": false
4604
+ }
4605
+ },
4606
+ "enums": {},
4607
+ "schemas": {},
4608
+ "sequences": {},
4609
+ "roles": {},
4610
+ "policies": {},
4611
+ "views": {},
4612
+ "_meta": {
4613
+ "columns": {},
4614
+ "schemas": {},
4615
+ "tables": {}
4616
+ }
4617
+ }