team-chat 0.0.0-stage → 0.3.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 (122) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +458 -2
  3. package/agents/rules.md +52 -0
  4. package/agents/runtimes/codex.md +14 -0
  5. package/bin/bridge +3 -0
  6. package/bin/runner +3 -0
  7. package/cli/lib/agents.js +97 -0
  8. package/cli/lib/docs.js +151 -0
  9. package/cli/lib/local.js +41 -0
  10. package/cli/lib/server.js +52 -0
  11. package/cli/lib/util.js +107 -0
  12. package/cli/team-chat.js +383 -0
  13. package/host/bridge/attempts.js +43 -0
  14. package/host/bridge/bridge.js +326 -0
  15. package/host/bridge/config.js +105 -0
  16. package/host/bridge/knowledge-outbox.js +96 -0
  17. package/host/bridge/launcher.js +126 -0
  18. package/host/bridge/main.js +87 -0
  19. package/host/bridge/progress.js +74 -0
  20. package/host/bridge/prompt.js +97 -0
  21. package/host/bridge/run-archive.js +200 -0
  22. package/host/bridge/thread.js +44 -0
  23. package/host/bridge/triage.js +97 -0
  24. package/host/bridge/workdir.js +41 -0
  25. package/host/knowledge/card.js +43 -0
  26. package/host/knowledge/errors.js +50 -0
  27. package/host/knowledge/lesson.js +153 -0
  28. package/host/knowledge/process.js +160 -0
  29. package/host/knowledge/scrub.js +29 -0
  30. package/host/knowledge/shell.js +74 -0
  31. package/host/knowledge/stack.js +229 -0
  32. package/host/knowledge/transcript.js +82 -0
  33. package/host/lib/chat-api.js +120 -0
  34. package/host/lib/log.js +6 -0
  35. package/host/lib/pid-lock.js +65 -0
  36. package/host/lib/shell-words.js +45 -0
  37. package/host/runner/bridge-process.js +82 -0
  38. package/host/runner/config.js +81 -0
  39. package/host/runner/main.js +69 -0
  40. package/host/runner/retention.js +40 -0
  41. package/host/runner/runner.js +161 -0
  42. package/package.json +67 -5
  43. package/server/dist/src/app.js +25 -0
  44. package/server/dist/src/app.module.js +50 -0
  45. package/server/dist/src/attachments/attachment-store.js +111 -0
  46. package/server/dist/src/attachments/attachments.controller.js +67 -0
  47. package/server/dist/src/attachments/mime.js +84 -0
  48. package/server/dist/src/attachments/uploads.interceptor.js +72 -0
  49. package/server/dist/src/auth/participant.guard.js +53 -0
  50. package/server/dist/src/bridges/bridge-restart.service.js +80 -0
  51. package/server/dist/src/bridges/bridges.controller.js +47 -0
  52. package/server/dist/src/chats/chats.controller.js +83 -0
  53. package/server/dist/src/chats/chats.service.js +128 -0
  54. package/server/dist/src/collector/collector.controller.js +71 -0
  55. package/server/dist/src/collector/collector.module.js +23 -0
  56. package/server/dist/src/collector/collector.service.js +111 -0
  57. package/server/dist/src/common/clock.js +20 -0
  58. package/server/dist/src/common/errors.js +37 -0
  59. package/server/dist/src/common/format.js +14 -0
  60. package/server/dist/src/common/http.js +17 -0
  61. package/server/dist/src/common/slug.js +28 -0
  62. package/server/dist/src/common/tokens.js +19 -0
  63. package/server/dist/src/common/validation.js +41 -0
  64. package/server/dist/src/config/config.js +39 -0
  65. package/server/dist/src/conversation.module.js +41 -0
  66. package/server/dist/src/db/database.js +73 -0
  67. package/server/dist/src/db/database.module.js +51 -0
  68. package/server/dist/src/db/schema.js +212 -0
  69. package/server/dist/src/decisions/decisions.controller.js +55 -0
  70. package/server/dist/src/decisions/decisions.service.js +109 -0
  71. package/server/dist/src/documents/documents.controller.js +87 -0
  72. package/server/dist/src/documents/documents.service.js +189 -0
  73. package/server/dist/src/health/health.controller.js +29 -0
  74. package/server/dist/src/knowledge/knowledge.controller.js +83 -0
  75. package/server/dist/src/knowledge/knowledge.module.js +25 -0
  76. package/server/dist/src/knowledge/knowledge.service.js +189 -0
  77. package/server/dist/src/local/docs-sync.service.js +97 -0
  78. package/server/dist/src/local/local.controller.js +197 -0
  79. package/server/dist/src/local/local.guard.js +55 -0
  80. package/server/dist/src/local/local.module.js +30 -0
  81. package/server/dist/src/local/setup.service.js +154 -0
  82. package/server/dist/src/local/transfer.service.js +151 -0
  83. package/server/dist/src/main.js +33 -0
  84. package/server/dist/src/mcp/chat-tools.js +282 -0
  85. package/server/dist/src/mcp/mcp.controller.js +58 -0
  86. package/server/dist/src/mcp/mcp.module.js +24 -0
  87. package/server/dist/src/mentions/mention-state.js +80 -0
  88. package/server/dist/src/mentions/mentions.controller.js +100 -0
  89. package/server/dist/src/mentions/mentions.service.js +203 -0
  90. package/server/dist/src/messages/message.presenter.js +102 -0
  91. package/server/dist/src/messages/messages.service.js +149 -0
  92. package/server/dist/src/messages/thread.controller.js +179 -0
  93. package/server/dist/src/participants/directory.service.js +68 -0
  94. package/server/dist/src/participants/participants.module.js +24 -0
  95. package/server/dist/src/participants/participants.service.js +84 -0
  96. package/server/dist/src/settings/settings.service.js +42 -0
  97. package/server/dist/src/sharing/consent.js +16 -0
  98. package/server/dist/src/sharing/sharing.module.js +22 -0
  99. package/server/dist/src/sharing/sharing.service.js +175 -0
  100. package/server/dist/src/team/runner.service.js +75 -0
  101. package/server/dist/src/team/team.controller.js +178 -0
  102. package/server/dist/src/team/team.module.js +25 -0
  103. package/server/dist/src/team/team.service.js +280 -0
  104. package/server/dist/src/web/template.js +57 -0
  105. package/server/dist/src/web/web-login.service.js +74 -0
  106. package/server/dist/src/web/web.controller.js +203 -0
  107. package/server/dist/src/web/web.module.js +25 -0
  108. package/server/drizzle/0000_init.sql +169 -0
  109. package/server/drizzle/0001_seed_roles.sql +25 -0
  110. package/server/drizzle/0002_knowledge.sql +17 -0
  111. package/server/drizzle/0003_sharing.sql +30 -0
  112. package/server/drizzle/meta/0000_snapshot.json +1224 -0
  113. package/server/drizzle/meta/0001_snapshot.json +1224 -0
  114. package/server/drizzle/meta/0002_snapshot.json +1359 -0
  115. package/server/drizzle/meta/0003_snapshot.json +1545 -0
  116. package/server/drizzle/meta/_journal.json +34 -0
  117. package/server/package.json +1 -0
  118. package/server/views/chat.html +865 -0
  119. package/server/views/documents.html +204 -0
  120. package/server/views/login.html +31 -0
  121. package/server/views/setup.html +60 -0
  122. package/server/views/team.html +369 -0
@@ -0,0 +1,1545 @@
1
+ {
2
+ "id": "31d1e9b0-243e-45c7-95af-1f022b8925cb",
3
+ "prevId": "efcc6ed3-9449-4389-a5dc-b2d1ff11ee7a",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.attachments": {
8
+ "name": "attachments",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "serial",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "message_id": {
18
+ "name": "message_id",
19
+ "type": "integer",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "name": {
24
+ "name": "name",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "mime": {
30
+ "name": "mime",
31
+ "type": "varchar(191)",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "size": {
36
+ "name": "size",
37
+ "type": "bigint",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "path": {
42
+ "name": "path",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": true
46
+ },
47
+ "created_at": {
48
+ "name": "created_at",
49
+ "type": "timestamp with time zone",
50
+ "primaryKey": false,
51
+ "notNull": true,
52
+ "default": "now()"
53
+ },
54
+ "updated_at": {
55
+ "name": "updated_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": "now()"
60
+ }
61
+ },
62
+ "indexes": {},
63
+ "foreignKeys": {
64
+ "attachments_message_id_messages_id_fk": {
65
+ "name": "attachments_message_id_messages_id_fk",
66
+ "tableFrom": "attachments",
67
+ "tableTo": "messages",
68
+ "columnsFrom": [
69
+ "message_id"
70
+ ],
71
+ "columnsTo": [
72
+ "id"
73
+ ],
74
+ "onDelete": "cascade",
75
+ "onUpdate": "no action"
76
+ }
77
+ },
78
+ "compositePrimaryKeys": {},
79
+ "uniqueConstraints": {},
80
+ "policies": {},
81
+ "checkConstraints": {},
82
+ "isRLSEnabled": false
83
+ },
84
+ "public.chat_agent_roles": {
85
+ "name": "chat_agent_roles",
86
+ "schema": "",
87
+ "columns": {
88
+ "id": {
89
+ "name": "id",
90
+ "type": "serial",
91
+ "primaryKey": true,
92
+ "notNull": true
93
+ },
94
+ "chat_id": {
95
+ "name": "chat_id",
96
+ "type": "integer",
97
+ "primaryKey": false,
98
+ "notNull": true
99
+ },
100
+ "participant_id": {
101
+ "name": "participant_id",
102
+ "type": "integer",
103
+ "primaryKey": false,
104
+ "notNull": true
105
+ },
106
+ "role": {
107
+ "name": "role",
108
+ "type": "text",
109
+ "primaryKey": false,
110
+ "notNull": true
111
+ },
112
+ "created_at": {
113
+ "name": "created_at",
114
+ "type": "timestamp with time zone",
115
+ "primaryKey": false,
116
+ "notNull": true,
117
+ "default": "now()"
118
+ },
119
+ "updated_at": {
120
+ "name": "updated_at",
121
+ "type": "timestamp with time zone",
122
+ "primaryKey": false,
123
+ "notNull": true,
124
+ "default": "now()"
125
+ }
126
+ },
127
+ "indexes": {},
128
+ "foreignKeys": {
129
+ "chat_agent_roles_chat_id_chats_id_fk": {
130
+ "name": "chat_agent_roles_chat_id_chats_id_fk",
131
+ "tableFrom": "chat_agent_roles",
132
+ "tableTo": "chats",
133
+ "columnsFrom": [
134
+ "chat_id"
135
+ ],
136
+ "columnsTo": [
137
+ "id"
138
+ ],
139
+ "onDelete": "cascade",
140
+ "onUpdate": "no action"
141
+ },
142
+ "chat_agent_roles_participant_id_participants_id_fk": {
143
+ "name": "chat_agent_roles_participant_id_participants_id_fk",
144
+ "tableFrom": "chat_agent_roles",
145
+ "tableTo": "participants",
146
+ "columnsFrom": [
147
+ "participant_id"
148
+ ],
149
+ "columnsTo": [
150
+ "id"
151
+ ],
152
+ "onDelete": "cascade",
153
+ "onUpdate": "no action"
154
+ }
155
+ },
156
+ "compositePrimaryKeys": {},
157
+ "uniqueConstraints": {
158
+ "chat_agent_roles_chat_id_participant_id_unique": {
159
+ "name": "chat_agent_roles_chat_id_participant_id_unique",
160
+ "nullsNotDistinct": false,
161
+ "columns": [
162
+ "chat_id",
163
+ "participant_id"
164
+ ]
165
+ }
166
+ },
167
+ "policies": {},
168
+ "checkConstraints": {},
169
+ "isRLSEnabled": false
170
+ },
171
+ "public.chats": {
172
+ "name": "chats",
173
+ "schema": "",
174
+ "columns": {
175
+ "id": {
176
+ "name": "id",
177
+ "type": "serial",
178
+ "primaryKey": true,
179
+ "notNull": true
180
+ },
181
+ "slug": {
182
+ "name": "slug",
183
+ "type": "text",
184
+ "primaryKey": false,
185
+ "notNull": true
186
+ },
187
+ "name": {
188
+ "name": "name",
189
+ "type": "text",
190
+ "primaryKey": false,
191
+ "notNull": true
192
+ },
193
+ "description": {
194
+ "name": "description",
195
+ "type": "text",
196
+ "primaryKey": false,
197
+ "notNull": false
198
+ },
199
+ "workdir": {
200
+ "name": "workdir",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": false
204
+ },
205
+ "created_at": {
206
+ "name": "created_at",
207
+ "type": "timestamp with time zone",
208
+ "primaryKey": false,
209
+ "notNull": true,
210
+ "default": "now()"
211
+ },
212
+ "updated_at": {
213
+ "name": "updated_at",
214
+ "type": "timestamp with time zone",
215
+ "primaryKey": false,
216
+ "notNull": true,
217
+ "default": "now()"
218
+ }
219
+ },
220
+ "indexes": {},
221
+ "foreignKeys": {},
222
+ "compositePrimaryKeys": {},
223
+ "uniqueConstraints": {
224
+ "chats_slug_unique": {
225
+ "name": "chats_slug_unique",
226
+ "nullsNotDistinct": false,
227
+ "columns": [
228
+ "slug"
229
+ ]
230
+ }
231
+ },
232
+ "policies": {},
233
+ "checkConstraints": {},
234
+ "isRLSEnabled": false
235
+ },
236
+ "public.collected_cards": {
237
+ "name": "collected_cards",
238
+ "schema": "",
239
+ "columns": {
240
+ "id": {
241
+ "name": "id",
242
+ "type": "serial",
243
+ "primaryKey": true,
244
+ "notNull": true
245
+ },
246
+ "installation_id": {
247
+ "name": "installation_id",
248
+ "type": "integer",
249
+ "primaryKey": false,
250
+ "notNull": true
251
+ },
252
+ "ref": {
253
+ "name": "ref",
254
+ "type": "varchar(64)",
255
+ "primaryKey": false,
256
+ "notNull": true
257
+ },
258
+ "format": {
259
+ "name": "format",
260
+ "type": "integer",
261
+ "primaryKey": false,
262
+ "notNull": true
263
+ },
264
+ "card": {
265
+ "name": "card",
266
+ "type": "jsonb",
267
+ "primaryKey": false,
268
+ "notNull": true
269
+ },
270
+ "created_at": {
271
+ "name": "created_at",
272
+ "type": "timestamp with time zone",
273
+ "primaryKey": false,
274
+ "notNull": true,
275
+ "default": "now()"
276
+ },
277
+ "updated_at": {
278
+ "name": "updated_at",
279
+ "type": "timestamp with time zone",
280
+ "primaryKey": false,
281
+ "notNull": true,
282
+ "default": "now()"
283
+ }
284
+ },
285
+ "indexes": {},
286
+ "foreignKeys": {
287
+ "collected_cards_installation_id_collector_installations_id_fk": {
288
+ "name": "collected_cards_installation_id_collector_installations_id_fk",
289
+ "tableFrom": "collected_cards",
290
+ "tableTo": "collector_installations",
291
+ "columnsFrom": [
292
+ "installation_id"
293
+ ],
294
+ "columnsTo": [
295
+ "id"
296
+ ],
297
+ "onDelete": "cascade",
298
+ "onUpdate": "no action"
299
+ }
300
+ },
301
+ "compositePrimaryKeys": {},
302
+ "uniqueConstraints": {
303
+ "collected_cards_installation_id_ref_unique": {
304
+ "name": "collected_cards_installation_id_ref_unique",
305
+ "nullsNotDistinct": false,
306
+ "columns": [
307
+ "installation_id",
308
+ "ref"
309
+ ]
310
+ }
311
+ },
312
+ "policies": {},
313
+ "checkConstraints": {},
314
+ "isRLSEnabled": false
315
+ },
316
+ "public.collector_installations": {
317
+ "name": "collector_installations",
318
+ "schema": "",
319
+ "columns": {
320
+ "id": {
321
+ "name": "id",
322
+ "type": "serial",
323
+ "primaryKey": true,
324
+ "notNull": true
325
+ },
326
+ "token_hash": {
327
+ "name": "token_hash",
328
+ "type": "varchar(64)",
329
+ "primaryKey": false,
330
+ "notNull": true
331
+ },
332
+ "last_seen_at": {
333
+ "name": "last_seen_at",
334
+ "type": "timestamp with time zone",
335
+ "primaryKey": false,
336
+ "notNull": false
337
+ },
338
+ "created_at": {
339
+ "name": "created_at",
340
+ "type": "timestamp with time zone",
341
+ "primaryKey": false,
342
+ "notNull": true,
343
+ "default": "now()"
344
+ },
345
+ "updated_at": {
346
+ "name": "updated_at",
347
+ "type": "timestamp with time zone",
348
+ "primaryKey": false,
349
+ "notNull": true,
350
+ "default": "now()"
351
+ }
352
+ },
353
+ "indexes": {},
354
+ "foreignKeys": {},
355
+ "compositePrimaryKeys": {},
356
+ "uniqueConstraints": {
357
+ "collector_installations_token_hash_unique": {
358
+ "name": "collector_installations_token_hash_unique",
359
+ "nullsNotDistinct": false,
360
+ "columns": [
361
+ "token_hash"
362
+ ]
363
+ }
364
+ },
365
+ "policies": {},
366
+ "checkConstraints": {},
367
+ "isRLSEnabled": false
368
+ },
369
+ "public.decisions": {
370
+ "name": "decisions",
371
+ "schema": "",
372
+ "columns": {
373
+ "id": {
374
+ "name": "id",
375
+ "type": "serial",
376
+ "primaryKey": true,
377
+ "notNull": true
378
+ },
379
+ "chat_id": {
380
+ "name": "chat_id",
381
+ "type": "integer",
382
+ "primaryKey": false,
383
+ "notNull": true
384
+ },
385
+ "number": {
386
+ "name": "number",
387
+ "type": "integer",
388
+ "primaryKey": false,
389
+ "notNull": true
390
+ },
391
+ "participant_id": {
392
+ "name": "participant_id",
393
+ "type": "integer",
394
+ "primaryKey": false,
395
+ "notNull": true
396
+ },
397
+ "title": {
398
+ "name": "title",
399
+ "type": "text",
400
+ "primaryKey": false,
401
+ "notNull": true
402
+ },
403
+ "body": {
404
+ "name": "body",
405
+ "type": "text",
406
+ "primaryKey": false,
407
+ "notNull": false
408
+ },
409
+ "message_id": {
410
+ "name": "message_id",
411
+ "type": "integer",
412
+ "primaryKey": false,
413
+ "notNull": false
414
+ },
415
+ "supersedes_id": {
416
+ "name": "supersedes_id",
417
+ "type": "integer",
418
+ "primaryKey": false,
419
+ "notNull": false
420
+ },
421
+ "created_at": {
422
+ "name": "created_at",
423
+ "type": "timestamp with time zone",
424
+ "primaryKey": false,
425
+ "notNull": true,
426
+ "default": "now()"
427
+ },
428
+ "updated_at": {
429
+ "name": "updated_at",
430
+ "type": "timestamp with time zone",
431
+ "primaryKey": false,
432
+ "notNull": true,
433
+ "default": "now()"
434
+ }
435
+ },
436
+ "indexes": {},
437
+ "foreignKeys": {
438
+ "decisions_chat_id_chats_id_fk": {
439
+ "name": "decisions_chat_id_chats_id_fk",
440
+ "tableFrom": "decisions",
441
+ "tableTo": "chats",
442
+ "columnsFrom": [
443
+ "chat_id"
444
+ ],
445
+ "columnsTo": [
446
+ "id"
447
+ ],
448
+ "onDelete": "cascade",
449
+ "onUpdate": "no action"
450
+ },
451
+ "decisions_participant_id_participants_id_fk": {
452
+ "name": "decisions_participant_id_participants_id_fk",
453
+ "tableFrom": "decisions",
454
+ "tableTo": "participants",
455
+ "columnsFrom": [
456
+ "participant_id"
457
+ ],
458
+ "columnsTo": [
459
+ "id"
460
+ ],
461
+ "onDelete": "cascade",
462
+ "onUpdate": "no action"
463
+ },
464
+ "decisions_message_id_messages_id_fk": {
465
+ "name": "decisions_message_id_messages_id_fk",
466
+ "tableFrom": "decisions",
467
+ "tableTo": "messages",
468
+ "columnsFrom": [
469
+ "message_id"
470
+ ],
471
+ "columnsTo": [
472
+ "id"
473
+ ],
474
+ "onDelete": "set null",
475
+ "onUpdate": "no action"
476
+ },
477
+ "decisions_supersedes_id_decisions_id_fk": {
478
+ "name": "decisions_supersedes_id_decisions_id_fk",
479
+ "tableFrom": "decisions",
480
+ "tableTo": "decisions",
481
+ "columnsFrom": [
482
+ "supersedes_id"
483
+ ],
484
+ "columnsTo": [
485
+ "id"
486
+ ],
487
+ "onDelete": "set null",
488
+ "onUpdate": "no action"
489
+ }
490
+ },
491
+ "compositePrimaryKeys": {},
492
+ "uniqueConstraints": {
493
+ "decisions_chat_id_number_unique": {
494
+ "name": "decisions_chat_id_number_unique",
495
+ "nullsNotDistinct": false,
496
+ "columns": [
497
+ "chat_id",
498
+ "number"
499
+ ]
500
+ }
501
+ },
502
+ "policies": {},
503
+ "checkConstraints": {},
504
+ "isRLSEnabled": false
505
+ },
506
+ "public.document_versions": {
507
+ "name": "document_versions",
508
+ "schema": "",
509
+ "columns": {
510
+ "id": {
511
+ "name": "id",
512
+ "type": "serial",
513
+ "primaryKey": true,
514
+ "notNull": true
515
+ },
516
+ "document_id": {
517
+ "name": "document_id",
518
+ "type": "integer",
519
+ "primaryKey": false,
520
+ "notNull": true
521
+ },
522
+ "revision": {
523
+ "name": "revision",
524
+ "type": "integer",
525
+ "primaryKey": false,
526
+ "notNull": true
527
+ },
528
+ "body": {
529
+ "name": "body",
530
+ "type": "text",
531
+ "primaryKey": false,
532
+ "notNull": true
533
+ },
534
+ "participant_id": {
535
+ "name": "participant_id",
536
+ "type": "integer",
537
+ "primaryKey": false,
538
+ "notNull": false
539
+ },
540
+ "note": {
541
+ "name": "note",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": false
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp with time zone",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ },
553
+ "updated_at": {
554
+ "name": "updated_at",
555
+ "type": "timestamp with time zone",
556
+ "primaryKey": false,
557
+ "notNull": true,
558
+ "default": "now()"
559
+ }
560
+ },
561
+ "indexes": {},
562
+ "foreignKeys": {
563
+ "document_versions_document_id_documents_id_fk": {
564
+ "name": "document_versions_document_id_documents_id_fk",
565
+ "tableFrom": "document_versions",
566
+ "tableTo": "documents",
567
+ "columnsFrom": [
568
+ "document_id"
569
+ ],
570
+ "columnsTo": [
571
+ "id"
572
+ ],
573
+ "onDelete": "cascade",
574
+ "onUpdate": "no action"
575
+ },
576
+ "document_versions_participant_id_participants_id_fk": {
577
+ "name": "document_versions_participant_id_participants_id_fk",
578
+ "tableFrom": "document_versions",
579
+ "tableTo": "participants",
580
+ "columnsFrom": [
581
+ "participant_id"
582
+ ],
583
+ "columnsTo": [
584
+ "id"
585
+ ],
586
+ "onDelete": "set null",
587
+ "onUpdate": "no action"
588
+ }
589
+ },
590
+ "compositePrimaryKeys": {},
591
+ "uniqueConstraints": {
592
+ "document_versions_document_id_revision_unique": {
593
+ "name": "document_versions_document_id_revision_unique",
594
+ "nullsNotDistinct": false,
595
+ "columns": [
596
+ "document_id",
597
+ "revision"
598
+ ]
599
+ }
600
+ },
601
+ "policies": {},
602
+ "checkConstraints": {},
603
+ "isRLSEnabled": false
604
+ },
605
+ "public.documents": {
606
+ "name": "documents",
607
+ "schema": "",
608
+ "columns": {
609
+ "id": {
610
+ "name": "id",
611
+ "type": "serial",
612
+ "primaryKey": true,
613
+ "notNull": true
614
+ },
615
+ "chat_id": {
616
+ "name": "chat_id",
617
+ "type": "integer",
618
+ "primaryKey": false,
619
+ "notNull": true
620
+ },
621
+ "slug": {
622
+ "name": "slug",
623
+ "type": "text",
624
+ "primaryKey": false,
625
+ "notNull": true
626
+ },
627
+ "title": {
628
+ "name": "title",
629
+ "type": "text",
630
+ "primaryKey": false,
631
+ "notNull": true
632
+ },
633
+ "kind": {
634
+ "name": "kind",
635
+ "type": "text",
636
+ "primaryKey": false,
637
+ "notNull": true
638
+ },
639
+ "status": {
640
+ "name": "status",
641
+ "type": "text",
642
+ "primaryKey": false,
643
+ "notNull": true,
644
+ "default": "'draft'"
645
+ },
646
+ "origin": {
647
+ "name": "origin",
648
+ "type": "text",
649
+ "primaryKey": false,
650
+ "notNull": false
651
+ },
652
+ "participant_id": {
653
+ "name": "participant_id",
654
+ "type": "integer",
655
+ "primaryKey": false,
656
+ "notNull": false
657
+ },
658
+ "created_at": {
659
+ "name": "created_at",
660
+ "type": "timestamp with time zone",
661
+ "primaryKey": false,
662
+ "notNull": true,
663
+ "default": "now()"
664
+ },
665
+ "updated_at": {
666
+ "name": "updated_at",
667
+ "type": "timestamp with time zone",
668
+ "primaryKey": false,
669
+ "notNull": true,
670
+ "default": "now()"
671
+ }
672
+ },
673
+ "indexes": {
674
+ "documents_status_kind_index": {
675
+ "name": "documents_status_kind_index",
676
+ "columns": [
677
+ {
678
+ "expression": "status",
679
+ "isExpression": false,
680
+ "asc": true,
681
+ "nulls": "last"
682
+ },
683
+ {
684
+ "expression": "kind",
685
+ "isExpression": false,
686
+ "asc": true,
687
+ "nulls": "last"
688
+ }
689
+ ],
690
+ "isUnique": false,
691
+ "concurrently": false,
692
+ "method": "btree",
693
+ "with": {}
694
+ }
695
+ },
696
+ "foreignKeys": {
697
+ "documents_chat_id_chats_id_fk": {
698
+ "name": "documents_chat_id_chats_id_fk",
699
+ "tableFrom": "documents",
700
+ "tableTo": "chats",
701
+ "columnsFrom": [
702
+ "chat_id"
703
+ ],
704
+ "columnsTo": [
705
+ "id"
706
+ ],
707
+ "onDelete": "cascade",
708
+ "onUpdate": "no action"
709
+ },
710
+ "documents_participant_id_participants_id_fk": {
711
+ "name": "documents_participant_id_participants_id_fk",
712
+ "tableFrom": "documents",
713
+ "tableTo": "participants",
714
+ "columnsFrom": [
715
+ "participant_id"
716
+ ],
717
+ "columnsTo": [
718
+ "id"
719
+ ],
720
+ "onDelete": "set null",
721
+ "onUpdate": "no action"
722
+ }
723
+ },
724
+ "compositePrimaryKeys": {},
725
+ "uniqueConstraints": {
726
+ "documents_chat_id_slug_unique": {
727
+ "name": "documents_chat_id_slug_unique",
728
+ "nullsNotDistinct": false,
729
+ "columns": [
730
+ "chat_id",
731
+ "slug"
732
+ ]
733
+ }
734
+ },
735
+ "policies": {},
736
+ "checkConstraints": {},
737
+ "isRLSEnabled": false
738
+ },
739
+ "public.knowledge_cards": {
740
+ "name": "knowledge_cards",
741
+ "schema": "",
742
+ "columns": {
743
+ "id": {
744
+ "name": "id",
745
+ "type": "serial",
746
+ "primaryKey": true,
747
+ "notNull": true
748
+ },
749
+ "chat_id": {
750
+ "name": "chat_id",
751
+ "type": "integer",
752
+ "primaryKey": false,
753
+ "notNull": true
754
+ },
755
+ "participant_id": {
756
+ "name": "participant_id",
757
+ "type": "integer",
758
+ "primaryKey": false,
759
+ "notNull": false
760
+ },
761
+ "key": {
762
+ "name": "key",
763
+ "type": "text",
764
+ "primaryKey": false,
765
+ "notNull": true
766
+ },
767
+ "format": {
768
+ "name": "format",
769
+ "type": "integer",
770
+ "primaryKey": false,
771
+ "notNull": true
772
+ },
773
+ "card": {
774
+ "name": "card",
775
+ "type": "jsonb",
776
+ "primaryKey": false,
777
+ "notNull": true
778
+ },
779
+ "search": {
780
+ "name": "search",
781
+ "type": "text",
782
+ "primaryKey": false,
783
+ "notNull": false
784
+ },
785
+ "revision": {
786
+ "name": "revision",
787
+ "type": "integer",
788
+ "primaryKey": false,
789
+ "notNull": true,
790
+ "default": 1
791
+ },
792
+ "shared_revision": {
793
+ "name": "shared_revision",
794
+ "type": "integer",
795
+ "primaryKey": false,
796
+ "notNull": true,
797
+ "default": 0
798
+ },
799
+ "created_at": {
800
+ "name": "created_at",
801
+ "type": "timestamp with time zone",
802
+ "primaryKey": false,
803
+ "notNull": true,
804
+ "default": "now()"
805
+ },
806
+ "updated_at": {
807
+ "name": "updated_at",
808
+ "type": "timestamp with time zone",
809
+ "primaryKey": false,
810
+ "notNull": true,
811
+ "default": "now()"
812
+ }
813
+ },
814
+ "indexes": {
815
+ "knowledge_cards_search_idx": {
816
+ "name": "knowledge_cards_search_idx",
817
+ "columns": [
818
+ {
819
+ "expression": "to_tsvector('russian', \"search\")",
820
+ "asc": true,
821
+ "isExpression": true,
822
+ "nulls": "last"
823
+ }
824
+ ],
825
+ "isUnique": false,
826
+ "concurrently": false,
827
+ "method": "gin",
828
+ "with": {}
829
+ },
830
+ "knowledge_cards_chat_id_index": {
831
+ "name": "knowledge_cards_chat_id_index",
832
+ "columns": [
833
+ {
834
+ "expression": "chat_id",
835
+ "isExpression": false,
836
+ "asc": true,
837
+ "nulls": "last"
838
+ }
839
+ ],
840
+ "isUnique": false,
841
+ "concurrently": false,
842
+ "method": "btree",
843
+ "with": {}
844
+ }
845
+ },
846
+ "foreignKeys": {
847
+ "knowledge_cards_chat_id_chats_id_fk": {
848
+ "name": "knowledge_cards_chat_id_chats_id_fk",
849
+ "tableFrom": "knowledge_cards",
850
+ "tableTo": "chats",
851
+ "columnsFrom": [
852
+ "chat_id"
853
+ ],
854
+ "columnsTo": [
855
+ "id"
856
+ ],
857
+ "onDelete": "cascade",
858
+ "onUpdate": "no action"
859
+ },
860
+ "knowledge_cards_participant_id_participants_id_fk": {
861
+ "name": "knowledge_cards_participant_id_participants_id_fk",
862
+ "tableFrom": "knowledge_cards",
863
+ "tableTo": "participants",
864
+ "columnsFrom": [
865
+ "participant_id"
866
+ ],
867
+ "columnsTo": [
868
+ "id"
869
+ ],
870
+ "onDelete": "set null",
871
+ "onUpdate": "no action"
872
+ }
873
+ },
874
+ "compositePrimaryKeys": {},
875
+ "uniqueConstraints": {
876
+ "knowledge_cards_key_unique": {
877
+ "name": "knowledge_cards_key_unique",
878
+ "nullsNotDistinct": false,
879
+ "columns": [
880
+ "key"
881
+ ]
882
+ }
883
+ },
884
+ "policies": {},
885
+ "checkConstraints": {},
886
+ "isRLSEnabled": false
887
+ },
888
+ "public.login_codes": {
889
+ "name": "login_codes",
890
+ "schema": "",
891
+ "columns": {
892
+ "code_hash": {
893
+ "name": "code_hash",
894
+ "type": "varchar(64)",
895
+ "primaryKey": true,
896
+ "notNull": true
897
+ },
898
+ "participant_id": {
899
+ "name": "participant_id",
900
+ "type": "integer",
901
+ "primaryKey": false,
902
+ "notNull": true
903
+ },
904
+ "expires_at": {
905
+ "name": "expires_at",
906
+ "type": "timestamp with time zone",
907
+ "primaryKey": false,
908
+ "notNull": true
909
+ },
910
+ "created_at": {
911
+ "name": "created_at",
912
+ "type": "timestamp with time zone",
913
+ "primaryKey": false,
914
+ "notNull": true,
915
+ "default": "now()"
916
+ }
917
+ },
918
+ "indexes": {},
919
+ "foreignKeys": {
920
+ "login_codes_participant_id_participants_id_fk": {
921
+ "name": "login_codes_participant_id_participants_id_fk",
922
+ "tableFrom": "login_codes",
923
+ "tableTo": "participants",
924
+ "columnsFrom": [
925
+ "participant_id"
926
+ ],
927
+ "columnsTo": [
928
+ "id"
929
+ ],
930
+ "onDelete": "cascade",
931
+ "onUpdate": "no action"
932
+ }
933
+ },
934
+ "compositePrimaryKeys": {},
935
+ "uniqueConstraints": {},
936
+ "policies": {},
937
+ "checkConstraints": {},
938
+ "isRLSEnabled": false
939
+ },
940
+ "public.mentions": {
941
+ "name": "mentions",
942
+ "schema": "",
943
+ "columns": {
944
+ "id": {
945
+ "name": "id",
946
+ "type": "serial",
947
+ "primaryKey": true,
948
+ "notNull": true
949
+ },
950
+ "message_id": {
951
+ "name": "message_id",
952
+ "type": "integer",
953
+ "primaryKey": false,
954
+ "notNull": true
955
+ },
956
+ "participant_id": {
957
+ "name": "participant_id",
958
+ "type": "integer",
959
+ "primaryKey": false,
960
+ "notNull": true
961
+ },
962
+ "handled_at": {
963
+ "name": "handled_at",
964
+ "type": "timestamp with time zone",
965
+ "primaryKey": false,
966
+ "notNull": false
967
+ },
968
+ "run_started_at": {
969
+ "name": "run_started_at",
970
+ "type": "timestamp with time zone",
971
+ "primaryKey": false,
972
+ "notNull": false
973
+ },
974
+ "beat_at": {
975
+ "name": "beat_at",
976
+ "type": "timestamp with time zone",
977
+ "primaryKey": false,
978
+ "notNull": false
979
+ },
980
+ "beat_ttl": {
981
+ "name": "beat_ttl",
982
+ "type": "integer",
983
+ "primaryKey": false,
984
+ "notNull": false
985
+ },
986
+ "outcome": {
987
+ "name": "outcome",
988
+ "type": "varchar(16)",
989
+ "primaryKey": false,
990
+ "notNull": false
991
+ },
992
+ "outcome_at": {
993
+ "name": "outcome_at",
994
+ "type": "timestamp with time zone",
995
+ "primaryKey": false,
996
+ "notNull": false
997
+ },
998
+ "note": {
999
+ "name": "note",
1000
+ "type": "text",
1001
+ "primaryKey": false,
1002
+ "notNull": false
1003
+ },
1004
+ "attempts": {
1005
+ "name": "attempts",
1006
+ "type": "integer",
1007
+ "primaryKey": false,
1008
+ "notNull": true,
1009
+ "default": 0
1010
+ },
1011
+ "created_at": {
1012
+ "name": "created_at",
1013
+ "type": "timestamp with time zone",
1014
+ "primaryKey": false,
1015
+ "notNull": true,
1016
+ "default": "now()"
1017
+ },
1018
+ "updated_at": {
1019
+ "name": "updated_at",
1020
+ "type": "timestamp with time zone",
1021
+ "primaryKey": false,
1022
+ "notNull": true,
1023
+ "default": "now()"
1024
+ }
1025
+ },
1026
+ "indexes": {
1027
+ "mentions_participant_id_handled_at_index": {
1028
+ "name": "mentions_participant_id_handled_at_index",
1029
+ "columns": [
1030
+ {
1031
+ "expression": "participant_id",
1032
+ "isExpression": false,
1033
+ "asc": true,
1034
+ "nulls": "last"
1035
+ },
1036
+ {
1037
+ "expression": "handled_at",
1038
+ "isExpression": false,
1039
+ "asc": true,
1040
+ "nulls": "last"
1041
+ }
1042
+ ],
1043
+ "isUnique": false,
1044
+ "concurrently": false,
1045
+ "method": "btree",
1046
+ "with": {}
1047
+ }
1048
+ },
1049
+ "foreignKeys": {
1050
+ "mentions_message_id_messages_id_fk": {
1051
+ "name": "mentions_message_id_messages_id_fk",
1052
+ "tableFrom": "mentions",
1053
+ "tableTo": "messages",
1054
+ "columnsFrom": [
1055
+ "message_id"
1056
+ ],
1057
+ "columnsTo": [
1058
+ "id"
1059
+ ],
1060
+ "onDelete": "cascade",
1061
+ "onUpdate": "no action"
1062
+ },
1063
+ "mentions_participant_id_participants_id_fk": {
1064
+ "name": "mentions_participant_id_participants_id_fk",
1065
+ "tableFrom": "mentions",
1066
+ "tableTo": "participants",
1067
+ "columnsFrom": [
1068
+ "participant_id"
1069
+ ],
1070
+ "columnsTo": [
1071
+ "id"
1072
+ ],
1073
+ "onDelete": "cascade",
1074
+ "onUpdate": "no action"
1075
+ }
1076
+ },
1077
+ "compositePrimaryKeys": {},
1078
+ "uniqueConstraints": {
1079
+ "mentions_message_id_participant_id_unique": {
1080
+ "name": "mentions_message_id_participant_id_unique",
1081
+ "nullsNotDistinct": false,
1082
+ "columns": [
1083
+ "message_id",
1084
+ "participant_id"
1085
+ ]
1086
+ }
1087
+ },
1088
+ "policies": {},
1089
+ "checkConstraints": {},
1090
+ "isRLSEnabled": false
1091
+ },
1092
+ "public.messages": {
1093
+ "name": "messages",
1094
+ "schema": "",
1095
+ "columns": {
1096
+ "id": {
1097
+ "name": "id",
1098
+ "type": "serial",
1099
+ "primaryKey": true,
1100
+ "notNull": true
1101
+ },
1102
+ "chat_id": {
1103
+ "name": "chat_id",
1104
+ "type": "integer",
1105
+ "primaryKey": false,
1106
+ "notNull": true
1107
+ },
1108
+ "participant_id": {
1109
+ "name": "participant_id",
1110
+ "type": "integer",
1111
+ "primaryKey": false,
1112
+ "notNull": true
1113
+ },
1114
+ "body": {
1115
+ "name": "body",
1116
+ "type": "text",
1117
+ "primaryKey": false,
1118
+ "notNull": true
1119
+ },
1120
+ "reply_to_id": {
1121
+ "name": "reply_to_id",
1122
+ "type": "integer",
1123
+ "primaryKey": false,
1124
+ "notNull": false
1125
+ },
1126
+ "asks_owner": {
1127
+ "name": "asks_owner",
1128
+ "type": "boolean",
1129
+ "primaryKey": false,
1130
+ "notNull": true,
1131
+ "default": false
1132
+ },
1133
+ "created_at": {
1134
+ "name": "created_at",
1135
+ "type": "timestamp with time zone",
1136
+ "primaryKey": false,
1137
+ "notNull": true,
1138
+ "default": "now()"
1139
+ },
1140
+ "updated_at": {
1141
+ "name": "updated_at",
1142
+ "type": "timestamp with time zone",
1143
+ "primaryKey": false,
1144
+ "notNull": true,
1145
+ "default": "now()"
1146
+ }
1147
+ },
1148
+ "indexes": {
1149
+ "messages_chat_id_id_index": {
1150
+ "name": "messages_chat_id_id_index",
1151
+ "columns": [
1152
+ {
1153
+ "expression": "chat_id",
1154
+ "isExpression": false,
1155
+ "asc": true,
1156
+ "nulls": "last"
1157
+ },
1158
+ {
1159
+ "expression": "id",
1160
+ "isExpression": false,
1161
+ "asc": true,
1162
+ "nulls": "last"
1163
+ }
1164
+ ],
1165
+ "isUnique": false,
1166
+ "concurrently": false,
1167
+ "method": "btree",
1168
+ "with": {}
1169
+ },
1170
+ "messages_created_at_index": {
1171
+ "name": "messages_created_at_index",
1172
+ "columns": [
1173
+ {
1174
+ "expression": "created_at",
1175
+ "isExpression": false,
1176
+ "asc": true,
1177
+ "nulls": "last"
1178
+ }
1179
+ ],
1180
+ "isUnique": false,
1181
+ "concurrently": false,
1182
+ "method": "btree",
1183
+ "with": {}
1184
+ }
1185
+ },
1186
+ "foreignKeys": {
1187
+ "messages_chat_id_chats_id_fk": {
1188
+ "name": "messages_chat_id_chats_id_fk",
1189
+ "tableFrom": "messages",
1190
+ "tableTo": "chats",
1191
+ "columnsFrom": [
1192
+ "chat_id"
1193
+ ],
1194
+ "columnsTo": [
1195
+ "id"
1196
+ ],
1197
+ "onDelete": "cascade",
1198
+ "onUpdate": "no action"
1199
+ },
1200
+ "messages_participant_id_participants_id_fk": {
1201
+ "name": "messages_participant_id_participants_id_fk",
1202
+ "tableFrom": "messages",
1203
+ "tableTo": "participants",
1204
+ "columnsFrom": [
1205
+ "participant_id"
1206
+ ],
1207
+ "columnsTo": [
1208
+ "id"
1209
+ ],
1210
+ "onDelete": "cascade",
1211
+ "onUpdate": "no action"
1212
+ },
1213
+ "messages_reply_to_id_messages_id_fk": {
1214
+ "name": "messages_reply_to_id_messages_id_fk",
1215
+ "tableFrom": "messages",
1216
+ "tableTo": "messages",
1217
+ "columnsFrom": [
1218
+ "reply_to_id"
1219
+ ],
1220
+ "columnsTo": [
1221
+ "id"
1222
+ ],
1223
+ "onDelete": "set null",
1224
+ "onUpdate": "no action"
1225
+ }
1226
+ },
1227
+ "compositePrimaryKeys": {},
1228
+ "uniqueConstraints": {},
1229
+ "policies": {},
1230
+ "checkConstraints": {},
1231
+ "isRLSEnabled": false
1232
+ },
1233
+ "public.participant_tokens": {
1234
+ "name": "participant_tokens",
1235
+ "schema": "",
1236
+ "columns": {
1237
+ "id": {
1238
+ "name": "id",
1239
+ "type": "serial",
1240
+ "primaryKey": true,
1241
+ "notNull": true
1242
+ },
1243
+ "participant_id": {
1244
+ "name": "participant_id",
1245
+ "type": "integer",
1246
+ "primaryKey": false,
1247
+ "notNull": true
1248
+ },
1249
+ "token_hash": {
1250
+ "name": "token_hash",
1251
+ "type": "varchar(64)",
1252
+ "primaryKey": false,
1253
+ "notNull": true
1254
+ },
1255
+ "label": {
1256
+ "name": "label",
1257
+ "type": "text",
1258
+ "primaryKey": false,
1259
+ "notNull": true
1260
+ },
1261
+ "created_at": {
1262
+ "name": "created_at",
1263
+ "type": "timestamp with time zone",
1264
+ "primaryKey": false,
1265
+ "notNull": true,
1266
+ "default": "now()"
1267
+ },
1268
+ "updated_at": {
1269
+ "name": "updated_at",
1270
+ "type": "timestamp with time zone",
1271
+ "primaryKey": false,
1272
+ "notNull": true,
1273
+ "default": "now()"
1274
+ }
1275
+ },
1276
+ "indexes": {},
1277
+ "foreignKeys": {
1278
+ "participant_tokens_participant_id_participants_id_fk": {
1279
+ "name": "participant_tokens_participant_id_participants_id_fk",
1280
+ "tableFrom": "participant_tokens",
1281
+ "tableTo": "participants",
1282
+ "columnsFrom": [
1283
+ "participant_id"
1284
+ ],
1285
+ "columnsTo": [
1286
+ "id"
1287
+ ],
1288
+ "onDelete": "cascade",
1289
+ "onUpdate": "no action"
1290
+ }
1291
+ },
1292
+ "compositePrimaryKeys": {},
1293
+ "uniqueConstraints": {
1294
+ "participant_tokens_token_hash_unique": {
1295
+ "name": "participant_tokens_token_hash_unique",
1296
+ "nullsNotDistinct": false,
1297
+ "columns": [
1298
+ "token_hash"
1299
+ ]
1300
+ }
1301
+ },
1302
+ "policies": {},
1303
+ "checkConstraints": {},
1304
+ "isRLSEnabled": false
1305
+ },
1306
+ "public.participants": {
1307
+ "name": "participants",
1308
+ "schema": "",
1309
+ "columns": {
1310
+ "id": {
1311
+ "name": "id",
1312
+ "type": "serial",
1313
+ "primaryKey": true,
1314
+ "notNull": true
1315
+ },
1316
+ "name": {
1317
+ "name": "name",
1318
+ "type": "text",
1319
+ "primaryKey": false,
1320
+ "notNull": true
1321
+ },
1322
+ "handle": {
1323
+ "name": "handle",
1324
+ "type": "text",
1325
+ "primaryKey": false,
1326
+ "notNull": true
1327
+ },
1328
+ "kind": {
1329
+ "name": "kind",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": true
1333
+ },
1334
+ "role": {
1335
+ "name": "role",
1336
+ "type": "text",
1337
+ "primaryKey": false,
1338
+ "notNull": true
1339
+ },
1340
+ "accent": {
1341
+ "name": "accent",
1342
+ "type": "varchar(16)",
1343
+ "primaryKey": false,
1344
+ "notNull": true,
1345
+ "default": "'#0057c2'"
1346
+ },
1347
+ "token_hash": {
1348
+ "name": "token_hash",
1349
+ "type": "varchar(64)",
1350
+ "primaryKey": false,
1351
+ "notNull": false
1352
+ },
1353
+ "last_seen_at": {
1354
+ "name": "last_seen_at",
1355
+ "type": "timestamp with time zone",
1356
+ "primaryKey": false,
1357
+ "notNull": false
1358
+ },
1359
+ "runtime": {
1360
+ "name": "runtime",
1361
+ "type": "varchar(40)",
1362
+ "primaryKey": false,
1363
+ "notNull": false
1364
+ },
1365
+ "disabled_at": {
1366
+ "name": "disabled_at",
1367
+ "type": "timestamp with time zone",
1368
+ "primaryKey": false,
1369
+ "notNull": false
1370
+ },
1371
+ "host_id": {
1372
+ "name": "host_id",
1373
+ "type": "integer",
1374
+ "primaryKey": false,
1375
+ "notNull": false
1376
+ },
1377
+ "runtimes": {
1378
+ "name": "runtimes",
1379
+ "type": "jsonb",
1380
+ "primaryKey": false,
1381
+ "notNull": false
1382
+ },
1383
+ "created_at": {
1384
+ "name": "created_at",
1385
+ "type": "timestamp with time zone",
1386
+ "primaryKey": false,
1387
+ "notNull": true,
1388
+ "default": "now()"
1389
+ },
1390
+ "updated_at": {
1391
+ "name": "updated_at",
1392
+ "type": "timestamp with time zone",
1393
+ "primaryKey": false,
1394
+ "notNull": true,
1395
+ "default": "now()"
1396
+ }
1397
+ },
1398
+ "indexes": {},
1399
+ "foreignKeys": {
1400
+ "participants_host_id_participants_id_fk": {
1401
+ "name": "participants_host_id_participants_id_fk",
1402
+ "tableFrom": "participants",
1403
+ "tableTo": "participants",
1404
+ "columnsFrom": [
1405
+ "host_id"
1406
+ ],
1407
+ "columnsTo": [
1408
+ "id"
1409
+ ],
1410
+ "onDelete": "set null",
1411
+ "onUpdate": "no action"
1412
+ }
1413
+ },
1414
+ "compositePrimaryKeys": {},
1415
+ "uniqueConstraints": {
1416
+ "participants_handle_unique": {
1417
+ "name": "participants_handle_unique",
1418
+ "nullsNotDistinct": false,
1419
+ "columns": [
1420
+ "handle"
1421
+ ]
1422
+ },
1423
+ "participants_token_hash_unique": {
1424
+ "name": "participants_token_hash_unique",
1425
+ "nullsNotDistinct": false,
1426
+ "columns": [
1427
+ "token_hash"
1428
+ ]
1429
+ }
1430
+ },
1431
+ "policies": {},
1432
+ "checkConstraints": {},
1433
+ "isRLSEnabled": false
1434
+ },
1435
+ "public.roles": {
1436
+ "name": "roles",
1437
+ "schema": "",
1438
+ "columns": {
1439
+ "id": {
1440
+ "name": "id",
1441
+ "type": "serial",
1442
+ "primaryKey": true,
1443
+ "notNull": true
1444
+ },
1445
+ "slug": {
1446
+ "name": "slug",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": true
1450
+ },
1451
+ "name": {
1452
+ "name": "name",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": true
1456
+ },
1457
+ "instructions": {
1458
+ "name": "instructions",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": true
1462
+ },
1463
+ "created_at": {
1464
+ "name": "created_at",
1465
+ "type": "timestamp with time zone",
1466
+ "primaryKey": false,
1467
+ "notNull": true,
1468
+ "default": "now()"
1469
+ },
1470
+ "updated_at": {
1471
+ "name": "updated_at",
1472
+ "type": "timestamp with time zone",
1473
+ "primaryKey": false,
1474
+ "notNull": true,
1475
+ "default": "now()"
1476
+ }
1477
+ },
1478
+ "indexes": {},
1479
+ "foreignKeys": {},
1480
+ "compositePrimaryKeys": {},
1481
+ "uniqueConstraints": {
1482
+ "roles_slug_unique": {
1483
+ "name": "roles_slug_unique",
1484
+ "nullsNotDistinct": false,
1485
+ "columns": [
1486
+ "slug"
1487
+ ]
1488
+ }
1489
+ },
1490
+ "policies": {},
1491
+ "checkConstraints": {},
1492
+ "isRLSEnabled": false
1493
+ },
1494
+ "public.settings": {
1495
+ "name": "settings",
1496
+ "schema": "",
1497
+ "columns": {
1498
+ "key": {
1499
+ "name": "key",
1500
+ "type": "text",
1501
+ "primaryKey": true,
1502
+ "notNull": true
1503
+ },
1504
+ "value": {
1505
+ "name": "value",
1506
+ "type": "jsonb",
1507
+ "primaryKey": false,
1508
+ "notNull": true
1509
+ },
1510
+ "created_at": {
1511
+ "name": "created_at",
1512
+ "type": "timestamp with time zone",
1513
+ "primaryKey": false,
1514
+ "notNull": true,
1515
+ "default": "now()"
1516
+ },
1517
+ "updated_at": {
1518
+ "name": "updated_at",
1519
+ "type": "timestamp with time zone",
1520
+ "primaryKey": false,
1521
+ "notNull": true,
1522
+ "default": "now()"
1523
+ }
1524
+ },
1525
+ "indexes": {},
1526
+ "foreignKeys": {},
1527
+ "compositePrimaryKeys": {},
1528
+ "uniqueConstraints": {},
1529
+ "policies": {},
1530
+ "checkConstraints": {},
1531
+ "isRLSEnabled": false
1532
+ }
1533
+ },
1534
+ "enums": {},
1535
+ "schemas": {},
1536
+ "sequences": {},
1537
+ "roles": {},
1538
+ "policies": {},
1539
+ "views": {},
1540
+ "_meta": {
1541
+ "columns": {},
1542
+ "schemas": {},
1543
+ "tables": {}
1544
+ }
1545
+ }