@wrenautomation/vireo 0.5.2 → 0.6.1

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.
@@ -0,0 +1,1120 @@
1
+ {
2
+ "id": "8c75dab3-19fa-45c4-a98b-eadc82ec2da4",
3
+ "prevId": "02b909b3-6ea0-4b45-8d12-8b4b905ce429",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "vireo.batches": {
8
+ "name": "batches",
9
+ "schema": "vireo",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "serial",
14
+ "primaryKey": false,
15
+ "notNull": true
16
+ },
17
+ "subject_id": {
18
+ "name": "subject_id",
19
+ "type": "integer",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "n": {
24
+ "name": "n",
25
+ "type": "integer",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "why": {
30
+ "name": "why",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "agent": {
36
+ "name": "agent",
37
+ "type": "varchar(120)",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "state": {
42
+ "name": "state",
43
+ "type": "varchar(8)",
44
+ "primaryKey": false,
45
+ "notNull": true,
46
+ "default": "'open'"
47
+ },
48
+ "note": {
49
+ "name": "note",
50
+ "type": "text",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "closed_at": {
55
+ "name": "closed_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": false
59
+ },
60
+ "created_at": {
61
+ "name": "created_at",
62
+ "type": "timestamp with time zone",
63
+ "primaryKey": false,
64
+ "notNull": true,
65
+ "default": "now()"
66
+ }
67
+ },
68
+ "indexes": {
69
+ "ix_vireo_batches_subject": {
70
+ "name": "ix_vireo_batches_subject",
71
+ "columns": [
72
+ {
73
+ "expression": "subject_id",
74
+ "isExpression": false,
75
+ "asc": true,
76
+ "nulls": "last"
77
+ },
78
+ {
79
+ "expression": "state",
80
+ "isExpression": false,
81
+ "asc": true,
82
+ "nulls": "last"
83
+ }
84
+ ],
85
+ "isUnique": false,
86
+ "concurrently": false,
87
+ "method": "btree",
88
+ "with": {}
89
+ }
90
+ },
91
+ "foreignKeys": {
92
+ "fk_batches_subject_id_subjects": {
93
+ "name": "fk_batches_subject_id_subjects",
94
+ "tableFrom": "batches",
95
+ "tableTo": "subjects",
96
+ "schemaTo": "vireo",
97
+ "columnsFrom": [
98
+ "subject_id"
99
+ ],
100
+ "columnsTo": [
101
+ "id"
102
+ ],
103
+ "onDelete": "cascade",
104
+ "onUpdate": "no action"
105
+ }
106
+ },
107
+ "compositePrimaryKeys": {
108
+ "pk_batches": {
109
+ "name": "pk_batches",
110
+ "columns": [
111
+ "id"
112
+ ]
113
+ }
114
+ },
115
+ "uniqueConstraints": {
116
+ "uq_vireo_batches_subject_n": {
117
+ "name": "uq_vireo_batches_subject_n",
118
+ "nullsNotDistinct": false,
119
+ "columns": [
120
+ "subject_id",
121
+ "n"
122
+ ]
123
+ }
124
+ },
125
+ "policies": {},
126
+ "checkConstraints": {
127
+ "ck_vireo_batches_state": {
128
+ "name": "ck_vireo_batches_state",
129
+ "value": "(\"state\")::text = ANY ((ARRAY['open'::character varying, 'closed'::character varying])::text[])"
130
+ }
131
+ },
132
+ "isRLSEnabled": false
133
+ },
134
+ "vireo.guides": {
135
+ "name": "guides",
136
+ "schema": "vireo",
137
+ "columns": {
138
+ "id": {
139
+ "name": "id",
140
+ "type": "serial",
141
+ "primaryKey": false,
142
+ "notNull": true
143
+ },
144
+ "text": {
145
+ "name": "text",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": true
149
+ },
150
+ "source": {
151
+ "name": "source",
152
+ "type": "varchar(8)",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "'person'"
156
+ },
157
+ "ref": {
158
+ "name": "ref",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": false
162
+ },
163
+ "subject_id": {
164
+ "name": "subject_id",
165
+ "type": "integer",
166
+ "primaryKey": false,
167
+ "notNull": false
168
+ },
169
+ "kind": {
170
+ "name": "kind",
171
+ "type": "varchar(8)",
172
+ "primaryKey": false,
173
+ "notNull": false
174
+ },
175
+ "state": {
176
+ "name": "state",
177
+ "type": "varchar(8)",
178
+ "primaryKey": false,
179
+ "notNull": true,
180
+ "default": "'testing'"
181
+ },
182
+ "by": {
183
+ "name": "by",
184
+ "type": "varchar(320)",
185
+ "primaryKey": false,
186
+ "notNull": false
187
+ },
188
+ "decided_at": {
189
+ "name": "decided_at",
190
+ "type": "timestamp with time zone",
191
+ "primaryKey": false,
192
+ "notNull": false
193
+ },
194
+ "created_at": {
195
+ "name": "created_at",
196
+ "type": "timestamp with time zone",
197
+ "primaryKey": false,
198
+ "notNull": true,
199
+ "default": "now()"
200
+ }
201
+ },
202
+ "indexes": {
203
+ "ix_vireo_guides_subject": {
204
+ "name": "ix_vireo_guides_subject",
205
+ "columns": [
206
+ {
207
+ "expression": "subject_id",
208
+ "isExpression": false,
209
+ "asc": true,
210
+ "nulls": "last"
211
+ }
212
+ ],
213
+ "isUnique": false,
214
+ "concurrently": false,
215
+ "method": "btree",
216
+ "with": {}
217
+ }
218
+ },
219
+ "foreignKeys": {
220
+ "fk_guides_subject_id_subjects": {
221
+ "name": "fk_guides_subject_id_subjects",
222
+ "tableFrom": "guides",
223
+ "tableTo": "subjects",
224
+ "schemaTo": "vireo",
225
+ "columnsFrom": [
226
+ "subject_id"
227
+ ],
228
+ "columnsTo": [
229
+ "id"
230
+ ],
231
+ "onDelete": "cascade",
232
+ "onUpdate": "no action"
233
+ }
234
+ },
235
+ "compositePrimaryKeys": {
236
+ "pk_guides": {
237
+ "name": "pk_guides",
238
+ "columns": [
239
+ "id"
240
+ ]
241
+ }
242
+ },
243
+ "uniqueConstraints": {},
244
+ "policies": {},
245
+ "checkConstraints": {
246
+ "ck_vireo_guides_source": {
247
+ "name": "ck_vireo_guides_source",
248
+ "value": "(\"source\")::text = ANY ((ARRAY['person'::character varying, 'study'::character varying, 'sop'::character varying, 'skill'::character varying, 'agent'::character varying])::text[])"
249
+ },
250
+ "ck_vireo_guides_kind": {
251
+ "name": "ck_vireo_guides_kind",
252
+ "value": "(\"kind\")::text = ANY ((ARRAY['text'::character varying, 'image'::character varying, 'video'::character varying, 'page'::character varying])::text[])"
253
+ },
254
+ "ck_vireo_guides_state": {
255
+ "name": "ck_vireo_guides_state",
256
+ "value": "(\"state\")::text = ANY ((ARRAY['testing'::character varying, 'locked'::character varying, 'dropped'::character varying])::text[])"
257
+ }
258
+ },
259
+ "isRLSEnabled": false
260
+ },
261
+ "vireo.lineage": {
262
+ "name": "lineage",
263
+ "schema": "vireo",
264
+ "columns": {
265
+ "child_id": {
266
+ "name": "child_id",
267
+ "type": "integer",
268
+ "primaryKey": false,
269
+ "notNull": true
270
+ },
271
+ "parent_id": {
272
+ "name": "parent_id",
273
+ "type": "integer",
274
+ "primaryKey": false,
275
+ "notNull": true
276
+ },
277
+ "position": {
278
+ "name": "position",
279
+ "type": "smallint",
280
+ "primaryKey": false,
281
+ "notNull": true,
282
+ "default": 0
283
+ },
284
+ "took": {
285
+ "name": "took",
286
+ "type": "text",
287
+ "primaryKey": false,
288
+ "notNull": false
289
+ }
290
+ },
291
+ "indexes": {
292
+ "ix_vireo_lineage_parent": {
293
+ "name": "ix_vireo_lineage_parent",
294
+ "columns": [
295
+ {
296
+ "expression": "parent_id",
297
+ "isExpression": false,
298
+ "asc": true,
299
+ "nulls": "last"
300
+ }
301
+ ],
302
+ "isUnique": false,
303
+ "concurrently": false,
304
+ "method": "btree",
305
+ "with": {}
306
+ }
307
+ },
308
+ "foreignKeys": {
309
+ "fk_lineage_child_id_samples": {
310
+ "name": "fk_lineage_child_id_samples",
311
+ "tableFrom": "lineage",
312
+ "tableTo": "samples",
313
+ "schemaTo": "vireo",
314
+ "columnsFrom": [
315
+ "child_id"
316
+ ],
317
+ "columnsTo": [
318
+ "id"
319
+ ],
320
+ "onDelete": "cascade",
321
+ "onUpdate": "no action"
322
+ },
323
+ "fk_lineage_parent_id_samples": {
324
+ "name": "fk_lineage_parent_id_samples",
325
+ "tableFrom": "lineage",
326
+ "tableTo": "samples",
327
+ "schemaTo": "vireo",
328
+ "columnsFrom": [
329
+ "parent_id"
330
+ ],
331
+ "columnsTo": [
332
+ "id"
333
+ ],
334
+ "onDelete": "cascade",
335
+ "onUpdate": "no action"
336
+ }
337
+ },
338
+ "compositePrimaryKeys": {
339
+ "pk_lineage": {
340
+ "name": "pk_lineage",
341
+ "columns": [
342
+ "child_id",
343
+ "parent_id"
344
+ ]
345
+ }
346
+ },
347
+ "uniqueConstraints": {},
348
+ "policies": {},
349
+ "checkConstraints": {
350
+ "ck_vireo_lineage_not_self": {
351
+ "name": "ck_vireo_lineage_not_self",
352
+ "value": "\"child_id\" <> \"parent_id\""
353
+ }
354
+ },
355
+ "isRLSEnabled": false
356
+ },
357
+ "vireo.notes": {
358
+ "name": "notes",
359
+ "schema": "vireo",
360
+ "columns": {
361
+ "id": {
362
+ "name": "id",
363
+ "type": "serial",
364
+ "primaryKey": false,
365
+ "notNull": true
366
+ },
367
+ "sample_id": {
368
+ "name": "sample_id",
369
+ "type": "integer",
370
+ "primaryKey": false,
371
+ "notNull": true
372
+ },
373
+ "anchor": {
374
+ "name": "anchor",
375
+ "type": "jsonb",
376
+ "primaryKey": false,
377
+ "notNull": false
378
+ },
379
+ "tone": {
380
+ "name": "tone",
381
+ "type": "varchar(4)",
382
+ "primaryKey": false,
383
+ "notNull": false
384
+ },
385
+ "text": {
386
+ "name": "text",
387
+ "type": "text",
388
+ "primaryKey": false,
389
+ "notNull": false
390
+ },
391
+ "by": {
392
+ "name": "by",
393
+ "type": "varchar(320)",
394
+ "primaryKey": false,
395
+ "notNull": false
396
+ },
397
+ "created_at": {
398
+ "name": "created_at",
399
+ "type": "timestamp with time zone",
400
+ "primaryKey": false,
401
+ "notNull": true,
402
+ "default": "now()"
403
+ }
404
+ },
405
+ "indexes": {
406
+ "ix_vireo_notes_sample": {
407
+ "name": "ix_vireo_notes_sample",
408
+ "columns": [
409
+ {
410
+ "expression": "sample_id",
411
+ "isExpression": false,
412
+ "asc": true,
413
+ "nulls": "last"
414
+ }
415
+ ],
416
+ "isUnique": false,
417
+ "concurrently": false,
418
+ "method": "btree",
419
+ "with": {}
420
+ }
421
+ },
422
+ "foreignKeys": {
423
+ "fk_notes_sample_id_samples": {
424
+ "name": "fk_notes_sample_id_samples",
425
+ "tableFrom": "notes",
426
+ "tableTo": "samples",
427
+ "schemaTo": "vireo",
428
+ "columnsFrom": [
429
+ "sample_id"
430
+ ],
431
+ "columnsTo": [
432
+ "id"
433
+ ],
434
+ "onDelete": "cascade",
435
+ "onUpdate": "no action"
436
+ }
437
+ },
438
+ "compositePrimaryKeys": {
439
+ "pk_notes": {
440
+ "name": "pk_notes",
441
+ "columns": [
442
+ "id"
443
+ ]
444
+ }
445
+ },
446
+ "uniqueConstraints": {},
447
+ "policies": {},
448
+ "checkConstraints": {
449
+ "ck_vireo_notes_tone": {
450
+ "name": "ck_vireo_notes_tone",
451
+ "value": "(\"tone\")::text = ANY ((ARRAY['good'::character varying, 'bad'::character varying])::text[])"
452
+ }
453
+ },
454
+ "isRLSEnabled": false
455
+ },
456
+ "vireo.outcomes": {
457
+ "name": "outcomes",
458
+ "schema": "vireo",
459
+ "columns": {
460
+ "ship_id": {
461
+ "name": "ship_id",
462
+ "type": "integer",
463
+ "primaryKey": false,
464
+ "notNull": true
465
+ },
466
+ "segment": {
467
+ "name": "segment",
468
+ "type": "varchar(160)",
469
+ "primaryKey": false,
470
+ "notNull": true
471
+ },
472
+ "day": {
473
+ "name": "day",
474
+ "type": "date",
475
+ "primaryKey": false,
476
+ "notNull": true
477
+ },
478
+ "metric": {
479
+ "name": "metric",
480
+ "type": "varchar(32)",
481
+ "primaryKey": false,
482
+ "notNull": true
483
+ },
484
+ "value": {
485
+ "name": "value",
486
+ "type": "double precision",
487
+ "primaryKey": false,
488
+ "notNull": true
489
+ },
490
+ "fetched_at": {
491
+ "name": "fetched_at",
492
+ "type": "timestamp with time zone",
493
+ "primaryKey": false,
494
+ "notNull": true,
495
+ "default": "now()"
496
+ }
497
+ },
498
+ "indexes": {},
499
+ "foreignKeys": {
500
+ "fk_outcomes_ship_id_ships": {
501
+ "name": "fk_outcomes_ship_id_ships",
502
+ "tableFrom": "outcomes",
503
+ "tableTo": "ships",
504
+ "schemaTo": "vireo",
505
+ "columnsFrom": [
506
+ "ship_id"
507
+ ],
508
+ "columnsTo": [
509
+ "id"
510
+ ],
511
+ "onDelete": "cascade",
512
+ "onUpdate": "no action"
513
+ }
514
+ },
515
+ "compositePrimaryKeys": {
516
+ "pk_outcomes": {
517
+ "name": "pk_outcomes",
518
+ "columns": [
519
+ "ship_id",
520
+ "segment",
521
+ "day",
522
+ "metric"
523
+ ]
524
+ }
525
+ },
526
+ "uniqueConstraints": {},
527
+ "policies": {},
528
+ "checkConstraints": {},
529
+ "isRLSEnabled": false
530
+ },
531
+ "vireo.samples": {
532
+ "name": "samples",
533
+ "schema": "vireo",
534
+ "columns": {
535
+ "id": {
536
+ "name": "id",
537
+ "type": "serial",
538
+ "primaryKey": false,
539
+ "notNull": true
540
+ },
541
+ "batch_id": {
542
+ "name": "batch_id",
543
+ "type": "integer",
544
+ "primaryKey": false,
545
+ "notNull": true
546
+ },
547
+ "subject_id": {
548
+ "name": "subject_id",
549
+ "type": "integer",
550
+ "primaryKey": false,
551
+ "notNull": true
552
+ },
553
+ "position": {
554
+ "name": "position",
555
+ "type": "smallint",
556
+ "primaryKey": false,
557
+ "notNull": true,
558
+ "default": 0
559
+ },
560
+ "body": {
561
+ "name": "body",
562
+ "type": "text",
563
+ "primaryKey": false,
564
+ "notNull": false
565
+ },
566
+ "media": {
567
+ "name": "media",
568
+ "type": "text",
569
+ "primaryKey": false,
570
+ "notNull": false
571
+ },
572
+ "poster": {
573
+ "name": "poster",
574
+ "type": "text",
575
+ "primaryKey": false,
576
+ "notNull": false
577
+ },
578
+ "source": {
579
+ "name": "source",
580
+ "type": "jsonb",
581
+ "primaryKey": false,
582
+ "notNull": false
583
+ },
584
+ "name": {
585
+ "name": "name",
586
+ "type": "varchar(60)",
587
+ "primaryKey": false,
588
+ "notNull": false
589
+ },
590
+ "guides": {
591
+ "name": "guides",
592
+ "type": "integer[]",
593
+ "primaryKey": false,
594
+ "notNull": true,
595
+ "default": "'{}'::integer[]"
596
+ },
597
+ "change": {
598
+ "name": "change",
599
+ "type": "text",
600
+ "primaryKey": false,
601
+ "notNull": false
602
+ },
603
+ "agent": {
604
+ "name": "agent",
605
+ "type": "varchar(120)",
606
+ "primaryKey": false,
607
+ "notNull": false
608
+ },
609
+ "score": {
610
+ "name": "score",
611
+ "type": "smallint",
612
+ "primaryKey": false,
613
+ "notNull": false
614
+ },
615
+ "verdict": {
616
+ "name": "verdict",
617
+ "type": "varchar(8)",
618
+ "primaryKey": false,
619
+ "notNull": false
620
+ },
621
+ "kept_at": {
622
+ "name": "kept_at",
623
+ "type": "timestamp with time zone",
624
+ "primaryKey": false,
625
+ "notNull": false
626
+ },
627
+ "created_at": {
628
+ "name": "created_at",
629
+ "type": "timestamp with time zone",
630
+ "primaryKey": false,
631
+ "notNull": true,
632
+ "default": "now()"
633
+ }
634
+ },
635
+ "indexes": {
636
+ "ix_vireo_samples_batch": {
637
+ "name": "ix_vireo_samples_batch",
638
+ "columns": [
639
+ {
640
+ "expression": "batch_id",
641
+ "isExpression": false,
642
+ "asc": true,
643
+ "nulls": "last"
644
+ }
645
+ ],
646
+ "isUnique": false,
647
+ "concurrently": false,
648
+ "method": "btree",
649
+ "with": {}
650
+ },
651
+ "ix_vireo_samples_subject": {
652
+ "name": "ix_vireo_samples_subject",
653
+ "columns": [
654
+ {
655
+ "expression": "subject_id",
656
+ "isExpression": false,
657
+ "asc": true,
658
+ "nulls": "last"
659
+ }
660
+ ],
661
+ "isUnique": false,
662
+ "concurrently": false,
663
+ "method": "btree",
664
+ "with": {}
665
+ }
666
+ },
667
+ "foreignKeys": {
668
+ "fk_samples_batch_id_batches": {
669
+ "name": "fk_samples_batch_id_batches",
670
+ "tableFrom": "samples",
671
+ "tableTo": "batches",
672
+ "schemaTo": "vireo",
673
+ "columnsFrom": [
674
+ "batch_id"
675
+ ],
676
+ "columnsTo": [
677
+ "id"
678
+ ],
679
+ "onDelete": "cascade",
680
+ "onUpdate": "no action"
681
+ },
682
+ "fk_samples_subject_id_subjects": {
683
+ "name": "fk_samples_subject_id_subjects",
684
+ "tableFrom": "samples",
685
+ "tableTo": "subjects",
686
+ "schemaTo": "vireo",
687
+ "columnsFrom": [
688
+ "subject_id"
689
+ ],
690
+ "columnsTo": [
691
+ "id"
692
+ ],
693
+ "onDelete": "cascade",
694
+ "onUpdate": "no action"
695
+ }
696
+ },
697
+ "compositePrimaryKeys": {
698
+ "pk_samples": {
699
+ "name": "pk_samples",
700
+ "columns": [
701
+ "id"
702
+ ]
703
+ }
704
+ },
705
+ "uniqueConstraints": {},
706
+ "policies": {},
707
+ "checkConstraints": {
708
+ "ck_vireo_samples_verdict": {
709
+ "name": "ck_vireo_samples_verdict",
710
+ "value": "(\"verdict\")::text = ANY ((ARRAY['amazing'::character varying, 'good'::character varying, 'okay'::character varying, 'bad'::character varying])::text[])"
711
+ },
712
+ "ck_vireo_samples_score": {
713
+ "name": "ck_vireo_samples_score",
714
+ "value": "\"vireo\".\"samples\".\"score\" BETWEEN 1 AND 10"
715
+ },
716
+ "ck_vireo_samples_call": {
717
+ "name": "ck_vireo_samples_call",
718
+ "value": "\"vireo\".\"samples\".\"verdict\" IS NOT DISTINCT FROM (CASE WHEN \"vireo\".\"samples\".\"score\" >= 9 THEN 'amazing' WHEN \"vireo\".\"samples\".\"score\" >= 7 THEN 'good' WHEN \"vireo\".\"samples\".\"score\" >= 4 THEN 'okay' WHEN \"vireo\".\"samples\".\"score\" >= 1 THEN 'bad' END)"
719
+ }
720
+ },
721
+ "isRLSEnabled": false
722
+ },
723
+ "vireo.ships": {
724
+ "name": "ships",
725
+ "schema": "vireo",
726
+ "columns": {
727
+ "id": {
728
+ "name": "id",
729
+ "type": "serial",
730
+ "primaryKey": false,
731
+ "notNull": true
732
+ },
733
+ "sample_id": {
734
+ "name": "sample_id",
735
+ "type": "integer",
736
+ "primaryKey": false,
737
+ "notNull": true
738
+ },
739
+ "channel": {
740
+ "name": "channel",
741
+ "type": "varchar(32)",
742
+ "primaryKey": false,
743
+ "notNull": true
744
+ },
745
+ "target": {
746
+ "name": "target",
747
+ "type": "varchar(200)",
748
+ "primaryKey": false,
749
+ "notNull": true
750
+ },
751
+ "why": {
752
+ "name": "why",
753
+ "type": "text",
754
+ "primaryKey": false,
755
+ "notNull": false
756
+ },
757
+ "by": {
758
+ "name": "by",
759
+ "type": "varchar(320)",
760
+ "primaryKey": false,
761
+ "notNull": false
762
+ },
763
+ "started_at": {
764
+ "name": "started_at",
765
+ "type": "timestamp with time zone",
766
+ "primaryKey": false,
767
+ "notNull": true,
768
+ "default": "now()"
769
+ },
770
+ "ended_at": {
771
+ "name": "ended_at",
772
+ "type": "timestamp with time zone",
773
+ "primaryKey": false,
774
+ "notNull": false
775
+ }
776
+ },
777
+ "indexes": {
778
+ "ix_vireo_ships_sample": {
779
+ "name": "ix_vireo_ships_sample",
780
+ "columns": [
781
+ {
782
+ "expression": "sample_id",
783
+ "isExpression": false,
784
+ "asc": true,
785
+ "nulls": "last"
786
+ }
787
+ ],
788
+ "isUnique": false,
789
+ "concurrently": false,
790
+ "method": "btree",
791
+ "with": {}
792
+ }
793
+ },
794
+ "foreignKeys": {
795
+ "fk_ships_sample_id_samples": {
796
+ "name": "fk_ships_sample_id_samples",
797
+ "tableFrom": "ships",
798
+ "tableTo": "samples",
799
+ "schemaTo": "vireo",
800
+ "columnsFrom": [
801
+ "sample_id"
802
+ ],
803
+ "columnsTo": [
804
+ "id"
805
+ ],
806
+ "onDelete": "cascade",
807
+ "onUpdate": "no action"
808
+ }
809
+ },
810
+ "compositePrimaryKeys": {
811
+ "pk_ships": {
812
+ "name": "pk_ships",
813
+ "columns": [
814
+ "id"
815
+ ]
816
+ }
817
+ },
818
+ "uniqueConstraints": {
819
+ "uq_vireo_ships_target": {
820
+ "name": "uq_vireo_ships_target",
821
+ "nullsNotDistinct": false,
822
+ "columns": [
823
+ "channel",
824
+ "target",
825
+ "sample_id"
826
+ ]
827
+ }
828
+ },
829
+ "policies": {},
830
+ "checkConstraints": {},
831
+ "isRLSEnabled": false
832
+ },
833
+ "vireo.steers": {
834
+ "name": "steers",
835
+ "schema": "vireo",
836
+ "columns": {
837
+ "id": {
838
+ "name": "id",
839
+ "type": "serial",
840
+ "primaryKey": false,
841
+ "notNull": true
842
+ },
843
+ "subject_id": {
844
+ "name": "subject_id",
845
+ "type": "integer",
846
+ "primaryKey": false,
847
+ "notNull": true
848
+ },
849
+ "kind": {
850
+ "name": "kind",
851
+ "type": "varchar(8)",
852
+ "primaryKey": false,
853
+ "notNull": true
854
+ },
855
+ "sample_id": {
856
+ "name": "sample_id",
857
+ "type": "integer",
858
+ "primaryKey": false,
859
+ "notNull": false
860
+ },
861
+ "other_id": {
862
+ "name": "other_id",
863
+ "type": "integer",
864
+ "primaryKey": false,
865
+ "notNull": false
866
+ },
867
+ "width": {
868
+ "name": "width",
869
+ "type": "varchar(8)",
870
+ "primaryKey": false,
871
+ "notNull": false
872
+ },
873
+ "why": {
874
+ "name": "why",
875
+ "type": "text",
876
+ "primaryKey": false,
877
+ "notNull": false
878
+ },
879
+ "by": {
880
+ "name": "by",
881
+ "type": "varchar(320)",
882
+ "primaryKey": false,
883
+ "notNull": false
884
+ },
885
+ "created_at": {
886
+ "name": "created_at",
887
+ "type": "timestamp with time zone",
888
+ "primaryKey": false,
889
+ "notNull": true,
890
+ "default": "now()"
891
+ },
892
+ "ended_at": {
893
+ "name": "ended_at",
894
+ "type": "timestamp with time zone",
895
+ "primaryKey": false,
896
+ "notNull": false
897
+ },
898
+ "ended_by": {
899
+ "name": "ended_by",
900
+ "type": "integer",
901
+ "primaryKey": false,
902
+ "notNull": false
903
+ }
904
+ },
905
+ "indexes": {
906
+ "ix_vireo_steers_subject": {
907
+ "name": "ix_vireo_steers_subject",
908
+ "columns": [
909
+ {
910
+ "expression": "subject_id",
911
+ "isExpression": false,
912
+ "asc": true,
913
+ "nulls": "last"
914
+ },
915
+ {
916
+ "expression": "ended_at",
917
+ "isExpression": false,
918
+ "asc": true,
919
+ "nulls": "last"
920
+ }
921
+ ],
922
+ "isUnique": false,
923
+ "concurrently": false,
924
+ "method": "btree",
925
+ "with": {}
926
+ }
927
+ },
928
+ "foreignKeys": {
929
+ "fk_steers_subject_id_subjects": {
930
+ "name": "fk_steers_subject_id_subjects",
931
+ "tableFrom": "steers",
932
+ "tableTo": "subjects",
933
+ "schemaTo": "vireo",
934
+ "columnsFrom": [
935
+ "subject_id"
936
+ ],
937
+ "columnsTo": [
938
+ "id"
939
+ ],
940
+ "onDelete": "cascade",
941
+ "onUpdate": "no action"
942
+ },
943
+ "fk_steers_sample_id_samples": {
944
+ "name": "fk_steers_sample_id_samples",
945
+ "tableFrom": "steers",
946
+ "tableTo": "samples",
947
+ "schemaTo": "vireo",
948
+ "columnsFrom": [
949
+ "sample_id"
950
+ ],
951
+ "columnsTo": [
952
+ "id"
953
+ ],
954
+ "onDelete": "cascade",
955
+ "onUpdate": "no action"
956
+ },
957
+ "fk_steers_other_id_samples": {
958
+ "name": "fk_steers_other_id_samples",
959
+ "tableFrom": "steers",
960
+ "tableTo": "samples",
961
+ "schemaTo": "vireo",
962
+ "columnsFrom": [
963
+ "other_id"
964
+ ],
965
+ "columnsTo": [
966
+ "id"
967
+ ],
968
+ "onDelete": "cascade",
969
+ "onUpdate": "no action"
970
+ },
971
+ "fk_steers_ended_by_batches": {
972
+ "name": "fk_steers_ended_by_batches",
973
+ "tableFrom": "steers",
974
+ "tableTo": "batches",
975
+ "schemaTo": "vireo",
976
+ "columnsFrom": [
977
+ "ended_by"
978
+ ],
979
+ "columnsTo": [
980
+ "id"
981
+ ],
982
+ "onDelete": "set null",
983
+ "onUpdate": "no action"
984
+ }
985
+ },
986
+ "compositePrimaryKeys": {
987
+ "pk_steers": {
988
+ "name": "pk_steers",
989
+ "columns": [
990
+ "id"
991
+ ]
992
+ }
993
+ },
994
+ "uniqueConstraints": {},
995
+ "policies": {},
996
+ "checkConstraints": {
997
+ "ck_vireo_steers_kind": {
998
+ "name": "ck_vireo_steers_kind",
999
+ "value": "(\"kind\")::text = ANY ((ARRAY['pin'::character varying, 'prune'::character varying, 'cross'::character varying, 'width'::character varying])::text[])"
1000
+ },
1001
+ "ck_vireo_steers_width": {
1002
+ "name": "ck_vireo_steers_width",
1003
+ "value": "(\"width\")::text = ANY ((ARRAY['narrow'::character varying, 'normal'::character varying, 'wide'::character varying])::text[])"
1004
+ },
1005
+ "ck_vireo_steers_shape": {
1006
+ "name": "ck_vireo_steers_shape",
1007
+ "value": "CASE \"kind\"\n WHEN 'width' THEN \"width\" IS NOT NULL AND \"sample_id\" IS NULL AND \"other_id\" IS NULL\n WHEN 'cross' THEN \"width\" IS NULL AND \"sample_id\" IS NOT NULL AND \"other_id\" IS NOT NULL AND \"sample_id\" <> \"other_id\"\n ELSE \"width\" IS NULL AND \"sample_id\" IS NOT NULL AND \"other_id\" IS NULL END"
1008
+ }
1009
+ },
1010
+ "isRLSEnabled": false
1011
+ },
1012
+ "vireo.subjects": {
1013
+ "name": "subjects",
1014
+ "schema": "vireo",
1015
+ "columns": {
1016
+ "id": {
1017
+ "name": "id",
1018
+ "type": "serial",
1019
+ "primaryKey": false,
1020
+ "notNull": true
1021
+ },
1022
+ "slug": {
1023
+ "name": "slug",
1024
+ "type": "varchar(60)",
1025
+ "primaryKey": false,
1026
+ "notNull": true
1027
+ },
1028
+ "name": {
1029
+ "name": "name",
1030
+ "type": "text",
1031
+ "primaryKey": false,
1032
+ "notNull": true
1033
+ },
1034
+ "kind": {
1035
+ "name": "kind",
1036
+ "type": "varchar(8)",
1037
+ "primaryKey": false,
1038
+ "notNull": true
1039
+ },
1040
+ "brief": {
1041
+ "name": "brief",
1042
+ "type": "text",
1043
+ "primaryKey": false,
1044
+ "notNull": false
1045
+ },
1046
+ "seeds": {
1047
+ "name": "seeds",
1048
+ "type": "jsonb",
1049
+ "primaryKey": false,
1050
+ "notNull": true,
1051
+ "default": "'[]'::jsonb"
1052
+ },
1053
+ "state": {
1054
+ "name": "state",
1055
+ "type": "varchar(8)",
1056
+ "primaryKey": false,
1057
+ "notNull": true,
1058
+ "default": "'open'"
1059
+ },
1060
+ "by": {
1061
+ "name": "by",
1062
+ "type": "varchar(320)",
1063
+ "primaryKey": false,
1064
+ "notNull": false
1065
+ },
1066
+ "created_at": {
1067
+ "name": "created_at",
1068
+ "type": "timestamp with time zone",
1069
+ "primaryKey": false,
1070
+ "notNull": true,
1071
+ "default": "now()"
1072
+ }
1073
+ },
1074
+ "indexes": {},
1075
+ "foreignKeys": {},
1076
+ "compositePrimaryKeys": {
1077
+ "pk_subjects": {
1078
+ "name": "pk_subjects",
1079
+ "columns": [
1080
+ "id"
1081
+ ]
1082
+ }
1083
+ },
1084
+ "uniqueConstraints": {
1085
+ "uq_vireo_subjects_slug": {
1086
+ "name": "uq_vireo_subjects_slug",
1087
+ "nullsNotDistinct": false,
1088
+ "columns": [
1089
+ "slug"
1090
+ ]
1091
+ }
1092
+ },
1093
+ "policies": {},
1094
+ "checkConstraints": {
1095
+ "ck_vireo_subjects_kind": {
1096
+ "name": "ck_vireo_subjects_kind",
1097
+ "value": "(\"kind\")::text = ANY ((ARRAY['text'::character varying, 'image'::character varying, 'video'::character varying, 'page'::character varying])::text[])"
1098
+ },
1099
+ "ck_vireo_subjects_state": {
1100
+ "name": "ck_vireo_subjects_state",
1101
+ "value": "(\"state\")::text = ANY ((ARRAY['open'::character varying, 'paused'::character varying, 'done'::character varying])::text[])"
1102
+ }
1103
+ },
1104
+ "isRLSEnabled": false
1105
+ }
1106
+ },
1107
+ "enums": {},
1108
+ "schemas": {
1109
+ "vireo": "vireo"
1110
+ },
1111
+ "sequences": {},
1112
+ "roles": {},
1113
+ "policies": {},
1114
+ "views": {},
1115
+ "_meta": {
1116
+ "columns": {},
1117
+ "schemas": {},
1118
+ "tables": {}
1119
+ }
1120
+ }