@chat-js/cli 0.2.1 → 0.4.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 (42) hide show
  1. package/dist/index.js +216 -171
  2. package/package.json +1 -1
  3. package/templates/chat-app/CHANGELOG.md +19 -0
  4. package/templates/chat-app/app/(chat)/actions.ts +9 -9
  5. package/templates/chat-app/app/(chat)/api/chat/prepare/route.ts +94 -0
  6. package/templates/chat-app/app/(chat)/api/chat/route.ts +97 -14
  7. package/templates/chat-app/chat.config.ts +144 -156
  8. package/templates/chat-app/components/chat-sync.tsx +6 -3
  9. package/templates/chat-app/components/feedback-actions.tsx +7 -3
  10. package/templates/chat-app/components/message-editor.tsx +8 -3
  11. package/templates/chat-app/components/message-siblings.tsx +14 -1
  12. package/templates/chat-app/components/model-selector.tsx +669 -407
  13. package/templates/chat-app/components/multimodal-input.tsx +252 -18
  14. package/templates/chat-app/components/parallel-response-cards.tsx +157 -0
  15. package/templates/chat-app/components/part/text-message-part.tsx +9 -5
  16. package/templates/chat-app/components/retry-button.tsx +25 -8
  17. package/templates/chat-app/components/user-message.tsx +136 -125
  18. package/templates/chat-app/hooks/chat-sync-hooks.ts +11 -0
  19. package/templates/chat-app/hooks/use-navigate-to-message.ts +39 -0
  20. package/templates/chat-app/lib/ai/gateway-model-defaults.ts +154 -100
  21. package/templates/chat-app/lib/ai/gateways/openrouter-gateway.ts +2 -2
  22. package/templates/chat-app/lib/ai/tools/generate-image.ts +9 -2
  23. package/templates/chat-app/lib/ai/tools/generate-video.ts +3 -0
  24. package/templates/chat-app/lib/ai/types.ts +74 -3
  25. package/templates/chat-app/lib/config-schema.ts +131 -132
  26. package/templates/chat-app/lib/config.ts +2 -2
  27. package/templates/chat-app/lib/db/migrations/0044_gray_red_shift.sql +5 -0
  28. package/templates/chat-app/lib/db/migrations/meta/0044_snapshot.json +1567 -0
  29. package/templates/chat-app/lib/db/migrations/meta/_journal.json +8 -1
  30. package/templates/chat-app/lib/db/queries.ts +84 -4
  31. package/templates/chat-app/lib/db/schema.ts +4 -1
  32. package/templates/chat-app/lib/message-conversion.ts +14 -2
  33. package/templates/chat-app/lib/stores/hooks-threads.ts +37 -1
  34. package/templates/chat-app/lib/stores/with-threads.test.ts +137 -0
  35. package/templates/chat-app/lib/stores/with-threads.ts +157 -4
  36. package/templates/chat-app/lib/thread-utils.ts +23 -2
  37. package/templates/chat-app/package.json +1 -1
  38. package/templates/chat-app/providers/chat-input-provider.tsx +40 -2
  39. package/templates/chat-app/scripts/db-branch-delete.sh +7 -1
  40. package/templates/chat-app/scripts/db-branch-use.sh +7 -1
  41. package/templates/chat-app/scripts/with-db.sh +7 -1
  42. package/templates/chat-app/vitest.config.ts +2 -0
@@ -0,0 +1,1567 @@
1
+ {
2
+ "id": "557ad212-e874-4463-a45b-17438f28fadb",
3
+ "prevId": "4eb32625-a73e-4940-a4c0-040cfce7d4a1",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "provider_id": {
24
+ "name": "provider_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "user_id": {
30
+ "name": "user_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "id_token": {
48
+ "name": "id_token",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "access_token_expires_at": {
54
+ "name": "access_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refresh_token_expires_at": {
60
+ "name": "refresh_token_expires_at",
61
+ "type": "timestamp",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "scope": {
66
+ "name": "scope",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true
89
+ }
90
+ },
91
+ "indexes": {},
92
+ "foreignKeys": {
93
+ "account_user_id_user_id_fk": {
94
+ "name": "account_user_id_user_id_fk",
95
+ "tableFrom": "account",
96
+ "tableTo": "user",
97
+ "columnsFrom": [
98
+ "user_id"
99
+ ],
100
+ "columnsTo": [
101
+ "id"
102
+ ],
103
+ "onDelete": "cascade",
104
+ "onUpdate": "no action"
105
+ }
106
+ },
107
+ "compositePrimaryKeys": {},
108
+ "uniqueConstraints": {},
109
+ "policies": {},
110
+ "checkConstraints": {},
111
+ "isRLSEnabled": false
112
+ },
113
+ "public.Chat": {
114
+ "name": "Chat",
115
+ "schema": "",
116
+ "columns": {
117
+ "id": {
118
+ "name": "id",
119
+ "type": "uuid",
120
+ "primaryKey": true,
121
+ "notNull": true,
122
+ "default": "gen_random_uuid()"
123
+ },
124
+ "createdAt": {
125
+ "name": "createdAt",
126
+ "type": "timestamp",
127
+ "primaryKey": false,
128
+ "notNull": true
129
+ },
130
+ "updatedAt": {
131
+ "name": "updatedAt",
132
+ "type": "timestamp",
133
+ "primaryKey": false,
134
+ "notNull": true,
135
+ "default": "now()"
136
+ },
137
+ "title": {
138
+ "name": "title",
139
+ "type": "text",
140
+ "primaryKey": false,
141
+ "notNull": true
142
+ },
143
+ "userId": {
144
+ "name": "userId",
145
+ "type": "text",
146
+ "primaryKey": false,
147
+ "notNull": true
148
+ },
149
+ "visibility": {
150
+ "name": "visibility",
151
+ "type": "varchar",
152
+ "primaryKey": false,
153
+ "notNull": true,
154
+ "default": "'private'"
155
+ },
156
+ "isPinned": {
157
+ "name": "isPinned",
158
+ "type": "boolean",
159
+ "primaryKey": false,
160
+ "notNull": true,
161
+ "default": false
162
+ },
163
+ "projectId": {
164
+ "name": "projectId",
165
+ "type": "uuid",
166
+ "primaryKey": false,
167
+ "notNull": false
168
+ }
169
+ },
170
+ "indexes": {},
171
+ "foreignKeys": {
172
+ "Chat_userId_user_id_fk": {
173
+ "name": "Chat_userId_user_id_fk",
174
+ "tableFrom": "Chat",
175
+ "tableTo": "user",
176
+ "columnsFrom": [
177
+ "userId"
178
+ ],
179
+ "columnsTo": [
180
+ "id"
181
+ ],
182
+ "onDelete": "no action",
183
+ "onUpdate": "no action"
184
+ },
185
+ "Chat_projectId_Project_id_fk": {
186
+ "name": "Chat_projectId_Project_id_fk",
187
+ "tableFrom": "Chat",
188
+ "tableTo": "Project",
189
+ "columnsFrom": [
190
+ "projectId"
191
+ ],
192
+ "columnsTo": [
193
+ "id"
194
+ ],
195
+ "onDelete": "set null",
196
+ "onUpdate": "no action"
197
+ }
198
+ },
199
+ "compositePrimaryKeys": {},
200
+ "uniqueConstraints": {},
201
+ "policies": {},
202
+ "checkConstraints": {},
203
+ "isRLSEnabled": false
204
+ },
205
+ "public.Document": {
206
+ "name": "Document",
207
+ "schema": "",
208
+ "columns": {
209
+ "id": {
210
+ "name": "id",
211
+ "type": "uuid",
212
+ "primaryKey": false,
213
+ "notNull": true,
214
+ "default": "gen_random_uuid()"
215
+ },
216
+ "createdAt": {
217
+ "name": "createdAt",
218
+ "type": "timestamp",
219
+ "primaryKey": false,
220
+ "notNull": true
221
+ },
222
+ "title": {
223
+ "name": "title",
224
+ "type": "text",
225
+ "primaryKey": false,
226
+ "notNull": true
227
+ },
228
+ "content": {
229
+ "name": "content",
230
+ "type": "text",
231
+ "primaryKey": false,
232
+ "notNull": false
233
+ },
234
+ "kind": {
235
+ "name": "kind",
236
+ "type": "varchar",
237
+ "primaryKey": false,
238
+ "notNull": true,
239
+ "default": "'text'"
240
+ },
241
+ "userId": {
242
+ "name": "userId",
243
+ "type": "text",
244
+ "primaryKey": false,
245
+ "notNull": true
246
+ },
247
+ "messageId": {
248
+ "name": "messageId",
249
+ "type": "uuid",
250
+ "primaryKey": false,
251
+ "notNull": true
252
+ }
253
+ },
254
+ "indexes": {
255
+ "Document_message_id_idx": {
256
+ "name": "Document_message_id_idx",
257
+ "columns": [
258
+ {
259
+ "expression": "messageId",
260
+ "isExpression": false,
261
+ "asc": true,
262
+ "nulls": "last"
263
+ }
264
+ ],
265
+ "isUnique": false,
266
+ "concurrently": false,
267
+ "method": "btree",
268
+ "with": {}
269
+ }
270
+ },
271
+ "foreignKeys": {
272
+ "Document_userId_user_id_fk": {
273
+ "name": "Document_userId_user_id_fk",
274
+ "tableFrom": "Document",
275
+ "tableTo": "user",
276
+ "columnsFrom": [
277
+ "userId"
278
+ ],
279
+ "columnsTo": [
280
+ "id"
281
+ ],
282
+ "onDelete": "no action",
283
+ "onUpdate": "no action"
284
+ },
285
+ "Document_messageId_Message_id_fk": {
286
+ "name": "Document_messageId_Message_id_fk",
287
+ "tableFrom": "Document",
288
+ "tableTo": "Message",
289
+ "columnsFrom": [
290
+ "messageId"
291
+ ],
292
+ "columnsTo": [
293
+ "id"
294
+ ],
295
+ "onDelete": "cascade",
296
+ "onUpdate": "no action"
297
+ }
298
+ },
299
+ "compositePrimaryKeys": {
300
+ "Document_id_createdAt_pk": {
301
+ "name": "Document_id_createdAt_pk",
302
+ "columns": [
303
+ "id",
304
+ "createdAt"
305
+ ]
306
+ }
307
+ },
308
+ "uniqueConstraints": {},
309
+ "policies": {},
310
+ "checkConstraints": {},
311
+ "isRLSEnabled": false
312
+ },
313
+ "public.McpConnector": {
314
+ "name": "McpConnector",
315
+ "schema": "",
316
+ "columns": {
317
+ "id": {
318
+ "name": "id",
319
+ "type": "uuid",
320
+ "primaryKey": true,
321
+ "notNull": true,
322
+ "default": "gen_random_uuid()"
323
+ },
324
+ "userId": {
325
+ "name": "userId",
326
+ "type": "text",
327
+ "primaryKey": false,
328
+ "notNull": false
329
+ },
330
+ "name": {
331
+ "name": "name",
332
+ "type": "varchar(256)",
333
+ "primaryKey": false,
334
+ "notNull": true
335
+ },
336
+ "nameId": {
337
+ "name": "nameId",
338
+ "type": "varchar(256)",
339
+ "primaryKey": false,
340
+ "notNull": true
341
+ },
342
+ "url": {
343
+ "name": "url",
344
+ "type": "text",
345
+ "primaryKey": false,
346
+ "notNull": true
347
+ },
348
+ "type": {
349
+ "name": "type",
350
+ "type": "varchar",
351
+ "primaryKey": false,
352
+ "notNull": true,
353
+ "default": "'http'"
354
+ },
355
+ "oauthClientId": {
356
+ "name": "oauthClientId",
357
+ "type": "text",
358
+ "primaryKey": false,
359
+ "notNull": false
360
+ },
361
+ "oauthClientSecret": {
362
+ "name": "oauthClientSecret",
363
+ "type": "text",
364
+ "primaryKey": false,
365
+ "notNull": false
366
+ },
367
+ "enabled": {
368
+ "name": "enabled",
369
+ "type": "boolean",
370
+ "primaryKey": false,
371
+ "notNull": true,
372
+ "default": true
373
+ },
374
+ "createdAt": {
375
+ "name": "createdAt",
376
+ "type": "timestamp",
377
+ "primaryKey": false,
378
+ "notNull": true,
379
+ "default": "now()"
380
+ },
381
+ "updatedAt": {
382
+ "name": "updatedAt",
383
+ "type": "timestamp",
384
+ "primaryKey": false,
385
+ "notNull": true,
386
+ "default": "now()"
387
+ }
388
+ },
389
+ "indexes": {
390
+ "McpConnector_user_id_idx": {
391
+ "name": "McpConnector_user_id_idx",
392
+ "columns": [
393
+ {
394
+ "expression": "userId",
395
+ "isExpression": false,
396
+ "asc": true,
397
+ "nulls": "last"
398
+ }
399
+ ],
400
+ "isUnique": false,
401
+ "concurrently": false,
402
+ "method": "btree",
403
+ "with": {}
404
+ },
405
+ "McpConnector_user_name_id_idx": {
406
+ "name": "McpConnector_user_name_id_idx",
407
+ "columns": [
408
+ {
409
+ "expression": "userId",
410
+ "isExpression": false,
411
+ "asc": true,
412
+ "nulls": "last"
413
+ },
414
+ {
415
+ "expression": "nameId",
416
+ "isExpression": false,
417
+ "asc": true,
418
+ "nulls": "last"
419
+ }
420
+ ],
421
+ "isUnique": false,
422
+ "concurrently": false,
423
+ "method": "btree",
424
+ "with": {}
425
+ },
426
+ "McpConnector_user_name_id_unique": {
427
+ "name": "McpConnector_user_name_id_unique",
428
+ "columns": [
429
+ {
430
+ "expression": "userId",
431
+ "isExpression": false,
432
+ "asc": true,
433
+ "nulls": "last"
434
+ },
435
+ {
436
+ "expression": "nameId",
437
+ "isExpression": false,
438
+ "asc": true,
439
+ "nulls": "last"
440
+ }
441
+ ],
442
+ "isUnique": true,
443
+ "concurrently": false,
444
+ "method": "btree",
445
+ "with": {}
446
+ }
447
+ },
448
+ "foreignKeys": {
449
+ "McpConnector_userId_user_id_fk": {
450
+ "name": "McpConnector_userId_user_id_fk",
451
+ "tableFrom": "McpConnector",
452
+ "tableTo": "user",
453
+ "columnsFrom": [
454
+ "userId"
455
+ ],
456
+ "columnsTo": [
457
+ "id"
458
+ ],
459
+ "onDelete": "cascade",
460
+ "onUpdate": "no action"
461
+ }
462
+ },
463
+ "compositePrimaryKeys": {},
464
+ "uniqueConstraints": {},
465
+ "policies": {},
466
+ "checkConstraints": {},
467
+ "isRLSEnabled": false
468
+ },
469
+ "public.McpOAuthSession": {
470
+ "name": "McpOAuthSession",
471
+ "schema": "",
472
+ "columns": {
473
+ "id": {
474
+ "name": "id",
475
+ "type": "uuid",
476
+ "primaryKey": true,
477
+ "notNull": true,
478
+ "default": "gen_random_uuid()"
479
+ },
480
+ "mcpConnectorId": {
481
+ "name": "mcpConnectorId",
482
+ "type": "uuid",
483
+ "primaryKey": false,
484
+ "notNull": true
485
+ },
486
+ "serverUrl": {
487
+ "name": "serverUrl",
488
+ "type": "text",
489
+ "primaryKey": false,
490
+ "notNull": true
491
+ },
492
+ "clientInfo": {
493
+ "name": "clientInfo",
494
+ "type": "text",
495
+ "primaryKey": false,
496
+ "notNull": false
497
+ },
498
+ "tokens": {
499
+ "name": "tokens",
500
+ "type": "text",
501
+ "primaryKey": false,
502
+ "notNull": false
503
+ },
504
+ "codeVerifier": {
505
+ "name": "codeVerifier",
506
+ "type": "text",
507
+ "primaryKey": false,
508
+ "notNull": false
509
+ },
510
+ "state": {
511
+ "name": "state",
512
+ "type": "text",
513
+ "primaryKey": false,
514
+ "notNull": false
515
+ },
516
+ "createdAt": {
517
+ "name": "createdAt",
518
+ "type": "timestamp",
519
+ "primaryKey": false,
520
+ "notNull": true,
521
+ "default": "now()"
522
+ },
523
+ "updatedAt": {
524
+ "name": "updatedAt",
525
+ "type": "timestamp",
526
+ "primaryKey": false,
527
+ "notNull": true,
528
+ "default": "now()"
529
+ }
530
+ },
531
+ "indexes": {
532
+ "McpOAuthSession_connector_idx": {
533
+ "name": "McpOAuthSession_connector_idx",
534
+ "columns": [
535
+ {
536
+ "expression": "mcpConnectorId",
537
+ "isExpression": false,
538
+ "asc": true,
539
+ "nulls": "last"
540
+ }
541
+ ],
542
+ "isUnique": false,
543
+ "concurrently": false,
544
+ "method": "btree",
545
+ "with": {}
546
+ },
547
+ "McpOAuthSession_state_idx": {
548
+ "name": "McpOAuthSession_state_idx",
549
+ "columns": [
550
+ {
551
+ "expression": "state",
552
+ "isExpression": false,
553
+ "asc": true,
554
+ "nulls": "last"
555
+ }
556
+ ],
557
+ "isUnique": false,
558
+ "concurrently": false,
559
+ "method": "btree",
560
+ "with": {}
561
+ }
562
+ },
563
+ "foreignKeys": {
564
+ "McpOAuthSession_mcpConnectorId_McpConnector_id_fk": {
565
+ "name": "McpOAuthSession_mcpConnectorId_McpConnector_id_fk",
566
+ "tableFrom": "McpOAuthSession",
567
+ "tableTo": "McpConnector",
568
+ "columnsFrom": [
569
+ "mcpConnectorId"
570
+ ],
571
+ "columnsTo": [
572
+ "id"
573
+ ],
574
+ "onDelete": "cascade",
575
+ "onUpdate": "no action"
576
+ }
577
+ },
578
+ "compositePrimaryKeys": {},
579
+ "uniqueConstraints": {
580
+ "McpOAuthSession_state_unique": {
581
+ "name": "McpOAuthSession_state_unique",
582
+ "nullsNotDistinct": false,
583
+ "columns": [
584
+ "state"
585
+ ]
586
+ }
587
+ },
588
+ "policies": {},
589
+ "checkConstraints": {},
590
+ "isRLSEnabled": false
591
+ },
592
+ "public.Message": {
593
+ "name": "Message",
594
+ "schema": "",
595
+ "columns": {
596
+ "id": {
597
+ "name": "id",
598
+ "type": "uuid",
599
+ "primaryKey": true,
600
+ "notNull": true,
601
+ "default": "gen_random_uuid()"
602
+ },
603
+ "chatId": {
604
+ "name": "chatId",
605
+ "type": "uuid",
606
+ "primaryKey": false,
607
+ "notNull": true
608
+ },
609
+ "parentMessageId": {
610
+ "name": "parentMessageId",
611
+ "type": "uuid",
612
+ "primaryKey": false,
613
+ "notNull": false
614
+ },
615
+ "role": {
616
+ "name": "role",
617
+ "type": "varchar",
618
+ "primaryKey": false,
619
+ "notNull": true
620
+ },
621
+ "attachments": {
622
+ "name": "attachments",
623
+ "type": "json",
624
+ "primaryKey": false,
625
+ "notNull": true
626
+ },
627
+ "createdAt": {
628
+ "name": "createdAt",
629
+ "type": "timestamp",
630
+ "primaryKey": false,
631
+ "notNull": true
632
+ },
633
+ "annotations": {
634
+ "name": "annotations",
635
+ "type": "json",
636
+ "primaryKey": false,
637
+ "notNull": false
638
+ },
639
+ "selectedModel": {
640
+ "name": "selectedModel",
641
+ "type": "json",
642
+ "primaryKey": false,
643
+ "notNull": false
644
+ },
645
+ "selectedTool": {
646
+ "name": "selectedTool",
647
+ "type": "varchar(256)",
648
+ "primaryKey": false,
649
+ "notNull": false,
650
+ "default": "''"
651
+ },
652
+ "parallelGroupId": {
653
+ "name": "parallelGroupId",
654
+ "type": "uuid",
655
+ "primaryKey": false,
656
+ "notNull": false
657
+ },
658
+ "parallelIndex": {
659
+ "name": "parallelIndex",
660
+ "type": "integer",
661
+ "primaryKey": false,
662
+ "notNull": false
663
+ },
664
+ "isPrimaryParallel": {
665
+ "name": "isPrimaryParallel",
666
+ "type": "boolean",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "lastContext": {
671
+ "name": "lastContext",
672
+ "type": "json",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "activeStreamId": {
677
+ "name": "activeStreamId",
678
+ "type": "varchar(64)",
679
+ "primaryKey": false,
680
+ "notNull": false
681
+ },
682
+ "canceledAt": {
683
+ "name": "canceledAt",
684
+ "type": "timestamp",
685
+ "primaryKey": false,
686
+ "notNull": false
687
+ }
688
+ },
689
+ "indexes": {},
690
+ "foreignKeys": {
691
+ "Message_chatId_Chat_id_fk": {
692
+ "name": "Message_chatId_Chat_id_fk",
693
+ "tableFrom": "Message",
694
+ "tableTo": "Chat",
695
+ "columnsFrom": [
696
+ "chatId"
697
+ ],
698
+ "columnsTo": [
699
+ "id"
700
+ ],
701
+ "onDelete": "cascade",
702
+ "onUpdate": "no action"
703
+ }
704
+ },
705
+ "compositePrimaryKeys": {},
706
+ "uniqueConstraints": {},
707
+ "policies": {},
708
+ "checkConstraints": {},
709
+ "isRLSEnabled": false
710
+ },
711
+ "public.Part": {
712
+ "name": "Part",
713
+ "schema": "",
714
+ "columns": {
715
+ "id": {
716
+ "name": "id",
717
+ "type": "uuid",
718
+ "primaryKey": true,
719
+ "notNull": true,
720
+ "default": "gen_random_uuid()"
721
+ },
722
+ "messageId": {
723
+ "name": "messageId",
724
+ "type": "uuid",
725
+ "primaryKey": false,
726
+ "notNull": true
727
+ },
728
+ "createdAt": {
729
+ "name": "createdAt",
730
+ "type": "timestamp",
731
+ "primaryKey": false,
732
+ "notNull": true,
733
+ "default": "now()"
734
+ },
735
+ "order": {
736
+ "name": "order",
737
+ "type": "integer",
738
+ "primaryKey": false,
739
+ "notNull": true,
740
+ "default": 0
741
+ },
742
+ "type": {
743
+ "name": "type",
744
+ "type": "varchar",
745
+ "primaryKey": false,
746
+ "notNull": true
747
+ },
748
+ "text_text": {
749
+ "name": "text_text",
750
+ "type": "text",
751
+ "primaryKey": false,
752
+ "notNull": false
753
+ },
754
+ "reasoning_text": {
755
+ "name": "reasoning_text",
756
+ "type": "text",
757
+ "primaryKey": false,
758
+ "notNull": false
759
+ },
760
+ "file_mediaType": {
761
+ "name": "file_mediaType",
762
+ "type": "varchar",
763
+ "primaryKey": false,
764
+ "notNull": false
765
+ },
766
+ "file_filename": {
767
+ "name": "file_filename",
768
+ "type": "varchar",
769
+ "primaryKey": false,
770
+ "notNull": false
771
+ },
772
+ "file_url": {
773
+ "name": "file_url",
774
+ "type": "varchar",
775
+ "primaryKey": false,
776
+ "notNull": false
777
+ },
778
+ "source_url_sourceId": {
779
+ "name": "source_url_sourceId",
780
+ "type": "varchar",
781
+ "primaryKey": false,
782
+ "notNull": false
783
+ },
784
+ "source_url_url": {
785
+ "name": "source_url_url",
786
+ "type": "varchar",
787
+ "primaryKey": false,
788
+ "notNull": false
789
+ },
790
+ "source_url_title": {
791
+ "name": "source_url_title",
792
+ "type": "varchar",
793
+ "primaryKey": false,
794
+ "notNull": false
795
+ },
796
+ "source_document_sourceId": {
797
+ "name": "source_document_sourceId",
798
+ "type": "varchar",
799
+ "primaryKey": false,
800
+ "notNull": false
801
+ },
802
+ "source_document_mediaType": {
803
+ "name": "source_document_mediaType",
804
+ "type": "varchar",
805
+ "primaryKey": false,
806
+ "notNull": false
807
+ },
808
+ "source_document_title": {
809
+ "name": "source_document_title",
810
+ "type": "varchar",
811
+ "primaryKey": false,
812
+ "notNull": false
813
+ },
814
+ "source_document_filename": {
815
+ "name": "source_document_filename",
816
+ "type": "varchar",
817
+ "primaryKey": false,
818
+ "notNull": false
819
+ },
820
+ "tool_name": {
821
+ "name": "tool_name",
822
+ "type": "varchar",
823
+ "primaryKey": false,
824
+ "notNull": false
825
+ },
826
+ "tool_toolCallId": {
827
+ "name": "tool_toolCallId",
828
+ "type": "varchar",
829
+ "primaryKey": false,
830
+ "notNull": false
831
+ },
832
+ "tool_state": {
833
+ "name": "tool_state",
834
+ "type": "varchar",
835
+ "primaryKey": false,
836
+ "notNull": false
837
+ },
838
+ "tool_input": {
839
+ "name": "tool_input",
840
+ "type": "json",
841
+ "primaryKey": false,
842
+ "notNull": false
843
+ },
844
+ "tool_output": {
845
+ "name": "tool_output",
846
+ "type": "json",
847
+ "primaryKey": false,
848
+ "notNull": false
849
+ },
850
+ "tool_errorText": {
851
+ "name": "tool_errorText",
852
+ "type": "varchar",
853
+ "primaryKey": false,
854
+ "notNull": false
855
+ },
856
+ "data_type": {
857
+ "name": "data_type",
858
+ "type": "varchar",
859
+ "primaryKey": false,
860
+ "notNull": false
861
+ },
862
+ "data_blob": {
863
+ "name": "data_blob",
864
+ "type": "json",
865
+ "primaryKey": false,
866
+ "notNull": false
867
+ },
868
+ "providerMetadata": {
869
+ "name": "providerMetadata",
870
+ "type": "json",
871
+ "primaryKey": false,
872
+ "notNull": false
873
+ }
874
+ },
875
+ "indexes": {
876
+ "Part_message_id_idx": {
877
+ "name": "Part_message_id_idx",
878
+ "columns": [
879
+ {
880
+ "expression": "messageId",
881
+ "isExpression": false,
882
+ "asc": true,
883
+ "nulls": "last"
884
+ }
885
+ ],
886
+ "isUnique": false,
887
+ "concurrently": false,
888
+ "method": "btree",
889
+ "with": {}
890
+ },
891
+ "Part_message_id_order_idx": {
892
+ "name": "Part_message_id_order_idx",
893
+ "columns": [
894
+ {
895
+ "expression": "messageId",
896
+ "isExpression": false,
897
+ "asc": true,
898
+ "nulls": "last"
899
+ },
900
+ {
901
+ "expression": "order",
902
+ "isExpression": false,
903
+ "asc": true,
904
+ "nulls": "last"
905
+ }
906
+ ],
907
+ "isUnique": false,
908
+ "concurrently": false,
909
+ "method": "btree",
910
+ "with": {}
911
+ }
912
+ },
913
+ "foreignKeys": {
914
+ "Part_messageId_Message_id_fk": {
915
+ "name": "Part_messageId_Message_id_fk",
916
+ "tableFrom": "Part",
917
+ "tableTo": "Message",
918
+ "columnsFrom": [
919
+ "messageId"
920
+ ],
921
+ "columnsTo": [
922
+ "id"
923
+ ],
924
+ "onDelete": "cascade",
925
+ "onUpdate": "no action"
926
+ }
927
+ },
928
+ "compositePrimaryKeys": {},
929
+ "uniqueConstraints": {},
930
+ "policies": {},
931
+ "checkConstraints": {
932
+ "Part_text_required_if_type_text": {
933
+ "name": "Part_text_required_if_type_text",
934
+ "value": "CASE WHEN \"Part\".\"type\" = 'text' THEN \"Part\".\"text_text\" IS NOT NULL ELSE TRUE END"
935
+ },
936
+ "Part_reasoning_required_if_type_reasoning": {
937
+ "name": "Part_reasoning_required_if_type_reasoning",
938
+ "value": "CASE WHEN \"Part\".\"type\" = 'reasoning' THEN \"Part\".\"reasoning_text\" IS NOT NULL ELSE TRUE END"
939
+ },
940
+ "Part_file_required_if_type_file": {
941
+ "name": "Part_file_required_if_type_file",
942
+ "value": "CASE WHEN \"Part\".\"type\" = 'file' THEN \"Part\".\"file_mediaType\" IS NOT NULL AND \"Part\".\"file_url\" IS NOT NULL ELSE TRUE END"
943
+ },
944
+ "Part_source_url_required_if_type_source_url": {
945
+ "name": "Part_source_url_required_if_type_source_url",
946
+ "value": "CASE WHEN \"Part\".\"type\" = 'source-url' THEN \"Part\".\"source_url_sourceId\" IS NOT NULL AND \"Part\".\"source_url_url\" IS NOT NULL ELSE TRUE END"
947
+ },
948
+ "Part_source_document_required_if_type_source_document": {
949
+ "name": "Part_source_document_required_if_type_source_document",
950
+ "value": "CASE WHEN \"Part\".\"type\" = 'source-document' THEN \"Part\".\"source_document_sourceId\" IS NOT NULL AND \"Part\".\"source_document_mediaType\" IS NOT NULL AND \"Part\".\"source_document_title\" IS NOT NULL ELSE TRUE END"
951
+ },
952
+ "Part_tool_required_if_type_tool": {
953
+ "name": "Part_tool_required_if_type_tool",
954
+ "value": "CASE WHEN \"Part\".\"type\" LIKE 'tool-%' THEN \"Part\".\"tool_toolCallId\" IS NOT NULL AND \"Part\".\"tool_state\" IS NOT NULL ELSE TRUE END"
955
+ },
956
+ "Part_data_required_if_type_data": {
957
+ "name": "Part_data_required_if_type_data",
958
+ "value": "CASE WHEN \"Part\".\"type\" LIKE 'data-%' THEN \"Part\".\"data_type\" IS NOT NULL ELSE TRUE END"
959
+ }
960
+ },
961
+ "isRLSEnabled": false
962
+ },
963
+ "public.Project": {
964
+ "name": "Project",
965
+ "schema": "",
966
+ "columns": {
967
+ "id": {
968
+ "name": "id",
969
+ "type": "uuid",
970
+ "primaryKey": true,
971
+ "notNull": true,
972
+ "default": "gen_random_uuid()"
973
+ },
974
+ "createdAt": {
975
+ "name": "createdAt",
976
+ "type": "timestamp",
977
+ "primaryKey": false,
978
+ "notNull": true,
979
+ "default": "now()"
980
+ },
981
+ "updatedAt": {
982
+ "name": "updatedAt",
983
+ "type": "timestamp",
984
+ "primaryKey": false,
985
+ "notNull": true,
986
+ "default": "now()"
987
+ },
988
+ "userId": {
989
+ "name": "userId",
990
+ "type": "text",
991
+ "primaryKey": false,
992
+ "notNull": true
993
+ },
994
+ "name": {
995
+ "name": "name",
996
+ "type": "text",
997
+ "primaryKey": false,
998
+ "notNull": true
999
+ },
1000
+ "instructions": {
1001
+ "name": "instructions",
1002
+ "type": "text",
1003
+ "primaryKey": false,
1004
+ "notNull": true,
1005
+ "default": "''"
1006
+ },
1007
+ "icon": {
1008
+ "name": "icon",
1009
+ "type": "varchar(64)",
1010
+ "primaryKey": false,
1011
+ "notNull": true,
1012
+ "default": "'folder'"
1013
+ },
1014
+ "iconColor": {
1015
+ "name": "iconColor",
1016
+ "type": "varchar(32)",
1017
+ "primaryKey": false,
1018
+ "notNull": true,
1019
+ "default": "'gray'"
1020
+ }
1021
+ },
1022
+ "indexes": {
1023
+ "Project_user_id_idx": {
1024
+ "name": "Project_user_id_idx",
1025
+ "columns": [
1026
+ {
1027
+ "expression": "userId",
1028
+ "isExpression": false,
1029
+ "asc": true,
1030
+ "nulls": "last"
1031
+ }
1032
+ ],
1033
+ "isUnique": false,
1034
+ "concurrently": false,
1035
+ "method": "btree",
1036
+ "with": {}
1037
+ }
1038
+ },
1039
+ "foreignKeys": {
1040
+ "Project_userId_user_id_fk": {
1041
+ "name": "Project_userId_user_id_fk",
1042
+ "tableFrom": "Project",
1043
+ "tableTo": "user",
1044
+ "columnsFrom": [
1045
+ "userId"
1046
+ ],
1047
+ "columnsTo": [
1048
+ "id"
1049
+ ],
1050
+ "onDelete": "cascade",
1051
+ "onUpdate": "no action"
1052
+ }
1053
+ },
1054
+ "compositePrimaryKeys": {},
1055
+ "uniqueConstraints": {},
1056
+ "policies": {},
1057
+ "checkConstraints": {},
1058
+ "isRLSEnabled": false
1059
+ },
1060
+ "public.session": {
1061
+ "name": "session",
1062
+ "schema": "",
1063
+ "columns": {
1064
+ "id": {
1065
+ "name": "id",
1066
+ "type": "text",
1067
+ "primaryKey": true,
1068
+ "notNull": true
1069
+ },
1070
+ "expires_at": {
1071
+ "name": "expires_at",
1072
+ "type": "timestamp",
1073
+ "primaryKey": false,
1074
+ "notNull": true
1075
+ },
1076
+ "token": {
1077
+ "name": "token",
1078
+ "type": "text",
1079
+ "primaryKey": false,
1080
+ "notNull": true
1081
+ },
1082
+ "created_at": {
1083
+ "name": "created_at",
1084
+ "type": "timestamp",
1085
+ "primaryKey": false,
1086
+ "notNull": true,
1087
+ "default": "now()"
1088
+ },
1089
+ "updated_at": {
1090
+ "name": "updated_at",
1091
+ "type": "timestamp",
1092
+ "primaryKey": false,
1093
+ "notNull": true
1094
+ },
1095
+ "ip_address": {
1096
+ "name": "ip_address",
1097
+ "type": "text",
1098
+ "primaryKey": false,
1099
+ "notNull": false
1100
+ },
1101
+ "user_agent": {
1102
+ "name": "user_agent",
1103
+ "type": "text",
1104
+ "primaryKey": false,
1105
+ "notNull": false
1106
+ },
1107
+ "user_id": {
1108
+ "name": "user_id",
1109
+ "type": "text",
1110
+ "primaryKey": false,
1111
+ "notNull": true
1112
+ }
1113
+ },
1114
+ "indexes": {},
1115
+ "foreignKeys": {
1116
+ "session_user_id_user_id_fk": {
1117
+ "name": "session_user_id_user_id_fk",
1118
+ "tableFrom": "session",
1119
+ "tableTo": "user",
1120
+ "columnsFrom": [
1121
+ "user_id"
1122
+ ],
1123
+ "columnsTo": [
1124
+ "id"
1125
+ ],
1126
+ "onDelete": "cascade",
1127
+ "onUpdate": "no action"
1128
+ }
1129
+ },
1130
+ "compositePrimaryKeys": {},
1131
+ "uniqueConstraints": {
1132
+ "session_token_unique": {
1133
+ "name": "session_token_unique",
1134
+ "nullsNotDistinct": false,
1135
+ "columns": [
1136
+ "token"
1137
+ ]
1138
+ }
1139
+ },
1140
+ "policies": {},
1141
+ "checkConstraints": {},
1142
+ "isRLSEnabled": false
1143
+ },
1144
+ "public.Suggestion": {
1145
+ "name": "Suggestion",
1146
+ "schema": "",
1147
+ "columns": {
1148
+ "id": {
1149
+ "name": "id",
1150
+ "type": "uuid",
1151
+ "primaryKey": false,
1152
+ "notNull": true,
1153
+ "default": "gen_random_uuid()"
1154
+ },
1155
+ "documentId": {
1156
+ "name": "documentId",
1157
+ "type": "uuid",
1158
+ "primaryKey": false,
1159
+ "notNull": true
1160
+ },
1161
+ "documentCreatedAt": {
1162
+ "name": "documentCreatedAt",
1163
+ "type": "timestamp",
1164
+ "primaryKey": false,
1165
+ "notNull": true
1166
+ },
1167
+ "originalText": {
1168
+ "name": "originalText",
1169
+ "type": "text",
1170
+ "primaryKey": false,
1171
+ "notNull": true
1172
+ },
1173
+ "suggestedText": {
1174
+ "name": "suggestedText",
1175
+ "type": "text",
1176
+ "primaryKey": false,
1177
+ "notNull": true
1178
+ },
1179
+ "description": {
1180
+ "name": "description",
1181
+ "type": "text",
1182
+ "primaryKey": false,
1183
+ "notNull": false
1184
+ },
1185
+ "isResolved": {
1186
+ "name": "isResolved",
1187
+ "type": "boolean",
1188
+ "primaryKey": false,
1189
+ "notNull": true,
1190
+ "default": false
1191
+ },
1192
+ "userId": {
1193
+ "name": "userId",
1194
+ "type": "text",
1195
+ "primaryKey": false,
1196
+ "notNull": true
1197
+ },
1198
+ "createdAt": {
1199
+ "name": "createdAt",
1200
+ "type": "timestamp",
1201
+ "primaryKey": false,
1202
+ "notNull": true
1203
+ }
1204
+ },
1205
+ "indexes": {},
1206
+ "foreignKeys": {
1207
+ "Suggestion_userId_user_id_fk": {
1208
+ "name": "Suggestion_userId_user_id_fk",
1209
+ "tableFrom": "Suggestion",
1210
+ "tableTo": "user",
1211
+ "columnsFrom": [
1212
+ "userId"
1213
+ ],
1214
+ "columnsTo": [
1215
+ "id"
1216
+ ],
1217
+ "onDelete": "no action",
1218
+ "onUpdate": "no action"
1219
+ },
1220
+ "Suggestion_documentId_documentCreatedAt_Document_id_createdAt_fk": {
1221
+ "name": "Suggestion_documentId_documentCreatedAt_Document_id_createdAt_fk",
1222
+ "tableFrom": "Suggestion",
1223
+ "tableTo": "Document",
1224
+ "columnsFrom": [
1225
+ "documentId",
1226
+ "documentCreatedAt"
1227
+ ],
1228
+ "columnsTo": [
1229
+ "id",
1230
+ "createdAt"
1231
+ ],
1232
+ "onDelete": "no action",
1233
+ "onUpdate": "no action"
1234
+ }
1235
+ },
1236
+ "compositePrimaryKeys": {
1237
+ "Suggestion_id_pk": {
1238
+ "name": "Suggestion_id_pk",
1239
+ "columns": [
1240
+ "id"
1241
+ ]
1242
+ }
1243
+ },
1244
+ "uniqueConstraints": {},
1245
+ "policies": {},
1246
+ "checkConstraints": {},
1247
+ "isRLSEnabled": false
1248
+ },
1249
+ "public.user": {
1250
+ "name": "user",
1251
+ "schema": "",
1252
+ "columns": {
1253
+ "id": {
1254
+ "name": "id",
1255
+ "type": "text",
1256
+ "primaryKey": true,
1257
+ "notNull": true
1258
+ },
1259
+ "name": {
1260
+ "name": "name",
1261
+ "type": "text",
1262
+ "primaryKey": false,
1263
+ "notNull": true
1264
+ },
1265
+ "email": {
1266
+ "name": "email",
1267
+ "type": "text",
1268
+ "primaryKey": false,
1269
+ "notNull": true
1270
+ },
1271
+ "email_verified": {
1272
+ "name": "email_verified",
1273
+ "type": "boolean",
1274
+ "primaryKey": false,
1275
+ "notNull": true,
1276
+ "default": false
1277
+ },
1278
+ "image": {
1279
+ "name": "image",
1280
+ "type": "text",
1281
+ "primaryKey": false,
1282
+ "notNull": false
1283
+ },
1284
+ "created_at": {
1285
+ "name": "created_at",
1286
+ "type": "timestamp",
1287
+ "primaryKey": false,
1288
+ "notNull": true,
1289
+ "default": "now()"
1290
+ },
1291
+ "updated_at": {
1292
+ "name": "updated_at",
1293
+ "type": "timestamp",
1294
+ "primaryKey": false,
1295
+ "notNull": true,
1296
+ "default": "now()"
1297
+ }
1298
+ },
1299
+ "indexes": {},
1300
+ "foreignKeys": {},
1301
+ "compositePrimaryKeys": {},
1302
+ "uniqueConstraints": {
1303
+ "user_email_unique": {
1304
+ "name": "user_email_unique",
1305
+ "nullsNotDistinct": false,
1306
+ "columns": [
1307
+ "email"
1308
+ ]
1309
+ }
1310
+ },
1311
+ "policies": {},
1312
+ "checkConstraints": {},
1313
+ "isRLSEnabled": false
1314
+ },
1315
+ "public.UserCredit": {
1316
+ "name": "UserCredit",
1317
+ "schema": "",
1318
+ "columns": {
1319
+ "userId": {
1320
+ "name": "userId",
1321
+ "type": "text",
1322
+ "primaryKey": true,
1323
+ "notNull": true
1324
+ },
1325
+ "credits": {
1326
+ "name": "credits",
1327
+ "type": "integer",
1328
+ "primaryKey": false,
1329
+ "notNull": true,
1330
+ "default": 50
1331
+ }
1332
+ },
1333
+ "indexes": {},
1334
+ "foreignKeys": {
1335
+ "UserCredit_userId_user_id_fk": {
1336
+ "name": "UserCredit_userId_user_id_fk",
1337
+ "tableFrom": "UserCredit",
1338
+ "tableTo": "user",
1339
+ "columnsFrom": [
1340
+ "userId"
1341
+ ],
1342
+ "columnsTo": [
1343
+ "id"
1344
+ ],
1345
+ "onDelete": "cascade",
1346
+ "onUpdate": "no action"
1347
+ }
1348
+ },
1349
+ "compositePrimaryKeys": {},
1350
+ "uniqueConstraints": {},
1351
+ "policies": {},
1352
+ "checkConstraints": {},
1353
+ "isRLSEnabled": false
1354
+ },
1355
+ "public.UserModelPreference": {
1356
+ "name": "UserModelPreference",
1357
+ "schema": "",
1358
+ "columns": {
1359
+ "userId": {
1360
+ "name": "userId",
1361
+ "type": "text",
1362
+ "primaryKey": false,
1363
+ "notNull": true
1364
+ },
1365
+ "modelId": {
1366
+ "name": "modelId",
1367
+ "type": "varchar(256)",
1368
+ "primaryKey": false,
1369
+ "notNull": true
1370
+ },
1371
+ "enabled": {
1372
+ "name": "enabled",
1373
+ "type": "boolean",
1374
+ "primaryKey": false,
1375
+ "notNull": true
1376
+ },
1377
+ "createdAt": {
1378
+ "name": "createdAt",
1379
+ "type": "timestamp",
1380
+ "primaryKey": false,
1381
+ "notNull": true,
1382
+ "default": "now()"
1383
+ },
1384
+ "updatedAt": {
1385
+ "name": "updatedAt",
1386
+ "type": "timestamp",
1387
+ "primaryKey": false,
1388
+ "notNull": true,
1389
+ "default": "now()"
1390
+ }
1391
+ },
1392
+ "indexes": {
1393
+ "UserModelPreference_user_id_idx": {
1394
+ "name": "UserModelPreference_user_id_idx",
1395
+ "columns": [
1396
+ {
1397
+ "expression": "userId",
1398
+ "isExpression": false,
1399
+ "asc": true,
1400
+ "nulls": "last"
1401
+ }
1402
+ ],
1403
+ "isUnique": false,
1404
+ "concurrently": false,
1405
+ "method": "btree",
1406
+ "with": {}
1407
+ }
1408
+ },
1409
+ "foreignKeys": {
1410
+ "UserModelPreference_userId_user_id_fk": {
1411
+ "name": "UserModelPreference_userId_user_id_fk",
1412
+ "tableFrom": "UserModelPreference",
1413
+ "tableTo": "user",
1414
+ "columnsFrom": [
1415
+ "userId"
1416
+ ],
1417
+ "columnsTo": [
1418
+ "id"
1419
+ ],
1420
+ "onDelete": "cascade",
1421
+ "onUpdate": "no action"
1422
+ }
1423
+ },
1424
+ "compositePrimaryKeys": {
1425
+ "UserModelPreference_userId_modelId_pk": {
1426
+ "name": "UserModelPreference_userId_modelId_pk",
1427
+ "columns": [
1428
+ "userId",
1429
+ "modelId"
1430
+ ]
1431
+ }
1432
+ },
1433
+ "uniqueConstraints": {},
1434
+ "policies": {},
1435
+ "checkConstraints": {},
1436
+ "isRLSEnabled": false
1437
+ },
1438
+ "public.verification": {
1439
+ "name": "verification",
1440
+ "schema": "",
1441
+ "columns": {
1442
+ "id": {
1443
+ "name": "id",
1444
+ "type": "text",
1445
+ "primaryKey": true,
1446
+ "notNull": true
1447
+ },
1448
+ "identifier": {
1449
+ "name": "identifier",
1450
+ "type": "text",
1451
+ "primaryKey": false,
1452
+ "notNull": true
1453
+ },
1454
+ "value": {
1455
+ "name": "value",
1456
+ "type": "text",
1457
+ "primaryKey": false,
1458
+ "notNull": true
1459
+ },
1460
+ "expires_at": {
1461
+ "name": "expires_at",
1462
+ "type": "timestamp",
1463
+ "primaryKey": false,
1464
+ "notNull": true
1465
+ },
1466
+ "created_at": {
1467
+ "name": "created_at",
1468
+ "type": "timestamp",
1469
+ "primaryKey": false,
1470
+ "notNull": true,
1471
+ "default": "now()"
1472
+ },
1473
+ "updated_at": {
1474
+ "name": "updated_at",
1475
+ "type": "timestamp",
1476
+ "primaryKey": false,
1477
+ "notNull": true,
1478
+ "default": "now()"
1479
+ }
1480
+ },
1481
+ "indexes": {},
1482
+ "foreignKeys": {},
1483
+ "compositePrimaryKeys": {},
1484
+ "uniqueConstraints": {},
1485
+ "policies": {},
1486
+ "checkConstraints": {},
1487
+ "isRLSEnabled": false
1488
+ },
1489
+ "public.Vote": {
1490
+ "name": "Vote",
1491
+ "schema": "",
1492
+ "columns": {
1493
+ "chatId": {
1494
+ "name": "chatId",
1495
+ "type": "uuid",
1496
+ "primaryKey": false,
1497
+ "notNull": true
1498
+ },
1499
+ "messageId": {
1500
+ "name": "messageId",
1501
+ "type": "uuid",
1502
+ "primaryKey": false,
1503
+ "notNull": true
1504
+ },
1505
+ "isUpvoted": {
1506
+ "name": "isUpvoted",
1507
+ "type": "boolean",
1508
+ "primaryKey": false,
1509
+ "notNull": true
1510
+ }
1511
+ },
1512
+ "indexes": {},
1513
+ "foreignKeys": {
1514
+ "Vote_chatId_Chat_id_fk": {
1515
+ "name": "Vote_chatId_Chat_id_fk",
1516
+ "tableFrom": "Vote",
1517
+ "tableTo": "Chat",
1518
+ "columnsFrom": [
1519
+ "chatId"
1520
+ ],
1521
+ "columnsTo": [
1522
+ "id"
1523
+ ],
1524
+ "onDelete": "cascade",
1525
+ "onUpdate": "no action"
1526
+ },
1527
+ "Vote_messageId_Message_id_fk": {
1528
+ "name": "Vote_messageId_Message_id_fk",
1529
+ "tableFrom": "Vote",
1530
+ "tableTo": "Message",
1531
+ "columnsFrom": [
1532
+ "messageId"
1533
+ ],
1534
+ "columnsTo": [
1535
+ "id"
1536
+ ],
1537
+ "onDelete": "cascade",
1538
+ "onUpdate": "no action"
1539
+ }
1540
+ },
1541
+ "compositePrimaryKeys": {
1542
+ "Vote_chatId_messageId_pk": {
1543
+ "name": "Vote_chatId_messageId_pk",
1544
+ "columns": [
1545
+ "chatId",
1546
+ "messageId"
1547
+ ]
1548
+ }
1549
+ },
1550
+ "uniqueConstraints": {},
1551
+ "policies": {},
1552
+ "checkConstraints": {},
1553
+ "isRLSEnabled": false
1554
+ }
1555
+ },
1556
+ "enums": {},
1557
+ "schemas": {},
1558
+ "sequences": {},
1559
+ "roles": {},
1560
+ "policies": {},
1561
+ "views": {},
1562
+ "_meta": {
1563
+ "columns": {},
1564
+ "schemas": {},
1565
+ "tables": {}
1566
+ }
1567
+ }