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