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