soja-cli 1.5.1 → 1.6.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 (33) hide show
  1. package/dist/application/finance.js +1 -0
  2. package/dist/application/intake.js +1 -0
  3. package/dist/application/services/task-service.js +26 -2
  4. package/dist/application/services/workspace-service.js +5 -2
  5. package/dist/application/timeline.js +2 -0
  6. package/dist/cli/commands/workspace.js +12 -1
  7. package/dist/cli/output.js +2 -1
  8. package/dist/data/local/tasks.js +5 -1
  9. package/dist/data/local/workspaces.js +6 -3
  10. package/dist/data/sync/engine.js +1 -1
  11. package/dist/data/sync/finance.js +15 -0
  12. package/dist/data/sync/index.js +4 -0
  13. package/dist/data/sync/intake.js +27 -0
  14. package/dist/data/sync/services.js +7 -2
  15. package/dist/data/sync/store.js +3 -3
  16. package/dist/database/migrations/0007_finances.sql +5 -0
  17. package/dist/database/migrations/0008_finances_designates.sql +44 -0
  18. package/dist/database/migrations/0009_external_approval.sql +1 -0
  19. package/dist/database/migrations/meta/0008_snapshot.json +1221 -0
  20. package/dist/database/migrations/meta/0009_snapshot.json +1228 -0
  21. package/dist/database/migrations/meta/_journal.json +21 -0
  22. package/dist/database/schema.js +7 -0
  23. package/dist/ui/Shell.js +7 -0
  24. package/dist/ui/chrome/Sidebar.js +1 -1
  25. package/dist/ui/components/TaskTable.js +1 -1
  26. package/dist/ui/hooks/use-commands.js +1 -0
  27. package/dist/ui/hooks/use-task-actions.js +36 -0
  28. package/dist/ui/screens/FinanceScreen.js +88 -0
  29. package/dist/ui/screens/HelpScreen.js +9 -0
  30. package/dist/ui/screens/ProjectsScreen.js +185 -1
  31. package/dist/ui/screens/TaskScreen.js +9 -1
  32. package/dist/ui/screens/WorkspacesScreen.js +29 -1
  33. package/package.json +1 -1
@@ -0,0 +1,1221 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "1c36b138-80c9-445a-b3dd-00f4e2bba9bc",
5
+ "prevId": "76caa0e6-5820-46d2-b57a-3da32e4de294",
6
+ "tables": {
7
+ "chat_channels": {
8
+ "name": "chat_channels",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "workspace_id": {
18
+ "name": "workspace_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "name": {
25
+ "name": "name",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "topic": {
32
+ "name": "topic",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "created_by": {
39
+ "name": "created_by",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "created_at": {
46
+ "name": "created_at",
47
+ "type": "integer",
48
+ "primaryKey": false,
49
+ "notNull": true,
50
+ "autoincrement": false
51
+ },
52
+ "updated_at": {
53
+ "name": "updated_at",
54
+ "type": "integer",
55
+ "primaryKey": false,
56
+ "notNull": true,
57
+ "autoincrement": false
58
+ },
59
+ "archived_at": {
60
+ "name": "archived_at",
61
+ "type": "integer",
62
+ "primaryKey": false,
63
+ "notNull": false,
64
+ "autoincrement": false
65
+ }
66
+ },
67
+ "indexes": {
68
+ "chat_channels_workspace": {
69
+ "name": "chat_channels_workspace",
70
+ "columns": [
71
+ "workspace_id",
72
+ "name"
73
+ ],
74
+ "isUnique": false
75
+ }
76
+ },
77
+ "foreignKeys": {},
78
+ "compositePrimaryKeys": {},
79
+ "uniqueConstraints": {},
80
+ "checkConstraints": {}
81
+ },
82
+ "chat_messages": {
83
+ "name": "chat_messages",
84
+ "columns": {
85
+ "id": {
86
+ "name": "id",
87
+ "type": "text",
88
+ "primaryKey": true,
89
+ "notNull": true,
90
+ "autoincrement": false
91
+ },
92
+ "seq": {
93
+ "name": "seq",
94
+ "type": "integer",
95
+ "primaryKey": false,
96
+ "notNull": false,
97
+ "autoincrement": false
98
+ },
99
+ "workspace_id": {
100
+ "name": "workspace_id",
101
+ "type": "text",
102
+ "primaryKey": false,
103
+ "notNull": true,
104
+ "autoincrement": false
105
+ },
106
+ "channel_id": {
107
+ "name": "channel_id",
108
+ "type": "text",
109
+ "primaryKey": false,
110
+ "notNull": true,
111
+ "autoincrement": false
112
+ },
113
+ "author_id": {
114
+ "name": "author_id",
115
+ "type": "text",
116
+ "primaryKey": false,
117
+ "notNull": false,
118
+ "autoincrement": false
119
+ },
120
+ "body": {
121
+ "name": "body",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true,
125
+ "autoincrement": false
126
+ },
127
+ "reply_to_id": {
128
+ "name": "reply_to_id",
129
+ "type": "text",
130
+ "primaryKey": false,
131
+ "notNull": false,
132
+ "autoincrement": false
133
+ },
134
+ "created_at": {
135
+ "name": "created_at",
136
+ "type": "integer",
137
+ "primaryKey": false,
138
+ "notNull": true,
139
+ "autoincrement": false
140
+ },
141
+ "edited_at": {
142
+ "name": "edited_at",
143
+ "type": "integer",
144
+ "primaryKey": false,
145
+ "notNull": false,
146
+ "autoincrement": false
147
+ },
148
+ "deleted_at": {
149
+ "name": "deleted_at",
150
+ "type": "integer",
151
+ "primaryKey": false,
152
+ "notNull": false,
153
+ "autoincrement": false
154
+ }
155
+ },
156
+ "indexes": {
157
+ "chat_messages_channel": {
158
+ "name": "chat_messages_channel",
159
+ "columns": [
160
+ "channel_id",
161
+ "seq"
162
+ ],
163
+ "isUnique": false
164
+ },
165
+ "chat_messages_workspace": {
166
+ "name": "chat_messages_workspace",
167
+ "columns": [
168
+ "workspace_id"
169
+ ],
170
+ "isUnique": false
171
+ }
172
+ },
173
+ "foreignKeys": {},
174
+ "compositePrimaryKeys": {},
175
+ "uniqueConstraints": {},
176
+ "checkConstraints": {}
177
+ },
178
+ "chat_reads": {
179
+ "name": "chat_reads",
180
+ "columns": {
181
+ "channel_id": {
182
+ "name": "channel_id",
183
+ "type": "text",
184
+ "primaryKey": true,
185
+ "notNull": true,
186
+ "autoincrement": false
187
+ },
188
+ "last_read_seq": {
189
+ "name": "last_read_seq",
190
+ "type": "integer",
191
+ "primaryKey": false,
192
+ "notNull": true,
193
+ "autoincrement": false,
194
+ "default": 0
195
+ }
196
+ },
197
+ "indexes": {},
198
+ "foreignKeys": {},
199
+ "compositePrimaryKeys": {},
200
+ "uniqueConstraints": {},
201
+ "checkConstraints": {}
202
+ },
203
+ "projects": {
204
+ "name": "projects",
205
+ "columns": {
206
+ "id": {
207
+ "name": "id",
208
+ "type": "text",
209
+ "primaryKey": true,
210
+ "notNull": true,
211
+ "autoincrement": false
212
+ },
213
+ "workspace_id": {
214
+ "name": "workspace_id",
215
+ "type": "text",
216
+ "primaryKey": false,
217
+ "notNull": true,
218
+ "autoincrement": false
219
+ },
220
+ "name": {
221
+ "name": "name",
222
+ "type": "text",
223
+ "primaryKey": false,
224
+ "notNull": true,
225
+ "autoincrement": false
226
+ },
227
+ "key": {
228
+ "name": "key",
229
+ "type": "text",
230
+ "primaryKey": false,
231
+ "notNull": true,
232
+ "autoincrement": false
233
+ },
234
+ "description": {
235
+ "name": "description",
236
+ "type": "text",
237
+ "primaryKey": false,
238
+ "notNull": false,
239
+ "autoincrement": false
240
+ },
241
+ "repository_url": {
242
+ "name": "repository_url",
243
+ "type": "text",
244
+ "primaryKey": false,
245
+ "notNull": false,
246
+ "autoincrement": false
247
+ },
248
+ "repository_path": {
249
+ "name": "repository_path",
250
+ "type": "text",
251
+ "primaryKey": false,
252
+ "notNull": false,
253
+ "autoincrement": false
254
+ },
255
+ "created_at": {
256
+ "name": "created_at",
257
+ "type": "integer",
258
+ "primaryKey": false,
259
+ "notNull": true,
260
+ "autoincrement": false
261
+ },
262
+ "updated_at": {
263
+ "name": "updated_at",
264
+ "type": "integer",
265
+ "primaryKey": false,
266
+ "notNull": true,
267
+ "autoincrement": false
268
+ }
269
+ },
270
+ "indexes": {
271
+ "projects_workspace_key": {
272
+ "name": "projects_workspace_key",
273
+ "columns": [
274
+ "workspace_id",
275
+ "key"
276
+ ],
277
+ "isUnique": true
278
+ }
279
+ },
280
+ "foreignKeys": {
281
+ "projects_workspace_id_workspaces_id_fk": {
282
+ "name": "projects_workspace_id_workspaces_id_fk",
283
+ "tableFrom": "projects",
284
+ "tableTo": "workspaces",
285
+ "columnsFrom": [
286
+ "workspace_id"
287
+ ],
288
+ "columnsTo": [
289
+ "id"
290
+ ],
291
+ "onDelete": "cascade",
292
+ "onUpdate": "no action"
293
+ }
294
+ },
295
+ "compositePrimaryKeys": {},
296
+ "uniqueConstraints": {},
297
+ "checkConstraints": {}
298
+ },
299
+ "sync_notices": {
300
+ "name": "sync_notices",
301
+ "columns": {
302
+ "id": {
303
+ "name": "id",
304
+ "type": "text",
305
+ "primaryKey": true,
306
+ "notNull": true,
307
+ "autoincrement": false
308
+ },
309
+ "workspace_id": {
310
+ "name": "workspace_id",
311
+ "type": "text",
312
+ "primaryKey": false,
313
+ "notNull": true,
314
+ "autoincrement": false
315
+ },
316
+ "task_id": {
317
+ "name": "task_id",
318
+ "type": "text",
319
+ "primaryKey": false,
320
+ "notNull": false,
321
+ "autoincrement": false
322
+ },
323
+ "task_ref": {
324
+ "name": "task_ref",
325
+ "type": "text",
326
+ "primaryKey": false,
327
+ "notNull": true,
328
+ "autoincrement": false
329
+ },
330
+ "kind": {
331
+ "name": "kind",
332
+ "type": "text",
333
+ "primaryKey": false,
334
+ "notNull": true,
335
+ "autoincrement": false
336
+ },
337
+ "message": {
338
+ "name": "message",
339
+ "type": "text",
340
+ "primaryKey": false,
341
+ "notNull": true,
342
+ "autoincrement": false
343
+ },
344
+ "field": {
345
+ "name": "field",
346
+ "type": "text",
347
+ "primaryKey": false,
348
+ "notNull": false,
349
+ "autoincrement": false
350
+ },
351
+ "overwritten": {
352
+ "name": "overwritten",
353
+ "type": "text",
354
+ "primaryKey": false,
355
+ "notNull": false,
356
+ "autoincrement": false
357
+ },
358
+ "created_at": {
359
+ "name": "created_at",
360
+ "type": "integer",
361
+ "primaryKey": false,
362
+ "notNull": true,
363
+ "autoincrement": false
364
+ },
365
+ "dismissed_at": {
366
+ "name": "dismissed_at",
367
+ "type": "integer",
368
+ "primaryKey": false,
369
+ "notNull": false,
370
+ "autoincrement": false
371
+ }
372
+ },
373
+ "indexes": {
374
+ "sync_notices_workspace": {
375
+ "name": "sync_notices_workspace",
376
+ "columns": [
377
+ "workspace_id"
378
+ ],
379
+ "isUnique": false
380
+ }
381
+ },
382
+ "foreignKeys": {},
383
+ "compositePrimaryKeys": {},
384
+ "uniqueConstraints": {},
385
+ "checkConstraints": {}
386
+ },
387
+ "sync_outbox": {
388
+ "name": "sync_outbox",
389
+ "columns": {
390
+ "seq": {
391
+ "name": "seq",
392
+ "type": "integer",
393
+ "primaryKey": true,
394
+ "notNull": true,
395
+ "autoincrement": true
396
+ },
397
+ "op_id": {
398
+ "name": "op_id",
399
+ "type": "text",
400
+ "primaryKey": false,
401
+ "notNull": true,
402
+ "autoincrement": false
403
+ },
404
+ "workspace_id": {
405
+ "name": "workspace_id",
406
+ "type": "text",
407
+ "primaryKey": false,
408
+ "notNull": true,
409
+ "autoincrement": false
410
+ },
411
+ "type": {
412
+ "name": "type",
413
+ "type": "text",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "autoincrement": false
417
+ },
418
+ "task_id": {
419
+ "name": "task_id",
420
+ "type": "text",
421
+ "primaryKey": false,
422
+ "notNull": false,
423
+ "autoincrement": false
424
+ },
425
+ "payload": {
426
+ "name": "payload",
427
+ "type": "text",
428
+ "primaryKey": false,
429
+ "notNull": true,
430
+ "autoincrement": false
431
+ },
432
+ "base": {
433
+ "name": "base",
434
+ "type": "text",
435
+ "primaryKey": false,
436
+ "notNull": false,
437
+ "autoincrement": false
438
+ },
439
+ "occurred_at": {
440
+ "name": "occurred_at",
441
+ "type": "integer",
442
+ "primaryKey": false,
443
+ "notNull": true,
444
+ "autoincrement": false
445
+ },
446
+ "attempts": {
447
+ "name": "attempts",
448
+ "type": "integer",
449
+ "primaryKey": false,
450
+ "notNull": true,
451
+ "autoincrement": false,
452
+ "default": 0
453
+ },
454
+ "last_error": {
455
+ "name": "last_error",
456
+ "type": "text",
457
+ "primaryKey": false,
458
+ "notNull": false,
459
+ "autoincrement": false
460
+ }
461
+ },
462
+ "indexes": {
463
+ "sync_outbox_op_id_unique": {
464
+ "name": "sync_outbox_op_id_unique",
465
+ "columns": [
466
+ "op_id"
467
+ ],
468
+ "isUnique": true
469
+ },
470
+ "sync_outbox_workspace": {
471
+ "name": "sync_outbox_workspace",
472
+ "columns": [
473
+ "workspace_id",
474
+ "seq"
475
+ ],
476
+ "isUnique": false
477
+ }
478
+ },
479
+ "foreignKeys": {},
480
+ "compositePrimaryKeys": {},
481
+ "uniqueConstraints": {},
482
+ "checkConstraints": {}
483
+ },
484
+ "sync_pending_activity": {
485
+ "name": "sync_pending_activity",
486
+ "columns": {
487
+ "activity_id": {
488
+ "name": "activity_id",
489
+ "type": "text",
490
+ "primaryKey": true,
491
+ "notNull": true,
492
+ "autoincrement": false
493
+ },
494
+ "op_id": {
495
+ "name": "op_id",
496
+ "type": "text",
497
+ "primaryKey": false,
498
+ "notNull": true,
499
+ "autoincrement": false
500
+ }
501
+ },
502
+ "indexes": {},
503
+ "foreignKeys": {},
504
+ "compositePrimaryKeys": {},
505
+ "uniqueConstraints": {},
506
+ "checkConstraints": {}
507
+ },
508
+ "sync_state": {
509
+ "name": "sync_state",
510
+ "columns": {
511
+ "workspace_id": {
512
+ "name": "workspace_id",
513
+ "type": "text",
514
+ "primaryKey": true,
515
+ "notNull": true,
516
+ "autoincrement": false
517
+ },
518
+ "cursor": {
519
+ "name": "cursor",
520
+ "type": "integer",
521
+ "primaryKey": false,
522
+ "notNull": true,
523
+ "autoincrement": false,
524
+ "default": 0
525
+ },
526
+ "last_sync_at": {
527
+ "name": "last_sync_at",
528
+ "type": "integer",
529
+ "primaryKey": false,
530
+ "notNull": false,
531
+ "autoincrement": false
532
+ },
533
+ "last_error": {
534
+ "name": "last_error",
535
+ "type": "text",
536
+ "primaryKey": false,
537
+ "notNull": false,
538
+ "autoincrement": false
539
+ }
540
+ },
541
+ "indexes": {},
542
+ "foreignKeys": {},
543
+ "compositePrimaryKeys": {},
544
+ "uniqueConstraints": {},
545
+ "checkConstraints": {}
546
+ },
547
+ "task_activity": {
548
+ "name": "task_activity",
549
+ "columns": {
550
+ "id": {
551
+ "name": "id",
552
+ "type": "text",
553
+ "primaryKey": true,
554
+ "notNull": true,
555
+ "autoincrement": false
556
+ },
557
+ "task_id": {
558
+ "name": "task_id",
559
+ "type": "text",
560
+ "primaryKey": false,
561
+ "notNull": true,
562
+ "autoincrement": false
563
+ },
564
+ "user_id": {
565
+ "name": "user_id",
566
+ "type": "text",
567
+ "primaryKey": false,
568
+ "notNull": false,
569
+ "autoincrement": false
570
+ },
571
+ "type": {
572
+ "name": "type",
573
+ "type": "text",
574
+ "primaryKey": false,
575
+ "notNull": true,
576
+ "autoincrement": false
577
+ },
578
+ "metadata": {
579
+ "name": "metadata",
580
+ "type": "text",
581
+ "primaryKey": false,
582
+ "notNull": true,
583
+ "autoincrement": false
584
+ },
585
+ "created_at": {
586
+ "name": "created_at",
587
+ "type": "integer",
588
+ "primaryKey": false,
589
+ "notNull": true,
590
+ "autoincrement": false
591
+ }
592
+ },
593
+ "indexes": {
594
+ "task_activity_task": {
595
+ "name": "task_activity_task",
596
+ "columns": [
597
+ "task_id"
598
+ ],
599
+ "isUnique": false
600
+ }
601
+ },
602
+ "foreignKeys": {
603
+ "task_activity_task_id_tasks_id_fk": {
604
+ "name": "task_activity_task_id_tasks_id_fk",
605
+ "tableFrom": "task_activity",
606
+ "tableTo": "tasks",
607
+ "columnsFrom": [
608
+ "task_id"
609
+ ],
610
+ "columnsTo": [
611
+ "id"
612
+ ],
613
+ "onDelete": "cascade",
614
+ "onUpdate": "no action"
615
+ },
616
+ "task_activity_user_id_users_id_fk": {
617
+ "name": "task_activity_user_id_users_id_fk",
618
+ "tableFrom": "task_activity",
619
+ "tableTo": "users",
620
+ "columnsFrom": [
621
+ "user_id"
622
+ ],
623
+ "columnsTo": [
624
+ "id"
625
+ ],
626
+ "onDelete": "set null",
627
+ "onUpdate": "no action"
628
+ }
629
+ },
630
+ "compositePrimaryKeys": {},
631
+ "uniqueConstraints": {},
632
+ "checkConstraints": {
633
+ "task_activity_type": {
634
+ "name": "task_activity_type",
635
+ "value": "type IN ('task_created', 'task_updated', 'status_changed', 'assigned', 'unassigned', 'priority_changed', 'project_changed', 'comment_added', 'task_completed', 'task_reopened', 'git_committed', 'git_merged', 'git_branch_deleted', 'git_pushed', 'pr_opened', 'git_merge_detected', 'pr_merged', 'pr_checks_failed', 'task_archived', 'task_unarchived')"
636
+ }
637
+ }
638
+ },
639
+ "task_comments": {
640
+ "name": "task_comments",
641
+ "columns": {
642
+ "id": {
643
+ "name": "id",
644
+ "type": "text",
645
+ "primaryKey": true,
646
+ "notNull": true,
647
+ "autoincrement": false
648
+ },
649
+ "task_id": {
650
+ "name": "task_id",
651
+ "type": "text",
652
+ "primaryKey": false,
653
+ "notNull": true,
654
+ "autoincrement": false
655
+ },
656
+ "user_id": {
657
+ "name": "user_id",
658
+ "type": "text",
659
+ "primaryKey": false,
660
+ "notNull": true,
661
+ "autoincrement": false
662
+ },
663
+ "body": {
664
+ "name": "body",
665
+ "type": "text",
666
+ "primaryKey": false,
667
+ "notNull": true,
668
+ "autoincrement": false
669
+ },
670
+ "created_at": {
671
+ "name": "created_at",
672
+ "type": "integer",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "autoincrement": false
676
+ },
677
+ "updated_at": {
678
+ "name": "updated_at",
679
+ "type": "integer",
680
+ "primaryKey": false,
681
+ "notNull": true,
682
+ "autoincrement": false
683
+ }
684
+ },
685
+ "indexes": {
686
+ "task_comments_task": {
687
+ "name": "task_comments_task",
688
+ "columns": [
689
+ "task_id"
690
+ ],
691
+ "isUnique": false
692
+ }
693
+ },
694
+ "foreignKeys": {
695
+ "task_comments_task_id_tasks_id_fk": {
696
+ "name": "task_comments_task_id_tasks_id_fk",
697
+ "tableFrom": "task_comments",
698
+ "tableTo": "tasks",
699
+ "columnsFrom": [
700
+ "task_id"
701
+ ],
702
+ "columnsTo": [
703
+ "id"
704
+ ],
705
+ "onDelete": "cascade",
706
+ "onUpdate": "no action"
707
+ },
708
+ "task_comments_user_id_users_id_fk": {
709
+ "name": "task_comments_user_id_users_id_fk",
710
+ "tableFrom": "task_comments",
711
+ "tableTo": "users",
712
+ "columnsFrom": [
713
+ "user_id"
714
+ ],
715
+ "columnsTo": [
716
+ "id"
717
+ ],
718
+ "onDelete": "no action",
719
+ "onUpdate": "no action"
720
+ }
721
+ },
722
+ "compositePrimaryKeys": {},
723
+ "uniqueConstraints": {},
724
+ "checkConstraints": {}
725
+ },
726
+ "tasks": {
727
+ "name": "tasks",
728
+ "columns": {
729
+ "id": {
730
+ "name": "id",
731
+ "type": "text",
732
+ "primaryKey": true,
733
+ "notNull": true,
734
+ "autoincrement": false
735
+ },
736
+ "number": {
737
+ "name": "number",
738
+ "type": "integer",
739
+ "primaryKey": false,
740
+ "notNull": true,
741
+ "autoincrement": false
742
+ },
743
+ "workspace_id": {
744
+ "name": "workspace_id",
745
+ "type": "text",
746
+ "primaryKey": false,
747
+ "notNull": true,
748
+ "autoincrement": false
749
+ },
750
+ "project_id": {
751
+ "name": "project_id",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": false,
755
+ "autoincrement": false
756
+ },
757
+ "title": {
758
+ "name": "title",
759
+ "type": "text",
760
+ "primaryKey": false,
761
+ "notNull": true,
762
+ "autoincrement": false
763
+ },
764
+ "description": {
765
+ "name": "description",
766
+ "type": "text",
767
+ "primaryKey": false,
768
+ "notNull": false,
769
+ "autoincrement": false
770
+ },
771
+ "type": {
772
+ "name": "type",
773
+ "type": "text",
774
+ "primaryKey": false,
775
+ "notNull": true,
776
+ "autoincrement": false
777
+ },
778
+ "priority": {
779
+ "name": "priority",
780
+ "type": "text",
781
+ "primaryKey": false,
782
+ "notNull": true,
783
+ "autoincrement": false
784
+ },
785
+ "status": {
786
+ "name": "status",
787
+ "type": "text",
788
+ "primaryKey": false,
789
+ "notNull": true,
790
+ "autoincrement": false
791
+ },
792
+ "assignee_id": {
793
+ "name": "assignee_id",
794
+ "type": "text",
795
+ "primaryKey": false,
796
+ "notNull": false,
797
+ "autoincrement": false
798
+ },
799
+ "creator_id": {
800
+ "name": "creator_id",
801
+ "type": "text",
802
+ "primaryKey": false,
803
+ "notNull": true,
804
+ "autoincrement": false
805
+ },
806
+ "requester": {
807
+ "name": "requester",
808
+ "type": "text",
809
+ "primaryKey": false,
810
+ "notNull": false,
811
+ "autoincrement": false
812
+ },
813
+ "remunerated": {
814
+ "name": "remunerated",
815
+ "type": "integer",
816
+ "primaryKey": false,
817
+ "notNull": true,
818
+ "autoincrement": false,
819
+ "default": false
820
+ },
821
+ "price_minor": {
822
+ "name": "price_minor",
823
+ "type": "integer",
824
+ "primaryKey": false,
825
+ "notNull": false,
826
+ "autoincrement": false
827
+ },
828
+ "currency_code": {
829
+ "name": "currency_code",
830
+ "type": "text",
831
+ "primaryKey": false,
832
+ "notNull": false,
833
+ "autoincrement": false
834
+ },
835
+ "branch": {
836
+ "name": "branch",
837
+ "type": "text",
838
+ "primaryKey": false,
839
+ "notNull": false,
840
+ "autoincrement": false
841
+ },
842
+ "base_branch": {
843
+ "name": "base_branch",
844
+ "type": "text",
845
+ "primaryKey": false,
846
+ "notNull": false,
847
+ "autoincrement": false
848
+ },
849
+ "branch_start": {
850
+ "name": "branch_start",
851
+ "type": "text",
852
+ "primaryKey": false,
853
+ "notNull": false,
854
+ "autoincrement": false
855
+ },
856
+ "created_at": {
857
+ "name": "created_at",
858
+ "type": "integer",
859
+ "primaryKey": false,
860
+ "notNull": true,
861
+ "autoincrement": false
862
+ },
863
+ "updated_at": {
864
+ "name": "updated_at",
865
+ "type": "integer",
866
+ "primaryKey": false,
867
+ "notNull": true,
868
+ "autoincrement": false
869
+ },
870
+ "started_at": {
871
+ "name": "started_at",
872
+ "type": "integer",
873
+ "primaryKey": false,
874
+ "notNull": false,
875
+ "autoincrement": false
876
+ },
877
+ "completed_at": {
878
+ "name": "completed_at",
879
+ "type": "integer",
880
+ "primaryKey": false,
881
+ "notNull": false,
882
+ "autoincrement": false
883
+ },
884
+ "archived_at": {
885
+ "name": "archived_at",
886
+ "type": "integer",
887
+ "primaryKey": false,
888
+ "notNull": false,
889
+ "autoincrement": false
890
+ }
891
+ },
892
+ "indexes": {
893
+ "tasks_workspace_number": {
894
+ "name": "tasks_workspace_number",
895
+ "columns": [
896
+ "workspace_id",
897
+ "number"
898
+ ],
899
+ "isUnique": true
900
+ },
901
+ "tasks_workspace_status": {
902
+ "name": "tasks_workspace_status",
903
+ "columns": [
904
+ "workspace_id",
905
+ "status"
906
+ ],
907
+ "isUnique": false
908
+ },
909
+ "tasks_assignee": {
910
+ "name": "tasks_assignee",
911
+ "columns": [
912
+ "assignee_id"
913
+ ],
914
+ "isUnique": false
915
+ },
916
+ "tasks_project": {
917
+ "name": "tasks_project",
918
+ "columns": [
919
+ "project_id"
920
+ ],
921
+ "isUnique": false
922
+ }
923
+ },
924
+ "foreignKeys": {
925
+ "tasks_workspace_id_workspaces_id_fk": {
926
+ "name": "tasks_workspace_id_workspaces_id_fk",
927
+ "tableFrom": "tasks",
928
+ "tableTo": "workspaces",
929
+ "columnsFrom": [
930
+ "workspace_id"
931
+ ],
932
+ "columnsTo": [
933
+ "id"
934
+ ],
935
+ "onDelete": "cascade",
936
+ "onUpdate": "no action"
937
+ },
938
+ "tasks_project_id_projects_id_fk": {
939
+ "name": "tasks_project_id_projects_id_fk",
940
+ "tableFrom": "tasks",
941
+ "tableTo": "projects",
942
+ "columnsFrom": [
943
+ "project_id"
944
+ ],
945
+ "columnsTo": [
946
+ "id"
947
+ ],
948
+ "onDelete": "set null",
949
+ "onUpdate": "no action"
950
+ },
951
+ "tasks_assignee_id_users_id_fk": {
952
+ "name": "tasks_assignee_id_users_id_fk",
953
+ "tableFrom": "tasks",
954
+ "tableTo": "users",
955
+ "columnsFrom": [
956
+ "assignee_id"
957
+ ],
958
+ "columnsTo": [
959
+ "id"
960
+ ],
961
+ "onDelete": "set null",
962
+ "onUpdate": "no action"
963
+ },
964
+ "tasks_creator_id_users_id_fk": {
965
+ "name": "tasks_creator_id_users_id_fk",
966
+ "tableFrom": "tasks",
967
+ "tableTo": "users",
968
+ "columnsFrom": [
969
+ "creator_id"
970
+ ],
971
+ "columnsTo": [
972
+ "id"
973
+ ],
974
+ "onDelete": "no action",
975
+ "onUpdate": "no action"
976
+ }
977
+ },
978
+ "compositePrimaryKeys": {},
979
+ "uniqueConstraints": {},
980
+ "checkConstraints": {
981
+ "tasks_type": {
982
+ "name": "tasks_type",
983
+ "value": "type IN ('bug', 'feature', 'improvement', 'maintenance', 'infra', 'refactor', 'research', 'chore')"
984
+ },
985
+ "tasks_priority": {
986
+ "name": "tasks_priority",
987
+ "value": "priority IN ('none', 'low', 'medium', 'high', 'urgent')"
988
+ },
989
+ "tasks_status": {
990
+ "name": "tasks_status",
991
+ "value": "status IN ('backlog', 'todo', 'in_progress', 'review', 'blocked', 'done', 'cancelled')"
992
+ },
993
+ "tasks_price_nonnegative": {
994
+ "name": "tasks_price_nonnegative",
995
+ "value": "price_minor IS NULL OR price_minor >= 0"
996
+ },
997
+ "tasks_remuneration_fields": {
998
+ "name": "tasks_remuneration_fields",
999
+ "value": "(remunerated = 0 AND price_minor IS NULL AND currency_code IS NULL) OR (remunerated = 1 AND price_minor IS NOT NULL AND currency_code IS NOT NULL)"
1000
+ }
1001
+ }
1002
+ },
1003
+ "users": {
1004
+ "name": "users",
1005
+ "columns": {
1006
+ "id": {
1007
+ "name": "id",
1008
+ "type": "text",
1009
+ "primaryKey": true,
1010
+ "notNull": true,
1011
+ "autoincrement": false
1012
+ },
1013
+ "username": {
1014
+ "name": "username",
1015
+ "type": "text",
1016
+ "primaryKey": false,
1017
+ "notNull": true,
1018
+ "autoincrement": false
1019
+ },
1020
+ "display_name": {
1021
+ "name": "display_name",
1022
+ "type": "text",
1023
+ "primaryKey": false,
1024
+ "notNull": true,
1025
+ "autoincrement": false
1026
+ },
1027
+ "email": {
1028
+ "name": "email",
1029
+ "type": "text",
1030
+ "primaryKey": false,
1031
+ "notNull": false,
1032
+ "autoincrement": false
1033
+ },
1034
+ "created_at": {
1035
+ "name": "created_at",
1036
+ "type": "integer",
1037
+ "primaryKey": false,
1038
+ "notNull": true,
1039
+ "autoincrement": false
1040
+ },
1041
+ "updated_at": {
1042
+ "name": "updated_at",
1043
+ "type": "integer",
1044
+ "primaryKey": false,
1045
+ "notNull": true,
1046
+ "autoincrement": false
1047
+ }
1048
+ },
1049
+ "indexes": {
1050
+ "users_username_unique": {
1051
+ "name": "users_username_unique",
1052
+ "columns": [
1053
+ "username"
1054
+ ],
1055
+ "isUnique": true
1056
+ }
1057
+ },
1058
+ "foreignKeys": {},
1059
+ "compositePrimaryKeys": {},
1060
+ "uniqueConstraints": {},
1061
+ "checkConstraints": {}
1062
+ },
1063
+ "workspace_members": {
1064
+ "name": "workspace_members",
1065
+ "columns": {
1066
+ "workspace_id": {
1067
+ "name": "workspace_id",
1068
+ "type": "text",
1069
+ "primaryKey": false,
1070
+ "notNull": true,
1071
+ "autoincrement": false
1072
+ },
1073
+ "user_id": {
1074
+ "name": "user_id",
1075
+ "type": "text",
1076
+ "primaryKey": false,
1077
+ "notNull": true,
1078
+ "autoincrement": false
1079
+ },
1080
+ "role": {
1081
+ "name": "role",
1082
+ "type": "text",
1083
+ "primaryKey": false,
1084
+ "notNull": true,
1085
+ "autoincrement": false
1086
+ },
1087
+ "designated": {
1088
+ "name": "designated",
1089
+ "type": "integer",
1090
+ "primaryKey": false,
1091
+ "notNull": true,
1092
+ "autoincrement": false,
1093
+ "default": false
1094
+ }
1095
+ },
1096
+ "indexes": {},
1097
+ "foreignKeys": {
1098
+ "workspace_members_workspace_id_workspaces_id_fk": {
1099
+ "name": "workspace_members_workspace_id_workspaces_id_fk",
1100
+ "tableFrom": "workspace_members",
1101
+ "tableTo": "workspaces",
1102
+ "columnsFrom": [
1103
+ "workspace_id"
1104
+ ],
1105
+ "columnsTo": [
1106
+ "id"
1107
+ ],
1108
+ "onDelete": "cascade",
1109
+ "onUpdate": "no action"
1110
+ },
1111
+ "workspace_members_user_id_users_id_fk": {
1112
+ "name": "workspace_members_user_id_users_id_fk",
1113
+ "tableFrom": "workspace_members",
1114
+ "tableTo": "users",
1115
+ "columnsFrom": [
1116
+ "user_id"
1117
+ ],
1118
+ "columnsTo": [
1119
+ "id"
1120
+ ],
1121
+ "onDelete": "cascade",
1122
+ "onUpdate": "no action"
1123
+ }
1124
+ },
1125
+ "compositePrimaryKeys": {
1126
+ "workspace_members_workspace_id_user_id_pk": {
1127
+ "columns": [
1128
+ "workspace_id",
1129
+ "user_id"
1130
+ ],
1131
+ "name": "workspace_members_workspace_id_user_id_pk"
1132
+ }
1133
+ },
1134
+ "uniqueConstraints": {},
1135
+ "checkConstraints": {
1136
+ "workspace_members_role": {
1137
+ "name": "workspace_members_role",
1138
+ "value": "role IN ('owner', 'member')"
1139
+ }
1140
+ }
1141
+ },
1142
+ "workspaces": {
1143
+ "name": "workspaces",
1144
+ "columns": {
1145
+ "id": {
1146
+ "name": "id",
1147
+ "type": "text",
1148
+ "primaryKey": true,
1149
+ "notNull": true,
1150
+ "autoincrement": false
1151
+ },
1152
+ "name": {
1153
+ "name": "name",
1154
+ "type": "text",
1155
+ "primaryKey": false,
1156
+ "notNull": true,
1157
+ "autoincrement": false
1158
+ },
1159
+ "slug": {
1160
+ "name": "slug",
1161
+ "type": "text",
1162
+ "primaryKey": false,
1163
+ "notNull": true,
1164
+ "autoincrement": false
1165
+ },
1166
+ "description": {
1167
+ "name": "description",
1168
+ "type": "text",
1169
+ "primaryKey": false,
1170
+ "notNull": false,
1171
+ "autoincrement": false
1172
+ },
1173
+ "last_deleted_number": {
1174
+ "name": "last_deleted_number",
1175
+ "type": "integer",
1176
+ "primaryKey": false,
1177
+ "notNull": true,
1178
+ "autoincrement": false,
1179
+ "default": 0
1180
+ },
1181
+ "created_at": {
1182
+ "name": "created_at",
1183
+ "type": "integer",
1184
+ "primaryKey": false,
1185
+ "notNull": true,
1186
+ "autoincrement": false
1187
+ },
1188
+ "updated_at": {
1189
+ "name": "updated_at",
1190
+ "type": "integer",
1191
+ "primaryKey": false,
1192
+ "notNull": true,
1193
+ "autoincrement": false
1194
+ }
1195
+ },
1196
+ "indexes": {
1197
+ "workspaces_slug_unique": {
1198
+ "name": "workspaces_slug_unique",
1199
+ "columns": [
1200
+ "slug"
1201
+ ],
1202
+ "isUnique": true
1203
+ }
1204
+ },
1205
+ "foreignKeys": {},
1206
+ "compositePrimaryKeys": {},
1207
+ "uniqueConstraints": {},
1208
+ "checkConstraints": {}
1209
+ }
1210
+ },
1211
+ "views": {},
1212
+ "enums": {},
1213
+ "_meta": {
1214
+ "schemas": {},
1215
+ "tables": {},
1216
+ "columns": {}
1217
+ },
1218
+ "internal": {
1219
+ "indexes": {}
1220
+ }
1221
+ }