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