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