@sentry/junior 0.182.0 → 0.183.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 (86) hide show
  1. package/dist/{agent-hooks-3S25UIHO.js → agent-hooks-SNRBZYAU.js} +11 -11
  2. package/dist/api/code/overview.d.ts +35 -0
  3. package/dist/api/code/routes.d.ts +4 -0
  4. package/dist/api/schema/code.d.ts +75 -0
  5. package/dist/api/schema.d.ts +2 -0
  6. package/dist/api/schema.js +9 -1
  7. package/dist/api.js +258 -134
  8. package/dist/app.js +71 -48
  9. package/dist/{catalog-runtime-ESLMBQBV.js → catalog-runtime-3I3JOIIH.js} +4 -4
  10. package/dist/chat/agent-invocations/store.d.ts +4 -2
  11. package/dist/chat/agent-invocations/work.d.ts +1 -3
  12. package/dist/chat/app/factory.d.ts +3 -3
  13. package/dist/chat/app/services.d.ts +3 -3
  14. package/dist/chat/code/publisher.d.ts +3 -0
  15. package/dist/chat/code/store.d.ts +9 -0
  16. package/dist/chat/event-tasks/store.d.ts +10 -0
  17. package/dist/chat/ingress/slack-webhook.d.ts +1 -1
  18. package/dist/chat/plugins/agent-hooks.d.ts +5 -0
  19. package/dist/chat/{runtime/slack-runtime.d.ts → providers/slack/runtime.d.ts} +2 -2
  20. package/dist/chat/{runtime/reply-executor.d.ts → providers/slack/turn.d.ts} +10 -9
  21. package/dist/chat/resource-events/store.d.ts +12 -0
  22. package/dist/chat/runtime/turn-execution.d.ts +30 -0
  23. package/dist/chat/slack/dispatch-turn.d.ts +12 -14
  24. package/dist/chat/task-execution/slack-work.d.ts +1 -1
  25. package/dist/{chunk-SXOZIG5X.js → chunk-24OJZ5OU.js} +6 -6
  26. package/dist/{chunk-SVFSYQMT.js → chunk-2ADFGSUS.js} +1 -1
  27. package/dist/{chunk-GGYA5NPN.js → chunk-2EPYYVJC.js} +8 -8
  28. package/dist/{chunk-KGMHUDVF.js → chunk-35PM4YY5.js} +6 -6
  29. package/dist/{chunk-3ENUMZNG.js → chunk-37IQ6DGU.js} +3 -3
  30. package/dist/{chunk-3THPTNN6.js → chunk-3HJ4F4L7.js} +4 -4
  31. package/dist/{chunk-3NFHI2NA.js → chunk-3L7CWDQQ.js} +1 -1
  32. package/dist/{chunk-CVBIM4Z3.js → chunk-4WGFWHWP.js} +1 -1
  33. package/dist/{chunk-YHL2L2ZZ.js → chunk-56XONJPF.js} +1 -1
  34. package/dist/{chunk-44BQ3TSK.js → chunk-6UXDTPEN.js} +233 -173
  35. package/dist/{chunk-2CEOXDG2.js → chunk-AHMWPFIW.js} +174 -6
  36. package/dist/{chunk-6TSWXBTQ.js → chunk-AX3UDIMA.js} +3 -3
  37. package/dist/{chunk-S35OZMSL.js → chunk-AYW7J6K4.js} +13 -13
  38. package/dist/{chunk-WOIALVN2.js → chunk-E3OBGRHN.js} +1 -1
  39. package/dist/{chunk-4DZ62L36.js → chunk-EENQGEIP.js} +1 -1
  40. package/dist/{chunk-UUMBHORH.js → chunk-FJMTMGBC.js} +1 -1
  41. package/dist/{chunk-Z7ALSQS3.js → chunk-G2B2XZQW.js} +1 -1
  42. package/dist/{chunk-TEFNHMO2.js → chunk-HUK5XIZL.js} +4 -4
  43. package/dist/{chunk-LT4QYGKM.js → chunk-IO6KFXYE.js} +160 -97
  44. package/dist/{chunk-JIOKUIAS.js → chunk-KTXOGLNE.js} +2 -2
  45. package/dist/{chunk-LHQK5XCU.js → chunk-LMNMMESF.js} +2 -2
  46. package/dist/{chunk-UQP54CXZ.js → chunk-LZBPGX5A.js} +1 -1
  47. package/dist/{chunk-PQES5LB5.js → chunk-PLZT45VC.js} +5 -5
  48. package/dist/{chunk-V5UZCCNW.js → chunk-QI5JW5AG.js} +6 -6
  49. package/dist/{chunk-A7THOQ6N.js → chunk-QZV76CM4.js} +21 -21
  50. package/dist/{chunk-LB4FWMCV.js → chunk-R767Y7QV.js} +183 -155
  51. package/dist/{chunk-MJISSOWB.js → chunk-SQHFVIMZ.js} +1 -1
  52. package/dist/{chunk-BDDWVY32.js → chunk-T5MTGX2E.js} +19 -19
  53. package/dist/{chunk-DZR3L74W.js → chunk-V64JCZUV.js} +3 -3
  54. package/dist/{chunk-VHMAFMHB.js → chunk-VOV3SCM3.js} +1 -1
  55. package/dist/{chunk-BZD4ADQH.js → chunk-W46NIB5H.js} +1 -1
  56. package/dist/{chunk-QHALFHZA.js → chunk-W5JMPEBO.js} +9 -9
  57. package/dist/{chunk-D6OHGAIO.js → chunk-WOKJRLM2.js} +5 -5
  58. package/dist/chunk-WVIA7V3M.js +975 -0
  59. package/dist/{chunk-UKIHNBBD.js → chunk-X52ESOBP.js} +3 -3
  60. package/dist/cli/chat.js +33 -35
  61. package/dist/cli/check.js +5 -5
  62. package/dist/cli/plugins.js +12 -12
  63. package/dist/cli/snapshot-create.js +9 -9
  64. package/dist/cli/upgrade.js +6 -6
  65. package/dist/db/schema/code.d.ts +367 -0
  66. package/dist/db/schema.d.ts +367 -1
  67. package/dist/{db-NYIWZ4L5.js → db-K2VMNLHQ.js} +6 -6
  68. package/dist/instrumentation.js +3 -3
  69. package/dist/nitro.js +6 -6
  70. package/dist/{oauth-callback-server-A2YTPVVX.js → oauth-callback-server-DZZMTKSS.js} +25 -25
  71. package/dist/{runner-VKAEU52J.js → runner-IIAKWDXI.js} +18 -18
  72. package/dist/{skills-52GMXUTY.js → skills-EXIQ7BP5.js} +5 -5
  73. package/dist/spawn-ZR6OOEAN.js +37 -0
  74. package/dist/task-runner-C52HYCVD.js +32 -0
  75. package/dist/{validation-VD2YQX2W.js → validation-XUGIWBJF.js} +5 -5
  76. package/dist/version.js +1 -1
  77. package/dist/{work-ZWBTGEQP.js → work-G4RLJ634.js} +18 -18
  78. package/dist/worker-R2JEHK67.js +22 -0
  79. package/migrations/0036_complex_rage.sql +32 -0
  80. package/migrations/meta/0036_snapshot.json +3186 -0
  81. package/migrations/meta/_journal.json +8 -1
  82. package/package.json +6 -6
  83. package/dist/chunk-CZYNWPWD.js +0 -930
  84. package/dist/spawn-GSS4EBLR.js +0 -37
  85. package/dist/task-runner-DUGDWF5O.js +0 -32
  86. package/dist/worker-XUWD5WS7.js +0 -22
@@ -0,0 +1,3186 @@
1
+ {
2
+ "id": "7afb21c1-f6f3-4369-a7bb-7a29e0af3226",
3
+ "prevId": "7268868b-d27e-4f42-a0f4-6c981de70f1a",
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
+ "actor_json": {
113
+ "name": "actor_json",
114
+ "type": "jsonb",
115
+ "primaryKey": false,
116
+ "notNull": true
117
+ },
118
+ "credential_context_json": {
119
+ "name": "credential_context_json",
120
+ "type": "jsonb",
121
+ "primaryKey": false,
122
+ "notNull": false
123
+ },
124
+ "source_json": {
125
+ "name": "source_json",
126
+ "type": "jsonb",
127
+ "primaryKey": false,
128
+ "notNull": true
129
+ },
130
+ "destination_json": {
131
+ "name": "destination_json",
132
+ "type": "jsonb",
133
+ "primaryKey": false,
134
+ "notNull": true
135
+ },
136
+ "destination_visibility": {
137
+ "name": "destination_visibility",
138
+ "type": "text",
139
+ "primaryKey": false,
140
+ "notNull": false
141
+ },
142
+ "reasoning_level": {
143
+ "name": "reasoning_level",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": false
147
+ },
148
+ "status": {
149
+ "name": "status",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": true
153
+ },
154
+ "mailbox_status": {
155
+ "name": "mailbox_status",
156
+ "type": "text",
157
+ "primaryKey": false,
158
+ "notNull": true
159
+ },
160
+ "result": {
161
+ "name": "result",
162
+ "type": "text",
163
+ "primaryKey": false,
164
+ "notNull": false
165
+ },
166
+ "error_message": {
167
+ "name": "error_message",
168
+ "type": "text",
169
+ "primaryKey": false,
170
+ "notNull": false
171
+ },
172
+ "created_at": {
173
+ "name": "created_at",
174
+ "type": "timestamp with time zone",
175
+ "primaryKey": false,
176
+ "notNull": true
177
+ },
178
+ "updated_at": {
179
+ "name": "updated_at",
180
+ "type": "timestamp with time zone",
181
+ "primaryKey": false,
182
+ "notNull": true
183
+ },
184
+ "terminal_at": {
185
+ "name": "terminal_at",
186
+ "type": "timestamp with time zone",
187
+ "primaryKey": false,
188
+ "notNull": false
189
+ }
190
+ },
191
+ "indexes": {
192
+ "junior_agent_invocations_child_idx": {
193
+ "name": "junior_agent_invocations_child_idx",
194
+ "columns": [
195
+ {
196
+ "expression": "child_conversation_id",
197
+ "isExpression": false,
198
+ "asc": true,
199
+ "nulls": "last"
200
+ }
201
+ ],
202
+ "isUnique": false,
203
+ "concurrently": false,
204
+ "method": "btree",
205
+ "with": {}
206
+ },
207
+ "junior_agent_invocations_mailbox_idx": {
208
+ "name": "junior_agent_invocations_mailbox_idx",
209
+ "columns": [
210
+ {
211
+ "expression": "mailbox_status",
212
+ "isExpression": false,
213
+ "asc": true,
214
+ "nulls": "last"
215
+ },
216
+ {
217
+ "expression": "created_at",
218
+ "isExpression": false,
219
+ "asc": true,
220
+ "nulls": "last"
221
+ }
222
+ ],
223
+ "isUnique": false,
224
+ "concurrently": false,
225
+ "method": "btree",
226
+ "with": {}
227
+ }
228
+ },
229
+ "foreignKeys": {
230
+ "junior_agent_invocations_parent_conversation_id_junior_conversations_conversation_id_fk": {
231
+ "name": "junior_agent_invocations_parent_conversation_id_junior_conversations_conversation_id_fk",
232
+ "tableFrom": "junior_agent_invocations",
233
+ "tableTo": "junior_conversations",
234
+ "columnsFrom": ["parent_conversation_id"],
235
+ "columnsTo": ["conversation_id"],
236
+ "onDelete": "no action",
237
+ "onUpdate": "no action"
238
+ },
239
+ "junior_agent_invocations_child_conversation_id_junior_conversations_conversation_id_fk": {
240
+ "name": "junior_agent_invocations_child_conversation_id_junior_conversations_conversation_id_fk",
241
+ "tableFrom": "junior_agent_invocations",
242
+ "tableTo": "junior_conversations",
243
+ "columnsFrom": ["child_conversation_id"],
244
+ "columnsTo": ["conversation_id"],
245
+ "onDelete": "no action",
246
+ "onUpdate": "no action"
247
+ }
248
+ },
249
+ "compositePrimaryKeys": {},
250
+ "uniqueConstraints": {},
251
+ "policies": {},
252
+ "checkConstraints": {},
253
+ "isRLSEnabled": false
254
+ },
255
+ "public.junior_api_tokens": {
256
+ "name": "junior_api_tokens",
257
+ "schema": "",
258
+ "columns": {
259
+ "id": {
260
+ "name": "id",
261
+ "type": "text",
262
+ "primaryKey": true,
263
+ "notNull": true
264
+ },
265
+ "owner_email_normalized": {
266
+ "name": "owner_email_normalized",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": true
270
+ },
271
+ "name": {
272
+ "name": "name",
273
+ "type": "text",
274
+ "primaryKey": false,
275
+ "notNull": true
276
+ },
277
+ "token_hash": {
278
+ "name": "token_hash",
279
+ "type": "text",
280
+ "primaryKey": false,
281
+ "notNull": true
282
+ },
283
+ "token_suffix": {
284
+ "name": "token_suffix",
285
+ "type": "text",
286
+ "primaryKey": false,
287
+ "notNull": true
288
+ },
289
+ "created_at": {
290
+ "name": "created_at",
291
+ "type": "timestamp with time zone",
292
+ "primaryKey": false,
293
+ "notNull": true
294
+ },
295
+ "expires_at": {
296
+ "name": "expires_at",
297
+ "type": "timestamp with time zone",
298
+ "primaryKey": false,
299
+ "notNull": true
300
+ },
301
+ "last_used_at": {
302
+ "name": "last_used_at",
303
+ "type": "timestamp with time zone",
304
+ "primaryKey": false,
305
+ "notNull": false
306
+ },
307
+ "revoked_at": {
308
+ "name": "revoked_at",
309
+ "type": "timestamp with time zone",
310
+ "primaryKey": false,
311
+ "notNull": false
312
+ }
313
+ },
314
+ "indexes": {
315
+ "junior_api_tokens_token_hash_uidx": {
316
+ "name": "junior_api_tokens_token_hash_uidx",
317
+ "columns": [
318
+ {
319
+ "expression": "token_hash",
320
+ "isExpression": false,
321
+ "asc": true,
322
+ "nulls": "last"
323
+ }
324
+ ],
325
+ "isUnique": true,
326
+ "concurrently": false,
327
+ "method": "btree",
328
+ "with": {}
329
+ },
330
+ "junior_api_tokens_owner_email_idx": {
331
+ "name": "junior_api_tokens_owner_email_idx",
332
+ "columns": [
333
+ {
334
+ "expression": "owner_email_normalized",
335
+ "isExpression": false,
336
+ "asc": true,
337
+ "nulls": "last"
338
+ }
339
+ ],
340
+ "isUnique": false,
341
+ "concurrently": false,
342
+ "method": "btree",
343
+ "with": {}
344
+ }
345
+ },
346
+ "foreignKeys": {},
347
+ "compositePrimaryKeys": {},
348
+ "uniqueConstraints": {},
349
+ "policies": {},
350
+ "checkConstraints": {},
351
+ "isRLSEnabled": false
352
+ },
353
+ "public.junior_artifacts": {
354
+ "name": "junior_artifacts",
355
+ "schema": "",
356
+ "columns": {
357
+ "id": {
358
+ "name": "id",
359
+ "type": "text",
360
+ "primaryKey": true,
361
+ "notNull": true
362
+ },
363
+ "conversation_id": {
364
+ "name": "conversation_id",
365
+ "type": "text",
366
+ "primaryKey": false,
367
+ "notNull": true
368
+ },
369
+ "sha256": {
370
+ "name": "sha256",
371
+ "type": "text",
372
+ "primaryKey": false,
373
+ "notNull": true
374
+ },
375
+ "ext": {
376
+ "name": "ext",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": true
380
+ },
381
+ "storage_key": {
382
+ "name": "storage_key",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": true
386
+ },
387
+ "content_type": {
388
+ "name": "content_type",
389
+ "type": "text",
390
+ "primaryKey": false,
391
+ "notNull": true
392
+ },
393
+ "bytes": {
394
+ "name": "bytes",
395
+ "type": "integer",
396
+ "primaryKey": false,
397
+ "notNull": true
398
+ },
399
+ "public": {
400
+ "name": "public",
401
+ "type": "boolean",
402
+ "primaryKey": false,
403
+ "notNull": true
404
+ },
405
+ "created_at": {
406
+ "name": "created_at",
407
+ "type": "timestamp with time zone",
408
+ "primaryKey": false,
409
+ "notNull": true
410
+ },
411
+ "delete_requested_at": {
412
+ "name": "delete_requested_at",
413
+ "type": "timestamp with time zone",
414
+ "primaryKey": false,
415
+ "notNull": false
416
+ }
417
+ },
418
+ "indexes": {
419
+ "junior_artifacts_conversation_sha_uidx": {
420
+ "name": "junior_artifacts_conversation_sha_uidx",
421
+ "columns": [
422
+ {
423
+ "expression": "conversation_id",
424
+ "isExpression": false,
425
+ "asc": true,
426
+ "nulls": "last"
427
+ },
428
+ {
429
+ "expression": "sha256",
430
+ "isExpression": false,
431
+ "asc": true,
432
+ "nulls": "last"
433
+ }
434
+ ],
435
+ "isUnique": true,
436
+ "concurrently": false,
437
+ "method": "btree",
438
+ "with": {}
439
+ },
440
+ "junior_artifacts_gc_idx": {
441
+ "name": "junior_artifacts_gc_idx",
442
+ "columns": [
443
+ {
444
+ "expression": "delete_requested_at",
445
+ "isExpression": false,
446
+ "asc": true,
447
+ "nulls": "last"
448
+ },
449
+ {
450
+ "expression": "created_at",
451
+ "isExpression": false,
452
+ "asc": true,
453
+ "nulls": "last"
454
+ }
455
+ ],
456
+ "isUnique": false,
457
+ "concurrently": false,
458
+ "method": "btree",
459
+ "with": {}
460
+ },
461
+ "junior_artifacts_conversation_idx": {
462
+ "name": "junior_artifacts_conversation_idx",
463
+ "columns": [
464
+ {
465
+ "expression": "conversation_id",
466
+ "isExpression": false,
467
+ "asc": true,
468
+ "nulls": "last"
469
+ }
470
+ ],
471
+ "isUnique": false,
472
+ "concurrently": false,
473
+ "method": "btree",
474
+ "with": {}
475
+ }
476
+ },
477
+ "foreignKeys": {},
478
+ "compositePrimaryKeys": {},
479
+ "uniqueConstraints": {},
480
+ "policies": {},
481
+ "checkConstraints": {},
482
+ "isRLSEnabled": false
483
+ },
484
+ "public.junior_attachments": {
485
+ "name": "junior_attachments",
486
+ "schema": "",
487
+ "columns": {
488
+ "id": {
489
+ "name": "id",
490
+ "type": "text",
491
+ "primaryKey": true,
492
+ "notNull": true
493
+ },
494
+ "conversation_id": {
495
+ "name": "conversation_id",
496
+ "type": "text",
497
+ "primaryKey": false,
498
+ "notNull": true
499
+ },
500
+ "provider": {
501
+ "name": "provider",
502
+ "type": "text",
503
+ "primaryKey": false,
504
+ "notNull": true
505
+ },
506
+ "storage_key": {
507
+ "name": "storage_key",
508
+ "type": "text",
509
+ "primaryKey": false,
510
+ "notNull": true
511
+ },
512
+ "filename": {
513
+ "name": "filename",
514
+ "type": "text",
515
+ "primaryKey": false,
516
+ "notNull": true
517
+ },
518
+ "content_type": {
519
+ "name": "content_type",
520
+ "type": "text",
521
+ "primaryKey": false,
522
+ "notNull": true
523
+ },
524
+ "bytes": {
525
+ "name": "bytes",
526
+ "type": "integer",
527
+ "primaryKey": false,
528
+ "notNull": true
529
+ },
530
+ "sha256": {
531
+ "name": "sha256",
532
+ "type": "text",
533
+ "primaryKey": false,
534
+ "notNull": true
535
+ },
536
+ "created_at": {
537
+ "name": "created_at",
538
+ "type": "timestamp with time zone",
539
+ "primaryKey": false,
540
+ "notNull": true
541
+ },
542
+ "delete_requested_at": {
543
+ "name": "delete_requested_at",
544
+ "type": "timestamp with time zone",
545
+ "primaryKey": false,
546
+ "notNull": false
547
+ }
548
+ },
549
+ "indexes": {
550
+ "junior_attachments_conversation_idx": {
551
+ "name": "junior_attachments_conversation_idx",
552
+ "columns": [
553
+ {
554
+ "expression": "conversation_id",
555
+ "isExpression": false,
556
+ "asc": true,
557
+ "nulls": "last"
558
+ }
559
+ ],
560
+ "isUnique": false,
561
+ "concurrently": false,
562
+ "method": "btree",
563
+ "with": {}
564
+ },
565
+ "junior_attachments_gc_idx": {
566
+ "name": "junior_attachments_gc_idx",
567
+ "columns": [
568
+ {
569
+ "expression": "provider",
570
+ "isExpression": false,
571
+ "asc": true,
572
+ "nulls": "last"
573
+ },
574
+ {
575
+ "expression": "delete_requested_at",
576
+ "isExpression": false,
577
+ "asc": true,
578
+ "nulls": "last"
579
+ },
580
+ {
581
+ "expression": "created_at",
582
+ "isExpression": false,
583
+ "asc": true,
584
+ "nulls": "last"
585
+ }
586
+ ],
587
+ "isUnique": false,
588
+ "concurrently": false,
589
+ "method": "btree",
590
+ "with": {}
591
+ }
592
+ },
593
+ "foreignKeys": {
594
+ "junior_attachments_conversation_id_junior_conversations_conversation_id_fk": {
595
+ "name": "junior_attachments_conversation_id_junior_conversations_conversation_id_fk",
596
+ "tableFrom": "junior_attachments",
597
+ "tableTo": "junior_conversations",
598
+ "columnsFrom": ["conversation_id"],
599
+ "columnsTo": ["conversation_id"],
600
+ "onDelete": "cascade",
601
+ "onUpdate": "no action"
602
+ }
603
+ },
604
+ "compositePrimaryKeys": {},
605
+ "uniqueConstraints": {},
606
+ "policies": {},
607
+ "checkConstraints": {},
608
+ "isRLSEnabled": false
609
+ },
610
+ "public.junior_code_changes": {
611
+ "name": "junior_code_changes",
612
+ "schema": "",
613
+ "columns": {
614
+ "id": {
615
+ "name": "id",
616
+ "type": "uuid",
617
+ "primaryKey": true,
618
+ "notNull": true
619
+ },
620
+ "closed_at": {
621
+ "name": "closed_at",
622
+ "type": "timestamp with time zone",
623
+ "primaryKey": false,
624
+ "notNull": false
625
+ },
626
+ "conversation_ids": {
627
+ "name": "conversation_ids",
628
+ "type": "text[]",
629
+ "primaryKey": false,
630
+ "notNull": true,
631
+ "default": "ARRAY[]::text[]"
632
+ },
633
+ "merged_at": {
634
+ "name": "merged_at",
635
+ "type": "timestamp with time zone",
636
+ "primaryKey": false,
637
+ "notNull": false
638
+ },
639
+ "number": {
640
+ "name": "number",
641
+ "type": "integer",
642
+ "primaryKey": false,
643
+ "notNull": true
644
+ },
645
+ "opened_at": {
646
+ "name": "opened_at",
647
+ "type": "timestamp with time zone",
648
+ "primaryKey": false,
649
+ "notNull": true
650
+ },
651
+ "provider": {
652
+ "name": "provider",
653
+ "type": "text",
654
+ "primaryKey": false,
655
+ "notNull": true
656
+ },
657
+ "provider_id": {
658
+ "name": "provider_id",
659
+ "type": "text",
660
+ "primaryKey": false,
661
+ "notNull": true
662
+ },
663
+ "repository_id": {
664
+ "name": "repository_id",
665
+ "type": "uuid",
666
+ "primaryKey": false,
667
+ "notNull": true
668
+ },
669
+ "state": {
670
+ "name": "state",
671
+ "type": "text",
672
+ "primaryKey": false,
673
+ "notNull": true
674
+ },
675
+ "title": {
676
+ "name": "title",
677
+ "type": "text",
678
+ "primaryKey": false,
679
+ "notNull": false
680
+ },
681
+ "updated_at": {
682
+ "name": "updated_at",
683
+ "type": "timestamp with time zone",
684
+ "primaryKey": false,
685
+ "notNull": true
686
+ },
687
+ "url": {
688
+ "name": "url",
689
+ "type": "text",
690
+ "primaryKey": false,
691
+ "notNull": false
692
+ }
693
+ },
694
+ "indexes": {
695
+ "junior_code_changes_provider_id_idx": {
696
+ "name": "junior_code_changes_provider_id_idx",
697
+ "columns": [
698
+ {
699
+ "expression": "provider",
700
+ "isExpression": false,
701
+ "asc": true,
702
+ "nulls": "last"
703
+ },
704
+ {
705
+ "expression": "provider_id",
706
+ "isExpression": false,
707
+ "asc": true,
708
+ "nulls": "last"
709
+ }
710
+ ],
711
+ "isUnique": true,
712
+ "concurrently": false,
713
+ "method": "btree",
714
+ "with": {}
715
+ },
716
+ "junior_code_changes_opened_at_idx": {
717
+ "name": "junior_code_changes_opened_at_idx",
718
+ "columns": [
719
+ {
720
+ "expression": "opened_at",
721
+ "isExpression": false,
722
+ "asc": true,
723
+ "nulls": "last"
724
+ }
725
+ ],
726
+ "isUnique": false,
727
+ "concurrently": false,
728
+ "method": "btree",
729
+ "with": {}
730
+ },
731
+ "junior_code_changes_merged_at_idx": {
732
+ "name": "junior_code_changes_merged_at_idx",
733
+ "columns": [
734
+ {
735
+ "expression": "merged_at",
736
+ "isExpression": false,
737
+ "asc": true,
738
+ "nulls": "last"
739
+ }
740
+ ],
741
+ "isUnique": false,
742
+ "concurrently": false,
743
+ "method": "btree",
744
+ "with": {}
745
+ },
746
+ "junior_code_changes_closed_at_idx": {
747
+ "name": "junior_code_changes_closed_at_idx",
748
+ "columns": [
749
+ {
750
+ "expression": "closed_at",
751
+ "isExpression": false,
752
+ "asc": true,
753
+ "nulls": "last"
754
+ }
755
+ ],
756
+ "isUnique": false,
757
+ "concurrently": false,
758
+ "method": "btree",
759
+ "with": {}
760
+ },
761
+ "junior_code_changes_open_idx": {
762
+ "name": "junior_code_changes_open_idx",
763
+ "columns": [
764
+ {
765
+ "expression": "id",
766
+ "isExpression": false,
767
+ "asc": true,
768
+ "nulls": "last"
769
+ }
770
+ ],
771
+ "isUnique": false,
772
+ "where": "\"junior_code_changes\".\"state\" = 'open'",
773
+ "concurrently": false,
774
+ "method": "btree",
775
+ "with": {}
776
+ }
777
+ },
778
+ "foreignKeys": {
779
+ "junior_code_changes_repository_id_junior_code_repositories_id_fk": {
780
+ "name": "junior_code_changes_repository_id_junior_code_repositories_id_fk",
781
+ "tableFrom": "junior_code_changes",
782
+ "tableTo": "junior_code_repositories",
783
+ "columnsFrom": ["repository_id"],
784
+ "columnsTo": ["id"],
785
+ "onDelete": "cascade",
786
+ "onUpdate": "no action"
787
+ }
788
+ },
789
+ "compositePrimaryKeys": {},
790
+ "uniqueConstraints": {},
791
+ "policies": {},
792
+ "checkConstraints": {},
793
+ "isRLSEnabled": false
794
+ },
795
+ "public.junior_code_repositories": {
796
+ "name": "junior_code_repositories",
797
+ "schema": "",
798
+ "columns": {
799
+ "id": {
800
+ "name": "id",
801
+ "type": "uuid",
802
+ "primaryKey": true,
803
+ "notNull": true
804
+ },
805
+ "name": {
806
+ "name": "name",
807
+ "type": "text",
808
+ "primaryKey": false,
809
+ "notNull": true
810
+ },
811
+ "provider": {
812
+ "name": "provider",
813
+ "type": "text",
814
+ "primaryKey": false,
815
+ "notNull": true
816
+ },
817
+ "provider_id": {
818
+ "name": "provider_id",
819
+ "type": "text",
820
+ "primaryKey": false,
821
+ "notNull": true
822
+ },
823
+ "url": {
824
+ "name": "url",
825
+ "type": "text",
826
+ "primaryKey": false,
827
+ "notNull": false
828
+ },
829
+ "updated_at": {
830
+ "name": "updated_at",
831
+ "type": "timestamp with time zone",
832
+ "primaryKey": false,
833
+ "notNull": true
834
+ }
835
+ },
836
+ "indexes": {
837
+ "junior_code_repositories_provider_id_idx": {
838
+ "name": "junior_code_repositories_provider_id_idx",
839
+ "columns": [
840
+ {
841
+ "expression": "provider",
842
+ "isExpression": false,
843
+ "asc": true,
844
+ "nulls": "last"
845
+ },
846
+ {
847
+ "expression": "provider_id",
848
+ "isExpression": false,
849
+ "asc": true,
850
+ "nulls": "last"
851
+ }
852
+ ],
853
+ "isUnique": true,
854
+ "concurrently": false,
855
+ "method": "btree",
856
+ "with": {}
857
+ }
858
+ },
859
+ "foreignKeys": {},
860
+ "compositePrimaryKeys": {},
861
+ "uniqueConstraints": {},
862
+ "policies": {},
863
+ "checkConstraints": {},
864
+ "isRLSEnabled": false
865
+ },
866
+ "public.junior_conversation_annotations": {
867
+ "name": "junior_conversation_annotations",
868
+ "schema": "",
869
+ "columns": {
870
+ "conversation_id": {
871
+ "name": "conversation_id",
872
+ "type": "text",
873
+ "primaryKey": false,
874
+ "notNull": true
875
+ },
876
+ "plugin": {
877
+ "name": "plugin",
878
+ "type": "text",
879
+ "primaryKey": false,
880
+ "notNull": true
881
+ },
882
+ "kind": {
883
+ "name": "kind",
884
+ "type": "text",
885
+ "primaryKey": false,
886
+ "notNull": true
887
+ },
888
+ "key": {
889
+ "name": "key",
890
+ "type": "text",
891
+ "primaryKey": false,
892
+ "notNull": true
893
+ },
894
+ "annotation_json": {
895
+ "name": "annotation_json",
896
+ "type": "jsonb",
897
+ "primaryKey": false,
898
+ "notNull": true
899
+ },
900
+ "created_at": {
901
+ "name": "created_at",
902
+ "type": "timestamp with time zone",
903
+ "primaryKey": false,
904
+ "notNull": true
905
+ },
906
+ "updated_at": {
907
+ "name": "updated_at",
908
+ "type": "timestamp with time zone",
909
+ "primaryKey": false,
910
+ "notNull": true
911
+ }
912
+ },
913
+ "indexes": {},
914
+ "foreignKeys": {
915
+ "junior_conversation_annotations_conversation_id_fk": {
916
+ "name": "junior_conversation_annotations_conversation_id_fk",
917
+ "tableFrom": "junior_conversation_annotations",
918
+ "tableTo": "junior_conversations",
919
+ "columnsFrom": ["conversation_id"],
920
+ "columnsTo": ["conversation_id"],
921
+ "onDelete": "cascade",
922
+ "onUpdate": "no action"
923
+ }
924
+ },
925
+ "compositePrimaryKeys": {
926
+ "junior_conversation_annotations_pk": {
927
+ "name": "junior_conversation_annotations_pk",
928
+ "columns": ["conversation_id", "plugin", "kind", "key"]
929
+ }
930
+ },
931
+ "uniqueConstraints": {},
932
+ "policies": {},
933
+ "checkConstraints": {},
934
+ "isRLSEnabled": false
935
+ },
936
+ "public.junior_conversation_bindings": {
937
+ "name": "junior_conversation_bindings",
938
+ "schema": "",
939
+ "columns": {
940
+ "conversation_id": {
941
+ "name": "conversation_id",
942
+ "type": "text",
943
+ "primaryKey": false,
944
+ "notNull": true
945
+ },
946
+ "provider": {
947
+ "name": "provider",
948
+ "type": "text",
949
+ "primaryKey": false,
950
+ "notNull": true
951
+ },
952
+ "provider_tenant_id": {
953
+ "name": "provider_tenant_id",
954
+ "type": "text",
955
+ "primaryKey": false,
956
+ "notNull": true,
957
+ "default": "''"
958
+ },
959
+ "provider_destination_id": {
960
+ "name": "provider_destination_id",
961
+ "type": "text",
962
+ "primaryKey": false,
963
+ "notNull": true
964
+ },
965
+ "provider_conversation_id": {
966
+ "name": "provider_conversation_id",
967
+ "type": "text",
968
+ "primaryKey": false,
969
+ "notNull": true
970
+ },
971
+ "created_at": {
972
+ "name": "created_at",
973
+ "type": "timestamp with time zone",
974
+ "primaryKey": false,
975
+ "notNull": true
976
+ }
977
+ },
978
+ "indexes": {
979
+ "junior_conversation_bindings_conversation_idx": {
980
+ "name": "junior_conversation_bindings_conversation_idx",
981
+ "columns": [
982
+ {
983
+ "expression": "conversation_id",
984
+ "isExpression": false,
985
+ "asc": true,
986
+ "nulls": "last"
987
+ }
988
+ ],
989
+ "isUnique": false,
990
+ "concurrently": false,
991
+ "method": "btree",
992
+ "with": {}
993
+ }
994
+ },
995
+ "foreignKeys": {
996
+ "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk": {
997
+ "name": "junior_conversation_bindings_conversation_id_junior_conversations_conversation_id_fk",
998
+ "tableFrom": "junior_conversation_bindings",
999
+ "tableTo": "junior_conversations",
1000
+ "columnsFrom": ["conversation_id"],
1001
+ "columnsTo": ["conversation_id"],
1002
+ "onDelete": "no action",
1003
+ "onUpdate": "no action"
1004
+ }
1005
+ },
1006
+ "compositePrimaryKeys": {
1007
+ "junior_conversation_bindings_provider_conversation_pk": {
1008
+ "name": "junior_conversation_bindings_provider_conversation_pk",
1009
+ "columns": [
1010
+ "provider",
1011
+ "provider_tenant_id",
1012
+ "provider_destination_id",
1013
+ "provider_conversation_id"
1014
+ ]
1015
+ }
1016
+ },
1017
+ "uniqueConstraints": {},
1018
+ "policies": {},
1019
+ "checkConstraints": {},
1020
+ "isRLSEnabled": false
1021
+ },
1022
+ "public.junior_conversation_events": {
1023
+ "name": "junior_conversation_events",
1024
+ "schema": "",
1025
+ "columns": {
1026
+ "conversation_id": {
1027
+ "name": "conversation_id",
1028
+ "type": "text",
1029
+ "primaryKey": false,
1030
+ "notNull": true
1031
+ },
1032
+ "seq": {
1033
+ "name": "seq",
1034
+ "type": "integer",
1035
+ "primaryKey": false,
1036
+ "notNull": true
1037
+ },
1038
+ "history_version": {
1039
+ "name": "history_version",
1040
+ "type": "integer",
1041
+ "primaryKey": false,
1042
+ "notNull": true
1043
+ },
1044
+ "schema_version": {
1045
+ "name": "schema_version",
1046
+ "type": "integer",
1047
+ "primaryKey": false,
1048
+ "notNull": true,
1049
+ "default": 1
1050
+ },
1051
+ "idempotency_key": {
1052
+ "name": "idempotency_key",
1053
+ "type": "text",
1054
+ "primaryKey": false,
1055
+ "notNull": false
1056
+ },
1057
+ "type": {
1058
+ "name": "type",
1059
+ "type": "text",
1060
+ "primaryKey": false,
1061
+ "notNull": true
1062
+ },
1063
+ "payload": {
1064
+ "name": "payload",
1065
+ "type": "jsonb",
1066
+ "primaryKey": false,
1067
+ "notNull": true
1068
+ },
1069
+ "actor_identity_id": {
1070
+ "name": "actor_identity_id",
1071
+ "type": "text",
1072
+ "primaryKey": false,
1073
+ "notNull": false
1074
+ },
1075
+ "created_at": {
1076
+ "name": "created_at",
1077
+ "type": "timestamp with time zone",
1078
+ "primaryKey": false,
1079
+ "notNull": true
1080
+ }
1081
+ },
1082
+ "indexes": {
1083
+ "junior_conversation_events_history_version_idx": {
1084
+ "name": "junior_conversation_events_history_version_idx",
1085
+ "columns": [
1086
+ {
1087
+ "expression": "conversation_id",
1088
+ "isExpression": false,
1089
+ "asc": true,
1090
+ "nulls": "last"
1091
+ },
1092
+ {
1093
+ "expression": "history_version",
1094
+ "isExpression": false,
1095
+ "asc": true,
1096
+ "nulls": "last"
1097
+ },
1098
+ {
1099
+ "expression": "seq",
1100
+ "isExpression": false,
1101
+ "asc": true,
1102
+ "nulls": "last"
1103
+ }
1104
+ ],
1105
+ "isUnique": false,
1106
+ "concurrently": false,
1107
+ "method": "btree",
1108
+ "with": {}
1109
+ },
1110
+ "junior_conversation_events_type_idx": {
1111
+ "name": "junior_conversation_events_type_idx",
1112
+ "columns": [
1113
+ {
1114
+ "expression": "conversation_id",
1115
+ "isExpression": false,
1116
+ "asc": true,
1117
+ "nulls": "last"
1118
+ },
1119
+ {
1120
+ "expression": "type",
1121
+ "isExpression": false,
1122
+ "asc": true,
1123
+ "nulls": "last"
1124
+ },
1125
+ {
1126
+ "expression": "seq",
1127
+ "isExpression": false,
1128
+ "asc": true,
1129
+ "nulls": "last"
1130
+ }
1131
+ ],
1132
+ "isUnique": false,
1133
+ "concurrently": false,
1134
+ "method": "btree",
1135
+ "with": {}
1136
+ },
1137
+ "junior_conversation_events_actor_identity_idx": {
1138
+ "name": "junior_conversation_events_actor_identity_idx",
1139
+ "columns": [
1140
+ {
1141
+ "expression": "actor_identity_id",
1142
+ "isExpression": false,
1143
+ "asc": true,
1144
+ "nulls": "last"
1145
+ },
1146
+ {
1147
+ "expression": "conversation_id",
1148
+ "isExpression": false,
1149
+ "asc": true,
1150
+ "nulls": "last"
1151
+ },
1152
+ {
1153
+ "expression": "seq",
1154
+ "isExpression": false,
1155
+ "asc": true,
1156
+ "nulls": "last"
1157
+ }
1158
+ ],
1159
+ "isUnique": false,
1160
+ "concurrently": false,
1161
+ "method": "btree",
1162
+ "with": {}
1163
+ },
1164
+ "junior_conversation_events_message_search_idx": {
1165
+ "name": "junior_conversation_events_message_search_idx",
1166
+ "columns": [
1167
+ {
1168
+ "expression": "to_tsvector('english', \"payload\"->>'text')",
1169
+ "asc": true,
1170
+ "isExpression": true,
1171
+ "nulls": "last"
1172
+ }
1173
+ ],
1174
+ "isUnique": false,
1175
+ "where": "\"junior_conversation_events\".\"type\" = 'message'",
1176
+ "concurrently": false,
1177
+ "method": "gin",
1178
+ "with": {}
1179
+ },
1180
+ "junior_conversation_events_idempotency_idx": {
1181
+ "name": "junior_conversation_events_idempotency_idx",
1182
+ "columns": [
1183
+ {
1184
+ "expression": "conversation_id",
1185
+ "isExpression": false,
1186
+ "asc": true,
1187
+ "nulls": "last"
1188
+ },
1189
+ {
1190
+ "expression": "idempotency_key",
1191
+ "isExpression": false,
1192
+ "asc": true,
1193
+ "nulls": "last"
1194
+ }
1195
+ ],
1196
+ "isUnique": true,
1197
+ "concurrently": false,
1198
+ "method": "btree",
1199
+ "with": {}
1200
+ }
1201
+ },
1202
+ "foreignKeys": {
1203
+ "junior_conversation_events_actor_identity_id_junior_identities_id_fk": {
1204
+ "name": "junior_conversation_events_actor_identity_id_junior_identities_id_fk",
1205
+ "tableFrom": "junior_conversation_events",
1206
+ "tableTo": "junior_identities",
1207
+ "columnsFrom": ["actor_identity_id"],
1208
+ "columnsTo": ["id"],
1209
+ "onDelete": "no action",
1210
+ "onUpdate": "no action"
1211
+ },
1212
+ "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk": {
1213
+ "name": "junior_conversation_events_conversation_id_junior_conversations_conversation_id_fk",
1214
+ "tableFrom": "junior_conversation_events",
1215
+ "tableTo": "junior_conversations",
1216
+ "columnsFrom": ["conversation_id"],
1217
+ "columnsTo": ["conversation_id"],
1218
+ "onDelete": "no action",
1219
+ "onUpdate": "no action"
1220
+ }
1221
+ },
1222
+ "compositePrimaryKeys": {
1223
+ "junior_conversation_events_conversation_id_seq_pk": {
1224
+ "name": "junior_conversation_events_conversation_id_seq_pk",
1225
+ "columns": ["conversation_id", "seq"]
1226
+ }
1227
+ },
1228
+ "uniqueConstraints": {},
1229
+ "policies": {},
1230
+ "checkConstraints": {},
1231
+ "isRLSEnabled": false
1232
+ },
1233
+ "public.junior_conversation_participants": {
1234
+ "name": "junior_conversation_participants",
1235
+ "schema": "",
1236
+ "columns": {
1237
+ "user_id": {
1238
+ "name": "user_id",
1239
+ "type": "text",
1240
+ "primaryKey": false,
1241
+ "notNull": true
1242
+ },
1243
+ "root_conversation_id": {
1244
+ "name": "root_conversation_id",
1245
+ "type": "text",
1246
+ "primaryKey": false,
1247
+ "notNull": true
1248
+ },
1249
+ "last_message_at": {
1250
+ "name": "last_message_at",
1251
+ "type": "timestamp with time zone",
1252
+ "primaryKey": false,
1253
+ "notNull": true
1254
+ },
1255
+ "archived_at": {
1256
+ "name": "archived_at",
1257
+ "type": "timestamp with time zone",
1258
+ "primaryKey": false,
1259
+ "notNull": false
1260
+ }
1261
+ },
1262
+ "indexes": {
1263
+ "junior_conversation_participants_user_activity_idx": {
1264
+ "name": "junior_conversation_participants_user_activity_idx",
1265
+ "columns": [
1266
+ {
1267
+ "expression": "user_id",
1268
+ "isExpression": false,
1269
+ "asc": true,
1270
+ "nulls": "last"
1271
+ },
1272
+ {
1273
+ "expression": "last_message_at",
1274
+ "isExpression": false,
1275
+ "asc": false,
1276
+ "nulls": "last"
1277
+ }
1278
+ ],
1279
+ "isUnique": false,
1280
+ "concurrently": false,
1281
+ "method": "btree",
1282
+ "with": {}
1283
+ },
1284
+ "junior_conversation_participants_root_idx": {
1285
+ "name": "junior_conversation_participants_root_idx",
1286
+ "columns": [
1287
+ {
1288
+ "expression": "root_conversation_id",
1289
+ "isExpression": false,
1290
+ "asc": true,
1291
+ "nulls": "last"
1292
+ }
1293
+ ],
1294
+ "isUnique": false,
1295
+ "concurrently": false,
1296
+ "method": "btree",
1297
+ "with": {}
1298
+ }
1299
+ },
1300
+ "foreignKeys": {
1301
+ "junior_conversation_participants_user_id_junior_users_id_fk": {
1302
+ "name": "junior_conversation_participants_user_id_junior_users_id_fk",
1303
+ "tableFrom": "junior_conversation_participants",
1304
+ "tableTo": "junior_users",
1305
+ "columnsFrom": ["user_id"],
1306
+ "columnsTo": ["id"],
1307
+ "onDelete": "no action",
1308
+ "onUpdate": "no action"
1309
+ },
1310
+ "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk": {
1311
+ "name": "junior_conversation_participants_root_conversation_id_junior_conversations_conversation_id_fk",
1312
+ "tableFrom": "junior_conversation_participants",
1313
+ "tableTo": "junior_conversations",
1314
+ "columnsFrom": ["root_conversation_id"],
1315
+ "columnsTo": ["conversation_id"],
1316
+ "onDelete": "no action",
1317
+ "onUpdate": "no action"
1318
+ }
1319
+ },
1320
+ "compositePrimaryKeys": {
1321
+ "junior_conversation_participants_user_root_pk": {
1322
+ "name": "junior_conversation_participants_user_root_pk",
1323
+ "columns": ["user_id", "root_conversation_id"]
1324
+ }
1325
+ },
1326
+ "uniqueConstraints": {},
1327
+ "policies": {},
1328
+ "checkConstraints": {},
1329
+ "isRLSEnabled": false
1330
+ },
1331
+ "public.junior_conversations": {
1332
+ "name": "junior_conversations",
1333
+ "schema": "",
1334
+ "columns": {
1335
+ "conversation_id": {
1336
+ "name": "conversation_id",
1337
+ "type": "text",
1338
+ "primaryKey": true,
1339
+ "notNull": true
1340
+ },
1341
+ "schema_version": {
1342
+ "name": "schema_version",
1343
+ "type": "integer",
1344
+ "primaryKey": false,
1345
+ "notNull": true,
1346
+ "default": 1
1347
+ },
1348
+ "source": {
1349
+ "name": "source",
1350
+ "type": "text",
1351
+ "primaryKey": false,
1352
+ "notNull": false
1353
+ },
1354
+ "source_json": {
1355
+ "name": "source_json",
1356
+ "type": "jsonb",
1357
+ "primaryKey": false,
1358
+ "notNull": false
1359
+ },
1360
+ "origin_type": {
1361
+ "name": "origin_type",
1362
+ "type": "text",
1363
+ "primaryKey": false,
1364
+ "notNull": false
1365
+ },
1366
+ "origin_id": {
1367
+ "name": "origin_id",
1368
+ "type": "text",
1369
+ "primaryKey": false,
1370
+ "notNull": false
1371
+ },
1372
+ "origin_run_id": {
1373
+ "name": "origin_run_id",
1374
+ "type": "text",
1375
+ "primaryKey": false,
1376
+ "notNull": false
1377
+ },
1378
+ "destination_id": {
1379
+ "name": "destination_id",
1380
+ "type": "text",
1381
+ "primaryKey": false,
1382
+ "notNull": false
1383
+ },
1384
+ "destination_json": {
1385
+ "name": "destination_json",
1386
+ "type": "jsonb",
1387
+ "primaryKey": false,
1388
+ "notNull": false
1389
+ },
1390
+ "actor_identity_id": {
1391
+ "name": "actor_identity_id",
1392
+ "type": "text",
1393
+ "primaryKey": false,
1394
+ "notNull": false
1395
+ },
1396
+ "creator_identity_id": {
1397
+ "name": "creator_identity_id",
1398
+ "type": "text",
1399
+ "primaryKey": false,
1400
+ "notNull": false
1401
+ },
1402
+ "credential_subject_identity_id": {
1403
+ "name": "credential_subject_identity_id",
1404
+ "type": "text",
1405
+ "primaryKey": false,
1406
+ "notNull": false
1407
+ },
1408
+ "actor_json": {
1409
+ "name": "actor_json",
1410
+ "type": "jsonb",
1411
+ "primaryKey": false,
1412
+ "notNull": false
1413
+ },
1414
+ "channel_name": {
1415
+ "name": "channel_name",
1416
+ "type": "text",
1417
+ "primaryKey": false,
1418
+ "notNull": false
1419
+ },
1420
+ "title": {
1421
+ "name": "title",
1422
+ "type": "text",
1423
+ "primaryKey": false,
1424
+ "notNull": false
1425
+ },
1426
+ "created_at": {
1427
+ "name": "created_at",
1428
+ "type": "timestamp with time zone",
1429
+ "primaryKey": false,
1430
+ "notNull": true
1431
+ },
1432
+ "last_activity_at": {
1433
+ "name": "last_activity_at",
1434
+ "type": "timestamp with time zone",
1435
+ "primaryKey": false,
1436
+ "notNull": true
1437
+ },
1438
+ "updated_at": {
1439
+ "name": "updated_at",
1440
+ "type": "timestamp with time zone",
1441
+ "primaryKey": false,
1442
+ "notNull": true
1443
+ },
1444
+ "execution_updated_at": {
1445
+ "name": "execution_updated_at",
1446
+ "type": "timestamp with time zone",
1447
+ "primaryKey": false,
1448
+ "notNull": false
1449
+ },
1450
+ "execution_status": {
1451
+ "name": "execution_status",
1452
+ "type": "text",
1453
+ "primaryKey": false,
1454
+ "notNull": true
1455
+ },
1456
+ "run_id": {
1457
+ "name": "run_id",
1458
+ "type": "text",
1459
+ "primaryKey": false,
1460
+ "notNull": false
1461
+ },
1462
+ "last_checkpoint_at": {
1463
+ "name": "last_checkpoint_at",
1464
+ "type": "timestamp with time zone",
1465
+ "primaryKey": false,
1466
+ "notNull": false
1467
+ },
1468
+ "last_enqueued_at": {
1469
+ "name": "last_enqueued_at",
1470
+ "type": "timestamp with time zone",
1471
+ "primaryKey": false,
1472
+ "notNull": false
1473
+ },
1474
+ "parent_conversation_id": {
1475
+ "name": "parent_conversation_id",
1476
+ "type": "text",
1477
+ "primaryKey": false,
1478
+ "notNull": false
1479
+ },
1480
+ "root_conversation_id": {
1481
+ "name": "root_conversation_id",
1482
+ "type": "text",
1483
+ "primaryKey": false,
1484
+ "notNull": false
1485
+ },
1486
+ "transcript_purged_at": {
1487
+ "name": "transcript_purged_at",
1488
+ "type": "timestamp with time zone",
1489
+ "primaryKey": false,
1490
+ "notNull": false
1491
+ },
1492
+ "duration_ms": {
1493
+ "name": "duration_ms",
1494
+ "type": "integer",
1495
+ "primaryKey": false,
1496
+ "notNull": true,
1497
+ "default": 0
1498
+ },
1499
+ "usage_json": {
1500
+ "name": "usage_json",
1501
+ "type": "jsonb",
1502
+ "primaryKey": false,
1503
+ "notNull": false
1504
+ },
1505
+ "execution_duration_ms": {
1506
+ "name": "execution_duration_ms",
1507
+ "type": "integer",
1508
+ "primaryKey": false,
1509
+ "notNull": true,
1510
+ "default": 0
1511
+ },
1512
+ "execution_usage_json": {
1513
+ "name": "execution_usage_json",
1514
+ "type": "jsonb",
1515
+ "primaryKey": false,
1516
+ "notNull": false
1517
+ },
1518
+ "metric_run_id": {
1519
+ "name": "metric_run_id",
1520
+ "type": "text",
1521
+ "primaryKey": false,
1522
+ "notNull": false
1523
+ },
1524
+ "archived_at": {
1525
+ "name": "archived_at",
1526
+ "type": "timestamp with time zone",
1527
+ "primaryKey": false,
1528
+ "notNull": false
1529
+ }
1530
+ },
1531
+ "indexes": {
1532
+ "junior_conversations_last_activity_idx": {
1533
+ "name": "junior_conversations_last_activity_idx",
1534
+ "columns": [
1535
+ {
1536
+ "expression": "last_activity_at",
1537
+ "isExpression": false,
1538
+ "asc": false,
1539
+ "nulls": "last"
1540
+ },
1541
+ {
1542
+ "expression": "conversation_id",
1543
+ "isExpression": false,
1544
+ "asc": true,
1545
+ "nulls": "last"
1546
+ }
1547
+ ],
1548
+ "isUnique": false,
1549
+ "concurrently": false,
1550
+ "method": "btree",
1551
+ "with": {}
1552
+ },
1553
+ "junior_conversations_active_idx": {
1554
+ "name": "junior_conversations_active_idx",
1555
+ "columns": [
1556
+ {
1557
+ "expression": "coalesce(\"execution_updated_at\", \"updated_at\")",
1558
+ "asc": true,
1559
+ "isExpression": true,
1560
+ "nulls": "last"
1561
+ },
1562
+ {
1563
+ "expression": "conversation_id",
1564
+ "isExpression": false,
1565
+ "asc": true,
1566
+ "nulls": "last"
1567
+ }
1568
+ ],
1569
+ "isUnique": false,
1570
+ "where": "\"junior_conversations\".\"execution_status\" <> 'idle'",
1571
+ "concurrently": false,
1572
+ "method": "btree",
1573
+ "with": {}
1574
+ },
1575
+ "junior_conversations_destination_activity_idx": {
1576
+ "name": "junior_conversations_destination_activity_idx",
1577
+ "columns": [
1578
+ {
1579
+ "expression": "destination_id",
1580
+ "isExpression": false,
1581
+ "asc": true,
1582
+ "nulls": "last"
1583
+ },
1584
+ {
1585
+ "expression": "last_activity_at",
1586
+ "isExpression": false,
1587
+ "asc": false,
1588
+ "nulls": "last"
1589
+ }
1590
+ ],
1591
+ "isUnique": false,
1592
+ "concurrently": false,
1593
+ "method": "btree",
1594
+ "with": {}
1595
+ },
1596
+ "junior_conversations_actor_activity_idx": {
1597
+ "name": "junior_conversations_actor_activity_idx",
1598
+ "columns": [
1599
+ {
1600
+ "expression": "actor_identity_id",
1601
+ "isExpression": false,
1602
+ "asc": true,
1603
+ "nulls": "last"
1604
+ },
1605
+ {
1606
+ "expression": "last_activity_at",
1607
+ "isExpression": false,
1608
+ "asc": false,
1609
+ "nulls": "last"
1610
+ }
1611
+ ],
1612
+ "isUnique": false,
1613
+ "concurrently": false,
1614
+ "method": "btree",
1615
+ "with": {}
1616
+ },
1617
+ "junior_conversations_origin_idx": {
1618
+ "name": "junior_conversations_origin_idx",
1619
+ "columns": [
1620
+ {
1621
+ "expression": "origin_type",
1622
+ "isExpression": false,
1623
+ "asc": true,
1624
+ "nulls": "last"
1625
+ },
1626
+ {
1627
+ "expression": "origin_id",
1628
+ "isExpression": false,
1629
+ "asc": true,
1630
+ "nulls": "last"
1631
+ },
1632
+ {
1633
+ "expression": "last_activity_at",
1634
+ "isExpression": false,
1635
+ "asc": false,
1636
+ "nulls": "last"
1637
+ }
1638
+ ],
1639
+ "isUnique": false,
1640
+ "concurrently": false,
1641
+ "method": "btree",
1642
+ "with": {}
1643
+ },
1644
+ "junior_conversations_parent_idx": {
1645
+ "name": "junior_conversations_parent_idx",
1646
+ "columns": [
1647
+ {
1648
+ "expression": "parent_conversation_id",
1649
+ "isExpression": false,
1650
+ "asc": true,
1651
+ "nulls": "last"
1652
+ }
1653
+ ],
1654
+ "isUnique": false,
1655
+ "concurrently": false,
1656
+ "method": "btree",
1657
+ "with": {}
1658
+ },
1659
+ "junior_conversations_root_idx": {
1660
+ "name": "junior_conversations_root_idx",
1661
+ "columns": [
1662
+ {
1663
+ "expression": "root_conversation_id",
1664
+ "isExpression": false,
1665
+ "asc": true,
1666
+ "nulls": "last"
1667
+ }
1668
+ ],
1669
+ "isUnique": false,
1670
+ "concurrently": false,
1671
+ "method": "btree",
1672
+ "with": {}
1673
+ }
1674
+ },
1675
+ "foreignKeys": {
1676
+ "junior_conversations_destination_id_junior_destinations_id_fk": {
1677
+ "name": "junior_conversations_destination_id_junior_destinations_id_fk",
1678
+ "tableFrom": "junior_conversations",
1679
+ "tableTo": "junior_destinations",
1680
+ "columnsFrom": ["destination_id"],
1681
+ "columnsTo": ["id"],
1682
+ "onDelete": "no action",
1683
+ "onUpdate": "no action"
1684
+ },
1685
+ "junior_conversations_actor_identity_id_junior_identities_id_fk": {
1686
+ "name": "junior_conversations_actor_identity_id_junior_identities_id_fk",
1687
+ "tableFrom": "junior_conversations",
1688
+ "tableTo": "junior_identities",
1689
+ "columnsFrom": ["actor_identity_id"],
1690
+ "columnsTo": ["id"],
1691
+ "onDelete": "no action",
1692
+ "onUpdate": "no action"
1693
+ },
1694
+ "junior_conversations_creator_identity_id_junior_identities_id_fk": {
1695
+ "name": "junior_conversations_creator_identity_id_junior_identities_id_fk",
1696
+ "tableFrom": "junior_conversations",
1697
+ "tableTo": "junior_identities",
1698
+ "columnsFrom": ["creator_identity_id"],
1699
+ "columnsTo": ["id"],
1700
+ "onDelete": "no action",
1701
+ "onUpdate": "no action"
1702
+ },
1703
+ "junior_conversations_credential_subject_identity_id_junior_identities_id_fk": {
1704
+ "name": "junior_conversations_credential_subject_identity_id_junior_identities_id_fk",
1705
+ "tableFrom": "junior_conversations",
1706
+ "tableTo": "junior_identities",
1707
+ "columnsFrom": ["credential_subject_identity_id"],
1708
+ "columnsTo": ["id"],
1709
+ "onDelete": "no action",
1710
+ "onUpdate": "no action"
1711
+ },
1712
+ "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk": {
1713
+ "name": "junior_conversations_parent_conversation_id_junior_conversations_conversation_id_fk",
1714
+ "tableFrom": "junior_conversations",
1715
+ "tableTo": "junior_conversations",
1716
+ "columnsFrom": ["parent_conversation_id"],
1717
+ "columnsTo": ["conversation_id"],
1718
+ "onDelete": "no action",
1719
+ "onUpdate": "no action"
1720
+ },
1721
+ "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk": {
1722
+ "name": "junior_conversations_root_conversation_id_junior_conversations_conversation_id_fk",
1723
+ "tableFrom": "junior_conversations",
1724
+ "tableTo": "junior_conversations",
1725
+ "columnsFrom": ["root_conversation_id"],
1726
+ "columnsTo": ["conversation_id"],
1727
+ "onDelete": "no action",
1728
+ "onUpdate": "no action"
1729
+ }
1730
+ },
1731
+ "compositePrimaryKeys": {},
1732
+ "uniqueConstraints": {},
1733
+ "policies": {},
1734
+ "checkConstraints": {},
1735
+ "isRLSEnabled": false
1736
+ },
1737
+ "public.junior_destinations": {
1738
+ "name": "junior_destinations",
1739
+ "schema": "",
1740
+ "columns": {
1741
+ "id": {
1742
+ "name": "id",
1743
+ "type": "text",
1744
+ "primaryKey": true,
1745
+ "notNull": true
1746
+ },
1747
+ "provider": {
1748
+ "name": "provider",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": true
1752
+ },
1753
+ "provider_tenant_id": {
1754
+ "name": "provider_tenant_id",
1755
+ "type": "text",
1756
+ "primaryKey": false,
1757
+ "notNull": true,
1758
+ "default": "''"
1759
+ },
1760
+ "provider_destination_id": {
1761
+ "name": "provider_destination_id",
1762
+ "type": "text",
1763
+ "primaryKey": false,
1764
+ "notNull": true
1765
+ },
1766
+ "kind": {
1767
+ "name": "kind",
1768
+ "type": "text",
1769
+ "primaryKey": false,
1770
+ "notNull": true
1771
+ },
1772
+ "parent_destination_id": {
1773
+ "name": "parent_destination_id",
1774
+ "type": "text",
1775
+ "primaryKey": false,
1776
+ "notNull": false
1777
+ },
1778
+ "display_name": {
1779
+ "name": "display_name",
1780
+ "type": "text",
1781
+ "primaryKey": false,
1782
+ "notNull": false
1783
+ },
1784
+ "visibility": {
1785
+ "name": "visibility",
1786
+ "type": "text",
1787
+ "primaryKey": false,
1788
+ "notNull": true,
1789
+ "default": "'unknown'"
1790
+ },
1791
+ "metadata_json": {
1792
+ "name": "metadata_json",
1793
+ "type": "jsonb",
1794
+ "primaryKey": false,
1795
+ "notNull": false
1796
+ },
1797
+ "created_at": {
1798
+ "name": "created_at",
1799
+ "type": "timestamp with time zone",
1800
+ "primaryKey": false,
1801
+ "notNull": true
1802
+ },
1803
+ "updated_at": {
1804
+ "name": "updated_at",
1805
+ "type": "timestamp with time zone",
1806
+ "primaryKey": false,
1807
+ "notNull": true
1808
+ }
1809
+ },
1810
+ "indexes": {
1811
+ "junior_destinations_provider_destination_uidx": {
1812
+ "name": "junior_destinations_provider_destination_uidx",
1813
+ "columns": [
1814
+ {
1815
+ "expression": "provider",
1816
+ "isExpression": false,
1817
+ "asc": true,
1818
+ "nulls": "last"
1819
+ },
1820
+ {
1821
+ "expression": "provider_tenant_id",
1822
+ "isExpression": false,
1823
+ "asc": true,
1824
+ "nulls": "last"
1825
+ },
1826
+ {
1827
+ "expression": "provider_destination_id",
1828
+ "isExpression": false,
1829
+ "asc": true,
1830
+ "nulls": "last"
1831
+ }
1832
+ ],
1833
+ "isUnique": true,
1834
+ "concurrently": false,
1835
+ "method": "btree",
1836
+ "with": {}
1837
+ },
1838
+ "junior_destinations_provider_kind_idx": {
1839
+ "name": "junior_destinations_provider_kind_idx",
1840
+ "columns": [
1841
+ {
1842
+ "expression": "provider",
1843
+ "isExpression": false,
1844
+ "asc": true,
1845
+ "nulls": "last"
1846
+ },
1847
+ {
1848
+ "expression": "kind",
1849
+ "isExpression": false,
1850
+ "asc": true,
1851
+ "nulls": "last"
1852
+ }
1853
+ ],
1854
+ "isUnique": false,
1855
+ "concurrently": false,
1856
+ "method": "btree",
1857
+ "with": {}
1858
+ }
1859
+ },
1860
+ "foreignKeys": {},
1861
+ "compositePrimaryKeys": {},
1862
+ "uniqueConstraints": {},
1863
+ "policies": {},
1864
+ "checkConstraints": {},
1865
+ "isRLSEnabled": false
1866
+ },
1867
+ "public.junior_event_tasks": {
1868
+ "name": "junior_event_tasks",
1869
+ "schema": "",
1870
+ "columns": {
1871
+ "id": {
1872
+ "name": "id",
1873
+ "type": "text",
1874
+ "primaryKey": true,
1875
+ "notNull": true
1876
+ },
1877
+ "team_id": {
1878
+ "name": "team_id",
1879
+ "type": "text",
1880
+ "primaryKey": false,
1881
+ "notNull": true
1882
+ },
1883
+ "namespace": {
1884
+ "name": "namespace",
1885
+ "type": "text",
1886
+ "primaryKey": false,
1887
+ "notNull": true
1888
+ },
1889
+ "identifier": {
1890
+ "name": "identifier",
1891
+ "type": "text",
1892
+ "primaryKey": false,
1893
+ "notNull": true
1894
+ },
1895
+ "created_at_ms": {
1896
+ "name": "created_at_ms",
1897
+ "type": "bigint",
1898
+ "primaryKey": false,
1899
+ "notNull": true
1900
+ },
1901
+ "title": {
1902
+ "name": "title",
1903
+ "type": "text",
1904
+ "primaryKey": false,
1905
+ "notNull": false
1906
+ },
1907
+ "task_json": {
1908
+ "name": "task_json",
1909
+ "type": "jsonb",
1910
+ "primaryKey": false,
1911
+ "notNull": true
1912
+ }
1913
+ },
1914
+ "indexes": {
1915
+ "junior_event_tasks_team_idx": {
1916
+ "name": "junior_event_tasks_team_idx",
1917
+ "columns": [
1918
+ {
1919
+ "expression": "team_id",
1920
+ "isExpression": false,
1921
+ "asc": true,
1922
+ "nulls": "last"
1923
+ },
1924
+ {
1925
+ "expression": "created_at_ms",
1926
+ "isExpression": false,
1927
+ "asc": true,
1928
+ "nulls": "last"
1929
+ },
1930
+ {
1931
+ "expression": "id",
1932
+ "isExpression": false,
1933
+ "asc": true,
1934
+ "nulls": "last"
1935
+ }
1936
+ ],
1937
+ "isUnique": false,
1938
+ "concurrently": false,
1939
+ "method": "btree",
1940
+ "with": {}
1941
+ },
1942
+ "junior_event_tasks_match_idx": {
1943
+ "name": "junior_event_tasks_match_idx",
1944
+ "columns": [
1945
+ {
1946
+ "expression": "namespace",
1947
+ "isExpression": false,
1948
+ "asc": true,
1949
+ "nulls": "last"
1950
+ },
1951
+ {
1952
+ "expression": "identifier",
1953
+ "isExpression": false,
1954
+ "asc": true,
1955
+ "nulls": "last"
1956
+ },
1957
+ {
1958
+ "expression": "created_at_ms",
1959
+ "isExpression": false,
1960
+ "asc": true,
1961
+ "nulls": "last"
1962
+ },
1963
+ {
1964
+ "expression": "id",
1965
+ "isExpression": false,
1966
+ "asc": true,
1967
+ "nulls": "last"
1968
+ }
1969
+ ],
1970
+ "isUnique": false,
1971
+ "concurrently": false,
1972
+ "method": "btree",
1973
+ "with": {}
1974
+ }
1975
+ },
1976
+ "foreignKeys": {},
1977
+ "compositePrimaryKeys": {},
1978
+ "uniqueConstraints": {},
1979
+ "policies": {},
1980
+ "checkConstraints": {},
1981
+ "isRLSEnabled": false
1982
+ },
1983
+ "public.junior_identities": {
1984
+ "name": "junior_identities",
1985
+ "schema": "",
1986
+ "columns": {
1987
+ "id": {
1988
+ "name": "id",
1989
+ "type": "text",
1990
+ "primaryKey": true,
1991
+ "notNull": true
1992
+ },
1993
+ "kind": {
1994
+ "name": "kind",
1995
+ "type": "text",
1996
+ "primaryKey": false,
1997
+ "notNull": true
1998
+ },
1999
+ "provider": {
2000
+ "name": "provider",
2001
+ "type": "text",
2002
+ "primaryKey": false,
2003
+ "notNull": true
2004
+ },
2005
+ "provider_tenant_id": {
2006
+ "name": "provider_tenant_id",
2007
+ "type": "text",
2008
+ "primaryKey": false,
2009
+ "notNull": true,
2010
+ "default": "''"
2011
+ },
2012
+ "provider_subject_id": {
2013
+ "name": "provider_subject_id",
2014
+ "type": "text",
2015
+ "primaryKey": false,
2016
+ "notNull": true
2017
+ },
2018
+ "display_name": {
2019
+ "name": "display_name",
2020
+ "type": "text",
2021
+ "primaryKey": false,
2022
+ "notNull": false
2023
+ },
2024
+ "handle": {
2025
+ "name": "handle",
2026
+ "type": "text",
2027
+ "primaryKey": false,
2028
+ "notNull": false
2029
+ },
2030
+ "email": {
2031
+ "name": "email",
2032
+ "type": "text",
2033
+ "primaryKey": false,
2034
+ "notNull": false
2035
+ },
2036
+ "avatar_url": {
2037
+ "name": "avatar_url",
2038
+ "type": "text",
2039
+ "primaryKey": false,
2040
+ "notNull": false
2041
+ },
2042
+ "metadata_json": {
2043
+ "name": "metadata_json",
2044
+ "type": "jsonb",
2045
+ "primaryKey": false,
2046
+ "notNull": false
2047
+ },
2048
+ "created_at": {
2049
+ "name": "created_at",
2050
+ "type": "timestamp with time zone",
2051
+ "primaryKey": false,
2052
+ "notNull": true
2053
+ },
2054
+ "updated_at": {
2055
+ "name": "updated_at",
2056
+ "type": "timestamp with time zone",
2057
+ "primaryKey": false,
2058
+ "notNull": true
2059
+ },
2060
+ "user_id": {
2061
+ "name": "user_id",
2062
+ "type": "text",
2063
+ "primaryKey": false,
2064
+ "notNull": false
2065
+ },
2066
+ "email_normalized": {
2067
+ "name": "email_normalized",
2068
+ "type": "text",
2069
+ "primaryKey": false,
2070
+ "notNull": false
2071
+ },
2072
+ "email_verified": {
2073
+ "name": "email_verified",
2074
+ "type": "boolean",
2075
+ "primaryKey": false,
2076
+ "notNull": true,
2077
+ "default": false
2078
+ }
2079
+ },
2080
+ "indexes": {
2081
+ "junior_identities_provider_subject_uidx": {
2082
+ "name": "junior_identities_provider_subject_uidx",
2083
+ "columns": [
2084
+ {
2085
+ "expression": "provider",
2086
+ "isExpression": false,
2087
+ "asc": true,
2088
+ "nulls": "last"
2089
+ },
2090
+ {
2091
+ "expression": "provider_tenant_id",
2092
+ "isExpression": false,
2093
+ "asc": true,
2094
+ "nulls": "last"
2095
+ },
2096
+ {
2097
+ "expression": "provider_subject_id",
2098
+ "isExpression": false,
2099
+ "asc": true,
2100
+ "nulls": "last"
2101
+ }
2102
+ ],
2103
+ "isUnique": true,
2104
+ "concurrently": false,
2105
+ "method": "btree",
2106
+ "with": {}
2107
+ },
2108
+ "junior_identities_user_idx": {
2109
+ "name": "junior_identities_user_idx",
2110
+ "columns": [
2111
+ {
2112
+ "expression": "user_id",
2113
+ "isExpression": false,
2114
+ "asc": true,
2115
+ "nulls": "last"
2116
+ }
2117
+ ],
2118
+ "isUnique": false,
2119
+ "concurrently": false,
2120
+ "method": "btree",
2121
+ "with": {}
2122
+ },
2123
+ "junior_identities_verified_email_idx": {
2124
+ "name": "junior_identities_verified_email_idx",
2125
+ "columns": [
2126
+ {
2127
+ "expression": "email_normalized",
2128
+ "isExpression": false,
2129
+ "asc": true,
2130
+ "nulls": "last"
2131
+ }
2132
+ ],
2133
+ "isUnique": false,
2134
+ "where": "\"junior_identities\".\"email_verified\" = true AND \"junior_identities\".\"email_normalized\" IS NOT NULL",
2135
+ "concurrently": false,
2136
+ "method": "btree",
2137
+ "with": {}
2138
+ },
2139
+ "junior_identities_kind_provider_idx": {
2140
+ "name": "junior_identities_kind_provider_idx",
2141
+ "columns": [
2142
+ {
2143
+ "expression": "kind",
2144
+ "isExpression": false,
2145
+ "asc": true,
2146
+ "nulls": "last"
2147
+ },
2148
+ {
2149
+ "expression": "provider",
2150
+ "isExpression": false,
2151
+ "asc": true,
2152
+ "nulls": "last"
2153
+ }
2154
+ ],
2155
+ "isUnique": false,
2156
+ "concurrently": false,
2157
+ "method": "btree",
2158
+ "with": {}
2159
+ }
2160
+ },
2161
+ "foreignKeys": {
2162
+ "junior_identities_user_id_junior_users_id_fk": {
2163
+ "name": "junior_identities_user_id_junior_users_id_fk",
2164
+ "tableFrom": "junior_identities",
2165
+ "tableTo": "junior_users",
2166
+ "columnsFrom": ["user_id"],
2167
+ "columnsTo": ["id"],
2168
+ "onDelete": "no action",
2169
+ "onUpdate": "no action"
2170
+ }
2171
+ },
2172
+ "compositePrimaryKeys": {},
2173
+ "uniqueConstraints": {},
2174
+ "policies": {},
2175
+ "checkConstraints": {},
2176
+ "isRLSEnabled": false
2177
+ },
2178
+ "public.junior_location_configurations": {
2179
+ "name": "junior_location_configurations",
2180
+ "schema": "",
2181
+ "columns": {
2182
+ "location_id": {
2183
+ "name": "location_id",
2184
+ "type": "text",
2185
+ "primaryKey": false,
2186
+ "notNull": true
2187
+ },
2188
+ "key": {
2189
+ "name": "key",
2190
+ "type": "text",
2191
+ "primaryKey": false,
2192
+ "notNull": true
2193
+ },
2194
+ "value": {
2195
+ "name": "value",
2196
+ "type": "text",
2197
+ "primaryKey": false,
2198
+ "notNull": true
2199
+ },
2200
+ "updated_at": {
2201
+ "name": "updated_at",
2202
+ "type": "timestamp with time zone",
2203
+ "primaryKey": false,
2204
+ "notNull": true
2205
+ },
2206
+ "updated_by": {
2207
+ "name": "updated_by",
2208
+ "type": "text",
2209
+ "primaryKey": false,
2210
+ "notNull": false
2211
+ },
2212
+ "source": {
2213
+ "name": "source",
2214
+ "type": "text",
2215
+ "primaryKey": false,
2216
+ "notNull": false
2217
+ },
2218
+ "expires_at": {
2219
+ "name": "expires_at",
2220
+ "type": "text",
2221
+ "primaryKey": false,
2222
+ "notNull": false
2223
+ }
2224
+ },
2225
+ "indexes": {},
2226
+ "foreignKeys": {
2227
+ "junior_location_configurations_location_id_junior_destinations_id_fk": {
2228
+ "name": "junior_location_configurations_location_id_junior_destinations_id_fk",
2229
+ "tableFrom": "junior_location_configurations",
2230
+ "tableTo": "junior_destinations",
2231
+ "columnsFrom": ["location_id"],
2232
+ "columnsTo": ["id"],
2233
+ "onDelete": "cascade",
2234
+ "onUpdate": "no action"
2235
+ }
2236
+ },
2237
+ "compositePrimaryKeys": {
2238
+ "junior_location_configurations_location_id_key_pk": {
2239
+ "name": "junior_location_configurations_location_id_key_pk",
2240
+ "columns": ["location_id", "key"]
2241
+ }
2242
+ },
2243
+ "uniqueConstraints": {},
2244
+ "policies": {},
2245
+ "checkConstraints": {},
2246
+ "isRLSEnabled": false
2247
+ },
2248
+ "public.junior_scheduler_runs": {
2249
+ "name": "junior_scheduler_runs",
2250
+ "schema": "",
2251
+ "columns": {
2252
+ "id": {
2253
+ "name": "id",
2254
+ "type": "text",
2255
+ "primaryKey": true,
2256
+ "notNull": true
2257
+ },
2258
+ "task_id": {
2259
+ "name": "task_id",
2260
+ "type": "text",
2261
+ "primaryKey": false,
2262
+ "notNull": true
2263
+ },
2264
+ "status": {
2265
+ "name": "status",
2266
+ "type": "text",
2267
+ "primaryKey": false,
2268
+ "notNull": true
2269
+ },
2270
+ "scheduled_for_ms": {
2271
+ "name": "scheduled_for_ms",
2272
+ "type": "bigint",
2273
+ "primaryKey": false,
2274
+ "notNull": true
2275
+ },
2276
+ "record": {
2277
+ "name": "record",
2278
+ "type": "jsonb",
2279
+ "primaryKey": false,
2280
+ "notNull": true
2281
+ }
2282
+ },
2283
+ "indexes": {
2284
+ "junior_scheduler_runs_task_status_idx": {
2285
+ "name": "junior_scheduler_runs_task_status_idx",
2286
+ "columns": [
2287
+ {
2288
+ "expression": "task_id",
2289
+ "isExpression": false,
2290
+ "asc": true,
2291
+ "nulls": "last"
2292
+ },
2293
+ {
2294
+ "expression": "status",
2295
+ "isExpression": false,
2296
+ "asc": true,
2297
+ "nulls": "last"
2298
+ },
2299
+ {
2300
+ "expression": "scheduled_for_ms",
2301
+ "isExpression": false,
2302
+ "asc": true,
2303
+ "nulls": "last"
2304
+ }
2305
+ ],
2306
+ "isUnique": false,
2307
+ "concurrently": false,
2308
+ "method": "btree",
2309
+ "with": {}
2310
+ },
2311
+ "junior_scheduler_runs_status_idx": {
2312
+ "name": "junior_scheduler_runs_status_idx",
2313
+ "columns": [
2314
+ {
2315
+ "expression": "status",
2316
+ "isExpression": false,
2317
+ "asc": true,
2318
+ "nulls": "last"
2319
+ },
2320
+ {
2321
+ "expression": "scheduled_for_ms",
2322
+ "isExpression": false,
2323
+ "asc": true,
2324
+ "nulls": "last"
2325
+ }
2326
+ ],
2327
+ "isUnique": false,
2328
+ "concurrently": false,
2329
+ "method": "btree",
2330
+ "with": {}
2331
+ }
2332
+ },
2333
+ "foreignKeys": {},
2334
+ "compositePrimaryKeys": {},
2335
+ "uniqueConstraints": {},
2336
+ "policies": {},
2337
+ "checkConstraints": {},
2338
+ "isRLSEnabled": false
2339
+ },
2340
+ "public.junior_scheduler_tasks": {
2341
+ "name": "junior_scheduler_tasks",
2342
+ "schema": "",
2343
+ "columns": {
2344
+ "id": {
2345
+ "name": "id",
2346
+ "type": "text",
2347
+ "primaryKey": true,
2348
+ "notNull": true
2349
+ },
2350
+ "team_id": {
2351
+ "name": "team_id",
2352
+ "type": "text",
2353
+ "primaryKey": false,
2354
+ "notNull": true
2355
+ },
2356
+ "creator_slack_user_id": {
2357
+ "name": "creator_slack_user_id",
2358
+ "type": "text",
2359
+ "primaryKey": false,
2360
+ "notNull": false
2361
+ },
2362
+ "creator_identity_id": {
2363
+ "name": "creator_identity_id",
2364
+ "type": "text",
2365
+ "primaryKey": false,
2366
+ "notNull": false
2367
+ },
2368
+ "status": {
2369
+ "name": "status",
2370
+ "type": "text",
2371
+ "primaryKey": false,
2372
+ "notNull": true
2373
+ },
2374
+ "next_run_at_ms": {
2375
+ "name": "next_run_at_ms",
2376
+ "type": "bigint",
2377
+ "primaryKey": false,
2378
+ "notNull": false
2379
+ },
2380
+ "run_now_at_ms": {
2381
+ "name": "run_now_at_ms",
2382
+ "type": "bigint",
2383
+ "primaryKey": false,
2384
+ "notNull": false
2385
+ },
2386
+ "created_at_ms": {
2387
+ "name": "created_at_ms",
2388
+ "type": "bigint",
2389
+ "primaryKey": false,
2390
+ "notNull": true
2391
+ },
2392
+ "title": {
2393
+ "name": "title",
2394
+ "type": "text",
2395
+ "primaryKey": false,
2396
+ "notNull": false
2397
+ },
2398
+ "record": {
2399
+ "name": "record",
2400
+ "type": "jsonb",
2401
+ "primaryKey": false,
2402
+ "notNull": true
2403
+ }
2404
+ },
2405
+ "indexes": {
2406
+ "junior_scheduler_tasks_creator_idx": {
2407
+ "name": "junior_scheduler_tasks_creator_idx",
2408
+ "columns": [
2409
+ {
2410
+ "expression": "team_id",
2411
+ "isExpression": false,
2412
+ "asc": true,
2413
+ "nulls": "last"
2414
+ },
2415
+ {
2416
+ "expression": "creator_slack_user_id",
2417
+ "isExpression": false,
2418
+ "asc": true,
2419
+ "nulls": "last"
2420
+ },
2421
+ {
2422
+ "expression": "created_at_ms",
2423
+ "isExpression": false,
2424
+ "asc": true,
2425
+ "nulls": "last"
2426
+ },
2427
+ {
2428
+ "expression": "id",
2429
+ "isExpression": false,
2430
+ "asc": true,
2431
+ "nulls": "last"
2432
+ }
2433
+ ],
2434
+ "isUnique": false,
2435
+ "where": "\"junior_scheduler_tasks\".\"status\" <> 'deleted'",
2436
+ "concurrently": false,
2437
+ "method": "btree",
2438
+ "with": {}
2439
+ },
2440
+ "junior_scheduler_tasks_creator_identity_idx": {
2441
+ "name": "junior_scheduler_tasks_creator_identity_idx",
2442
+ "columns": [
2443
+ {
2444
+ "expression": "creator_identity_id",
2445
+ "isExpression": false,
2446
+ "asc": true,
2447
+ "nulls": "last"
2448
+ },
2449
+ {
2450
+ "expression": "created_at_ms",
2451
+ "isExpression": false,
2452
+ "asc": true,
2453
+ "nulls": "last"
2454
+ },
2455
+ {
2456
+ "expression": "id",
2457
+ "isExpression": false,
2458
+ "asc": true,
2459
+ "nulls": "last"
2460
+ }
2461
+ ],
2462
+ "isUnique": false,
2463
+ "where": "\"junior_scheduler_tasks\".\"status\" <> 'deleted' AND \"junior_scheduler_tasks\".\"creator_identity_id\" IS NOT NULL",
2464
+ "concurrently": false,
2465
+ "method": "btree",
2466
+ "with": {}
2467
+ },
2468
+ "junior_scheduler_tasks_team_status_idx": {
2469
+ "name": "junior_scheduler_tasks_team_status_idx",
2470
+ "columns": [
2471
+ {
2472
+ "expression": "team_id",
2473
+ "isExpression": false,
2474
+ "asc": true,
2475
+ "nulls": "last"
2476
+ },
2477
+ {
2478
+ "expression": "created_at_ms",
2479
+ "isExpression": false,
2480
+ "asc": true,
2481
+ "nulls": "last"
2482
+ },
2483
+ {
2484
+ "expression": "id",
2485
+ "isExpression": false,
2486
+ "asc": true,
2487
+ "nulls": "last"
2488
+ }
2489
+ ],
2490
+ "isUnique": false,
2491
+ "where": "\"junior_scheduler_tasks\".\"status\" <> 'deleted'",
2492
+ "concurrently": false,
2493
+ "method": "btree",
2494
+ "with": {}
2495
+ },
2496
+ "junior_scheduler_tasks_run_now_due_idx": {
2497
+ "name": "junior_scheduler_tasks_run_now_due_idx",
2498
+ "columns": [
2499
+ {
2500
+ "expression": "run_now_at_ms",
2501
+ "isExpression": false,
2502
+ "asc": true,
2503
+ "nulls": "last"
2504
+ },
2505
+ {
2506
+ "expression": "created_at_ms",
2507
+ "isExpression": false,
2508
+ "asc": true,
2509
+ "nulls": "last"
2510
+ },
2511
+ {
2512
+ "expression": "id",
2513
+ "isExpression": false,
2514
+ "asc": true,
2515
+ "nulls": "last"
2516
+ }
2517
+ ],
2518
+ "isUnique": false,
2519
+ "where": "\"junior_scheduler_tasks\".\"status\" = 'active' AND \"junior_scheduler_tasks\".\"run_now_at_ms\" IS NOT NULL",
2520
+ "concurrently": false,
2521
+ "method": "btree",
2522
+ "with": {}
2523
+ },
2524
+ "junior_scheduler_tasks_next_run_due_idx": {
2525
+ "name": "junior_scheduler_tasks_next_run_due_idx",
2526
+ "columns": [
2527
+ {
2528
+ "expression": "next_run_at_ms",
2529
+ "isExpression": false,
2530
+ "asc": true,
2531
+ "nulls": "last"
2532
+ },
2533
+ {
2534
+ "expression": "created_at_ms",
2535
+ "isExpression": false,
2536
+ "asc": true,
2537
+ "nulls": "last"
2538
+ },
2539
+ {
2540
+ "expression": "id",
2541
+ "isExpression": false,
2542
+ "asc": true,
2543
+ "nulls": "last"
2544
+ }
2545
+ ],
2546
+ "isUnique": false,
2547
+ "where": "\"junior_scheduler_tasks\".\"status\" = 'active' AND \"junior_scheduler_tasks\".\"next_run_at_ms\" IS NOT NULL",
2548
+ "concurrently": false,
2549
+ "method": "btree",
2550
+ "with": {}
2551
+ }
2552
+ },
2553
+ "foreignKeys": {},
2554
+ "compositePrimaryKeys": {},
2555
+ "uniqueConstraints": {},
2556
+ "policies": {},
2557
+ "checkConstraints": {},
2558
+ "isRLSEnabled": false
2559
+ },
2560
+ "public.junior_snapshots": {
2561
+ "name": "junior_snapshots",
2562
+ "schema": "",
2563
+ "columns": {
2564
+ "id": {
2565
+ "name": "id",
2566
+ "type": "text",
2567
+ "primaryKey": true,
2568
+ "notNull": true
2569
+ },
2570
+ "workspace_id": {
2571
+ "name": "workspace_id",
2572
+ "type": "text",
2573
+ "primaryKey": false,
2574
+ "notNull": true
2575
+ },
2576
+ "profile_hash": {
2577
+ "name": "profile_hash",
2578
+ "type": "text",
2579
+ "primaryKey": false,
2580
+ "notNull": true
2581
+ },
2582
+ "status": {
2583
+ "name": "status",
2584
+ "type": "text",
2585
+ "primaryKey": false,
2586
+ "notNull": true
2587
+ },
2588
+ "snapshot_id": {
2589
+ "name": "snapshot_id",
2590
+ "type": "text",
2591
+ "primaryKey": false,
2592
+ "notNull": false
2593
+ },
2594
+ "build_duration_ms": {
2595
+ "name": "build_duration_ms",
2596
+ "type": "integer",
2597
+ "primaryKey": false,
2598
+ "notNull": false
2599
+ },
2600
+ "size_bytes": {
2601
+ "name": "size_bytes",
2602
+ "type": "bigint",
2603
+ "primaryKey": false,
2604
+ "notNull": false
2605
+ },
2606
+ "generated_at": {
2607
+ "name": "generated_at",
2608
+ "type": "timestamp with time zone",
2609
+ "primaryKey": false,
2610
+ "notNull": false
2611
+ },
2612
+ "build_started_at": {
2613
+ "name": "build_started_at",
2614
+ "type": "timestamp with time zone",
2615
+ "primaryKey": false,
2616
+ "notNull": false
2617
+ },
2618
+ "build_phase": {
2619
+ "name": "build_phase",
2620
+ "type": "text",
2621
+ "primaryKey": false,
2622
+ "notNull": false
2623
+ },
2624
+ "build_sandbox_name": {
2625
+ "name": "build_sandbox_name",
2626
+ "type": "text",
2627
+ "primaryKey": false,
2628
+ "notNull": false
2629
+ },
2630
+ "build_command_id": {
2631
+ "name": "build_command_id",
2632
+ "type": "text",
2633
+ "primaryKey": false,
2634
+ "notNull": false
2635
+ },
2636
+ "build_error": {
2637
+ "name": "build_error",
2638
+ "type": "text",
2639
+ "primaryKey": false,
2640
+ "notNull": false
2641
+ },
2642
+ "created_at": {
2643
+ "name": "created_at",
2644
+ "type": "timestamp with time zone",
2645
+ "primaryKey": false,
2646
+ "notNull": true
2647
+ },
2648
+ "updated_at": {
2649
+ "name": "updated_at",
2650
+ "type": "timestamp with time zone",
2651
+ "primaryKey": false,
2652
+ "notNull": true
2653
+ }
2654
+ },
2655
+ "indexes": {
2656
+ "junior_snapshots_snapshot_id_uidx": {
2657
+ "name": "junior_snapshots_snapshot_id_uidx",
2658
+ "columns": [
2659
+ {
2660
+ "expression": "snapshot_id",
2661
+ "isExpression": false,
2662
+ "asc": true,
2663
+ "nulls": "last"
2664
+ }
2665
+ ],
2666
+ "isUnique": true,
2667
+ "concurrently": false,
2668
+ "method": "btree",
2669
+ "with": {}
2670
+ },
2671
+ "junior_snapshots_workspace_idx": {
2672
+ "name": "junior_snapshots_workspace_idx",
2673
+ "columns": [
2674
+ {
2675
+ "expression": "workspace_id",
2676
+ "isExpression": false,
2677
+ "asc": true,
2678
+ "nulls": "last"
2679
+ }
2680
+ ],
2681
+ "isUnique": false,
2682
+ "concurrently": false,
2683
+ "method": "btree",
2684
+ "with": {}
2685
+ },
2686
+ "junior_snapshots_workspace_profile_status_idx": {
2687
+ "name": "junior_snapshots_workspace_profile_status_idx",
2688
+ "columns": [
2689
+ {
2690
+ "expression": "workspace_id",
2691
+ "isExpression": false,
2692
+ "asc": true,
2693
+ "nulls": "last"
2694
+ },
2695
+ {
2696
+ "expression": "profile_hash",
2697
+ "isExpression": false,
2698
+ "asc": true,
2699
+ "nulls": "last"
2700
+ },
2701
+ {
2702
+ "expression": "status",
2703
+ "isExpression": false,
2704
+ "asc": true,
2705
+ "nulls": "last"
2706
+ }
2707
+ ],
2708
+ "isUnique": false,
2709
+ "concurrently": false,
2710
+ "method": "btree",
2711
+ "with": {}
2712
+ },
2713
+ "junior_snapshots_active_build_uidx": {
2714
+ "name": "junior_snapshots_active_build_uidx",
2715
+ "columns": [
2716
+ {
2717
+ "expression": "workspace_id",
2718
+ "isExpression": false,
2719
+ "asc": true,
2720
+ "nulls": "last"
2721
+ },
2722
+ {
2723
+ "expression": "profile_hash",
2724
+ "isExpression": false,
2725
+ "asc": true,
2726
+ "nulls": "last"
2727
+ }
2728
+ ],
2729
+ "isUnique": true,
2730
+ "where": "\"junior_snapshots\".\"status\" = 'building'",
2731
+ "concurrently": false,
2732
+ "method": "btree",
2733
+ "with": {}
2734
+ },
2735
+ "junior_snapshots_workspace_status_idx": {
2736
+ "name": "junior_snapshots_workspace_status_idx",
2737
+ "columns": [
2738
+ {
2739
+ "expression": "workspace_id",
2740
+ "isExpression": false,
2741
+ "asc": true,
2742
+ "nulls": "last"
2743
+ },
2744
+ {
2745
+ "expression": "status",
2746
+ "isExpression": false,
2747
+ "asc": true,
2748
+ "nulls": "last"
2749
+ }
2750
+ ],
2751
+ "isUnique": false,
2752
+ "concurrently": false,
2753
+ "method": "btree",
2754
+ "with": {}
2755
+ }
2756
+ },
2757
+ "foreignKeys": {
2758
+ "junior_snapshots_workspace_id_junior_workspaces_id_fk": {
2759
+ "name": "junior_snapshots_workspace_id_junior_workspaces_id_fk",
2760
+ "tableFrom": "junior_snapshots",
2761
+ "tableTo": "junior_workspaces",
2762
+ "columnsFrom": ["workspace_id"],
2763
+ "columnsTo": ["id"],
2764
+ "onDelete": "cascade",
2765
+ "onUpdate": "no action"
2766
+ }
2767
+ },
2768
+ "compositePrimaryKeys": {},
2769
+ "uniqueConstraints": {},
2770
+ "policies": {},
2771
+ "checkConstraints": {
2772
+ "junior_snapshots_status_check": {
2773
+ "name": "junior_snapshots_status_check",
2774
+ "value": "\"junior_snapshots\".\"status\" in ('building', 'failed', 'ready')"
2775
+ },
2776
+ "junior_snapshots_build_phase_check": {
2777
+ "name": "junior_snapshots_build_phase_check",
2778
+ "value": "\"junior_snapshots\".\"build_phase\" is null or \"junior_snapshots\".\"build_phase\" in ('created', 'dependencies_installed', 'repositories_prepared')"
2779
+ },
2780
+ "junior_snapshots_ready_fields_check": {
2781
+ "name": "junior_snapshots_ready_fields_check",
2782
+ "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)"
2783
+ },
2784
+ "junior_snapshots_build_fields_check": {
2785
+ "name": "junior_snapshots_build_fields_check",
2786
+ "value": "\"junior_snapshots\".\"status\" = 'ready' or (\"junior_snapshots\".\"build_started_at\" is not null and \"junior_snapshots\".\"build_phase\" is not null)"
2787
+ },
2788
+ "junior_snapshots_build_duration_check": {
2789
+ "name": "junior_snapshots_build_duration_check",
2790
+ "value": "\"junior_snapshots\".\"build_duration_ms\" is null or \"junior_snapshots\".\"build_duration_ms\" >= 0"
2791
+ },
2792
+ "junior_snapshots_size_bytes_check": {
2793
+ "name": "junior_snapshots_size_bytes_check",
2794
+ "value": "\"junior_snapshots\".\"size_bytes\" is null or \"junior_snapshots\".\"size_bytes\" >= 0"
2795
+ }
2796
+ },
2797
+ "isRLSEnabled": false
2798
+ },
2799
+ "public.junior_stats": {
2800
+ "name": "junior_stats",
2801
+ "schema": "",
2802
+ "columns": {
2803
+ "date": {
2804
+ "name": "date",
2805
+ "type": "date",
2806
+ "primaryKey": false,
2807
+ "notNull": true
2808
+ },
2809
+ "namespace": {
2810
+ "name": "namespace",
2811
+ "type": "text",
2812
+ "primaryKey": false,
2813
+ "notNull": true
2814
+ },
2815
+ "metric": {
2816
+ "name": "metric",
2817
+ "type": "text",
2818
+ "primaryKey": false,
2819
+ "notNull": true
2820
+ },
2821
+ "name": {
2822
+ "name": "name",
2823
+ "type": "text",
2824
+ "primaryKey": false,
2825
+ "notNull": true
2826
+ },
2827
+ "count": {
2828
+ "name": "count",
2829
+ "type": "integer",
2830
+ "primaryKey": false,
2831
+ "notNull": true,
2832
+ "default": 0
2833
+ }
2834
+ },
2835
+ "indexes": {},
2836
+ "foreignKeys": {},
2837
+ "compositePrimaryKeys": {
2838
+ "junior_stats_date_namespace_metric_name_pk": {
2839
+ "name": "junior_stats_date_namespace_metric_name_pk",
2840
+ "columns": ["date", "namespace", "metric", "name"]
2841
+ }
2842
+ },
2843
+ "uniqueConstraints": {},
2844
+ "policies": {},
2845
+ "checkConstraints": {},
2846
+ "isRLSEnabled": false
2847
+ },
2848
+ "public.junior_task_executions": {
2849
+ "name": "junior_task_executions",
2850
+ "schema": "",
2851
+ "columns": {
2852
+ "execution_id": {
2853
+ "name": "execution_id",
2854
+ "type": "text",
2855
+ "primaryKey": false,
2856
+ "notNull": true
2857
+ },
2858
+ "kind": {
2859
+ "name": "kind",
2860
+ "type": "text",
2861
+ "primaryKey": false,
2862
+ "notNull": true
2863
+ },
2864
+ "namespace": {
2865
+ "name": "namespace",
2866
+ "type": "text",
2867
+ "primaryKey": false,
2868
+ "notNull": true
2869
+ },
2870
+ "task_id": {
2871
+ "name": "task_id",
2872
+ "type": "text",
2873
+ "primaryKey": false,
2874
+ "notNull": true
2875
+ },
2876
+ "conversation_id": {
2877
+ "name": "conversation_id",
2878
+ "type": "text",
2879
+ "primaryKey": false,
2880
+ "notNull": false
2881
+ },
2882
+ "executed_at_ms": {
2883
+ "name": "executed_at_ms",
2884
+ "type": "bigint",
2885
+ "primaryKey": false,
2886
+ "notNull": true
2887
+ },
2888
+ "status": {
2889
+ "name": "status",
2890
+ "type": "text",
2891
+ "primaryKey": false,
2892
+ "notNull": true
2893
+ }
2894
+ },
2895
+ "indexes": {
2896
+ "junior_task_executions_task_time_idx": {
2897
+ "name": "junior_task_executions_task_time_idx",
2898
+ "columns": [
2899
+ {
2900
+ "expression": "kind",
2901
+ "isExpression": false,
2902
+ "asc": true,
2903
+ "nulls": "last"
2904
+ },
2905
+ {
2906
+ "expression": "namespace",
2907
+ "isExpression": false,
2908
+ "asc": true,
2909
+ "nulls": "last"
2910
+ },
2911
+ {
2912
+ "expression": "task_id",
2913
+ "isExpression": false,
2914
+ "asc": true,
2915
+ "nulls": "last"
2916
+ },
2917
+ {
2918
+ "expression": "executed_at_ms",
2919
+ "isExpression": false,
2920
+ "asc": true,
2921
+ "nulls": "last"
2922
+ }
2923
+ ],
2924
+ "isUnique": false,
2925
+ "concurrently": false,
2926
+ "method": "btree",
2927
+ "with": {}
2928
+ },
2929
+ "junior_task_executions_time_kind_idx": {
2930
+ "name": "junior_task_executions_time_kind_idx",
2931
+ "columns": [
2932
+ {
2933
+ "expression": "executed_at_ms",
2934
+ "isExpression": false,
2935
+ "asc": true,
2936
+ "nulls": "last"
2937
+ },
2938
+ {
2939
+ "expression": "kind",
2940
+ "isExpression": false,
2941
+ "asc": true,
2942
+ "nulls": "last"
2943
+ }
2944
+ ],
2945
+ "isUnique": false,
2946
+ "concurrently": false,
2947
+ "method": "btree",
2948
+ "with": {}
2949
+ },
2950
+ "junior_task_executions_conversation_time_idx": {
2951
+ "name": "junior_task_executions_conversation_time_idx",
2952
+ "columns": [
2953
+ {
2954
+ "expression": "conversation_id",
2955
+ "isExpression": false,
2956
+ "asc": true,
2957
+ "nulls": "last"
2958
+ },
2959
+ {
2960
+ "expression": "executed_at_ms",
2961
+ "isExpression": false,
2962
+ "asc": true,
2963
+ "nulls": "last"
2964
+ }
2965
+ ],
2966
+ "isUnique": false,
2967
+ "concurrently": false,
2968
+ "method": "btree",
2969
+ "with": {}
2970
+ }
2971
+ },
2972
+ "foreignKeys": {
2973
+ "junior_task_executions_conversation_id_junior_conversations_conversation_id_fk": {
2974
+ "name": "junior_task_executions_conversation_id_junior_conversations_conversation_id_fk",
2975
+ "tableFrom": "junior_task_executions",
2976
+ "tableTo": "junior_conversations",
2977
+ "columnsFrom": ["conversation_id"],
2978
+ "columnsTo": ["conversation_id"],
2979
+ "onDelete": "no action",
2980
+ "onUpdate": "no action"
2981
+ }
2982
+ },
2983
+ "compositePrimaryKeys": {
2984
+ "junior_task_executions_kind_namespace_execution_id_pk": {
2985
+ "name": "junior_task_executions_kind_namespace_execution_id_pk",
2986
+ "columns": ["kind", "namespace", "execution_id"]
2987
+ }
2988
+ },
2989
+ "uniqueConstraints": {},
2990
+ "policies": {},
2991
+ "checkConstraints": {
2992
+ "junior_task_executions_kind_check": {
2993
+ "name": "junior_task_executions_kind_check",
2994
+ "value": "\"junior_task_executions\".\"kind\" in ('scheduled', 'event')"
2995
+ },
2996
+ "junior_task_executions_status_check": {
2997
+ "name": "junior_task_executions_status_check",
2998
+ "value": "\"junior_task_executions\".\"status\" in ('blocked', 'completed', 'failed')"
2999
+ }
3000
+ },
3001
+ "isRLSEnabled": false
3002
+ },
3003
+ "public.junior_users": {
3004
+ "name": "junior_users",
3005
+ "schema": "",
3006
+ "columns": {
3007
+ "id": {
3008
+ "name": "id",
3009
+ "type": "text",
3010
+ "primaryKey": true,
3011
+ "notNull": true
3012
+ },
3013
+ "primary_email": {
3014
+ "name": "primary_email",
3015
+ "type": "text",
3016
+ "primaryKey": false,
3017
+ "notNull": true
3018
+ },
3019
+ "primary_email_normalized": {
3020
+ "name": "primary_email_normalized",
3021
+ "type": "text",
3022
+ "primaryKey": false,
3023
+ "notNull": true
3024
+ },
3025
+ "display_name": {
3026
+ "name": "display_name",
3027
+ "type": "text",
3028
+ "primaryKey": false,
3029
+ "notNull": false
3030
+ },
3031
+ "created_at": {
3032
+ "name": "created_at",
3033
+ "type": "timestamp with time zone",
3034
+ "primaryKey": false,
3035
+ "notNull": true
3036
+ },
3037
+ "updated_at": {
3038
+ "name": "updated_at",
3039
+ "type": "timestamp with time zone",
3040
+ "primaryKey": false,
3041
+ "notNull": true
3042
+ }
3043
+ },
3044
+ "indexes": {
3045
+ "junior_users_primary_email_normalized_uidx": {
3046
+ "name": "junior_users_primary_email_normalized_uidx",
3047
+ "columns": [
3048
+ {
3049
+ "expression": "primary_email_normalized",
3050
+ "isExpression": false,
3051
+ "asc": true,
3052
+ "nulls": "last"
3053
+ }
3054
+ ],
3055
+ "isUnique": true,
3056
+ "concurrently": false,
3057
+ "method": "btree",
3058
+ "with": {}
3059
+ }
3060
+ },
3061
+ "foreignKeys": {},
3062
+ "compositePrimaryKeys": {},
3063
+ "uniqueConstraints": {},
3064
+ "policies": {},
3065
+ "checkConstraints": {},
3066
+ "isRLSEnabled": false
3067
+ },
3068
+ "public.junior_workspace_repos": {
3069
+ "name": "junior_workspace_repos",
3070
+ "schema": "",
3071
+ "columns": {
3072
+ "workspace_id": {
3073
+ "name": "workspace_id",
3074
+ "type": "text",
3075
+ "primaryKey": false,
3076
+ "notNull": true
3077
+ },
3078
+ "provider": {
3079
+ "name": "provider",
3080
+ "type": "text",
3081
+ "primaryKey": false,
3082
+ "notNull": true
3083
+ },
3084
+ "repo": {
3085
+ "name": "repo",
3086
+ "type": "text",
3087
+ "primaryKey": false,
3088
+ "notNull": true
3089
+ }
3090
+ },
3091
+ "indexes": {},
3092
+ "foreignKeys": {
3093
+ "junior_workspace_repos_workspace_id_junior_workspaces_id_fk": {
3094
+ "name": "junior_workspace_repos_workspace_id_junior_workspaces_id_fk",
3095
+ "tableFrom": "junior_workspace_repos",
3096
+ "tableTo": "junior_workspaces",
3097
+ "columnsFrom": ["workspace_id"],
3098
+ "columnsTo": ["id"],
3099
+ "onDelete": "cascade",
3100
+ "onUpdate": "no action"
3101
+ }
3102
+ },
3103
+ "compositePrimaryKeys": {
3104
+ "junior_workspace_repos_workspace_id_provider_repo_pk": {
3105
+ "name": "junior_workspace_repos_workspace_id_provider_repo_pk",
3106
+ "columns": ["workspace_id", "provider", "repo"]
3107
+ }
3108
+ },
3109
+ "uniqueConstraints": {},
3110
+ "policies": {},
3111
+ "checkConstraints": {},
3112
+ "isRLSEnabled": false
3113
+ },
3114
+ "public.junior_workspaces": {
3115
+ "name": "junior_workspaces",
3116
+ "schema": "",
3117
+ "columns": {
3118
+ "id": {
3119
+ "name": "id",
3120
+ "type": "text",
3121
+ "primaryKey": true,
3122
+ "notNull": true
3123
+ },
3124
+ "name": {
3125
+ "name": "name",
3126
+ "type": "text",
3127
+ "primaryKey": false,
3128
+ "notNull": true
3129
+ },
3130
+ "setup_script": {
3131
+ "name": "setup_script",
3132
+ "type": "text",
3133
+ "primaryKey": false,
3134
+ "notNull": true,
3135
+ "default": "''"
3136
+ },
3137
+ "created_at": {
3138
+ "name": "created_at",
3139
+ "type": "timestamp with time zone",
3140
+ "primaryKey": false,
3141
+ "notNull": true
3142
+ },
3143
+ "updated_at": {
3144
+ "name": "updated_at",
3145
+ "type": "timestamp with time zone",
3146
+ "primaryKey": false,
3147
+ "notNull": true
3148
+ }
3149
+ },
3150
+ "indexes": {
3151
+ "junior_workspaces_name_idx": {
3152
+ "name": "junior_workspaces_name_idx",
3153
+ "columns": [
3154
+ {
3155
+ "expression": "name",
3156
+ "isExpression": false,
3157
+ "asc": true,
3158
+ "nulls": "last"
3159
+ }
3160
+ ],
3161
+ "isUnique": true,
3162
+ "concurrently": false,
3163
+ "method": "btree",
3164
+ "with": {}
3165
+ }
3166
+ },
3167
+ "foreignKeys": {},
3168
+ "compositePrimaryKeys": {},
3169
+ "uniqueConstraints": {},
3170
+ "policies": {},
3171
+ "checkConstraints": {},
3172
+ "isRLSEnabled": false
3173
+ }
3174
+ },
3175
+ "enums": {},
3176
+ "schemas": {},
3177
+ "sequences": {},
3178
+ "roles": {},
3179
+ "policies": {},
3180
+ "views": {},
3181
+ "_meta": {
3182
+ "columns": {},
3183
+ "schemas": {},
3184
+ "tables": {}
3185
+ }
3186
+ }