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