@adatechnology/content-module 0.2.2 → 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.
@@ -0,0 +1,813 @@
1
+ {
2
+ "id": "16e6bc4d-ea3f-45aa-b5f1-519bc592b1cd",
3
+ "prevId": "991a2a50-c91b-493f-90ec-d697ef880107",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "content.community_images": {
8
+ "name": "community_images",
9
+ "schema": "content",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "company_id": {
19
+ "name": "company_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "account_id": {
25
+ "name": "account_id",
26
+ "type": "varchar(64)",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "storage_key": {
31
+ "name": "storage_key",
32
+ "type": "varchar(512)",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "url": {
37
+ "name": "url",
38
+ "type": "varchar(2048)",
39
+ "primaryKey": false,
40
+ "notNull": true
41
+ },
42
+ "created_at": {
43
+ "name": "created_at",
44
+ "type": "timestamp with time zone",
45
+ "primaryKey": false,
46
+ "notNull": true,
47
+ "default": "now()"
48
+ }
49
+ },
50
+ "indexes": {
51
+ "idx_community_images_company_url": {
52
+ "name": "idx_community_images_company_url",
53
+ "columns": [
54
+ {
55
+ "expression": "company_id",
56
+ "isExpression": false,
57
+ "asc": true,
58
+ "nulls": "last"
59
+ },
60
+ {
61
+ "expression": "url",
62
+ "isExpression": false,
63
+ "asc": true,
64
+ "nulls": "last"
65
+ }
66
+ ],
67
+ "isUnique": true,
68
+ "concurrently": false,
69
+ "method": "btree",
70
+ "with": {}
71
+ },
72
+ "idx_community_images_account": {
73
+ "name": "idx_community_images_account",
74
+ "columns": [
75
+ {
76
+ "expression": "company_id",
77
+ "isExpression": false,
78
+ "asc": true,
79
+ "nulls": "last"
80
+ },
81
+ {
82
+ "expression": "account_id",
83
+ "isExpression": false,
84
+ "asc": true,
85
+ "nulls": "last"
86
+ },
87
+ {
88
+ "expression": "created_at",
89
+ "isExpression": false,
90
+ "asc": true,
91
+ "nulls": "last"
92
+ }
93
+ ],
94
+ "isUnique": false,
95
+ "concurrently": false,
96
+ "method": "btree",
97
+ "with": {}
98
+ }
99
+ },
100
+ "foreignKeys": {},
101
+ "compositePrimaryKeys": {},
102
+ "uniqueConstraints": {},
103
+ "policies": {},
104
+ "checkConstraints": {},
105
+ "isRLSEnabled": false
106
+ },
107
+ "content.content_settings": {
108
+ "name": "content_settings",
109
+ "schema": "content",
110
+ "columns": {
111
+ "company_id": {
112
+ "name": "company_id",
113
+ "type": "uuid",
114
+ "primaryKey": true,
115
+ "notNull": true
116
+ },
117
+ "community_moderation": {
118
+ "name": "community_moderation",
119
+ "type": "varchar(8)",
120
+ "primaryKey": false,
121
+ "notNull": true,
122
+ "default": "'before'"
123
+ },
124
+ "community_daily_limit": {
125
+ "name": "community_daily_limit",
126
+ "type": "integer",
127
+ "primaryKey": false,
128
+ "notNull": true,
129
+ "default": 3
130
+ },
131
+ "max_images_per_post": {
132
+ "name": "max_images_per_post",
133
+ "type": "integer",
134
+ "primaryKey": false,
135
+ "notNull": true,
136
+ "default": 12
137
+ },
138
+ "updated_at": {
139
+ "name": "updated_at",
140
+ "type": "timestamp with time zone",
141
+ "primaryKey": false,
142
+ "notNull": true,
143
+ "default": "now()"
144
+ }
145
+ },
146
+ "indexes": {},
147
+ "foreignKeys": {},
148
+ "compositePrimaryKeys": {},
149
+ "uniqueConstraints": {},
150
+ "policies": {},
151
+ "checkConstraints": {},
152
+ "isRLSEnabled": false
153
+ },
154
+ "content.post_former_slugs": {
155
+ "name": "post_former_slugs",
156
+ "schema": "content",
157
+ "columns": {
158
+ "company_id": {
159
+ "name": "company_id",
160
+ "type": "uuid",
161
+ "primaryKey": false,
162
+ "notNull": true
163
+ },
164
+ "slug": {
165
+ "name": "slug",
166
+ "type": "varchar(120)",
167
+ "primaryKey": false,
168
+ "notNull": true
169
+ },
170
+ "post_id": {
171
+ "name": "post_id",
172
+ "type": "uuid",
173
+ "primaryKey": false,
174
+ "notNull": true
175
+ },
176
+ "created_at": {
177
+ "name": "created_at",
178
+ "type": "timestamp with time zone",
179
+ "primaryKey": false,
180
+ "notNull": true,
181
+ "default": "now()"
182
+ }
183
+ },
184
+ "indexes": {},
185
+ "foreignKeys": {
186
+ "post_former_slugs_post_id_posts_id_fk": {
187
+ "name": "post_former_slugs_post_id_posts_id_fk",
188
+ "tableFrom": "post_former_slugs",
189
+ "tableTo": "posts",
190
+ "schemaTo": "content",
191
+ "columnsFrom": ["post_id"],
192
+ "columnsTo": ["id"],
193
+ "onDelete": "no action",
194
+ "onUpdate": "no action"
195
+ }
196
+ },
197
+ "compositePrimaryKeys": {
198
+ "post_former_slugs_company_id_slug_pk": {
199
+ "name": "post_former_slugs_company_id_slug_pk",
200
+ "columns": ["company_id", "slug"]
201
+ }
202
+ },
203
+ "uniqueConstraints": {},
204
+ "policies": {},
205
+ "checkConstraints": {},
206
+ "isRLSEnabled": false
207
+ },
208
+ "content.post_reports": {
209
+ "name": "post_reports",
210
+ "schema": "content",
211
+ "columns": {
212
+ "id": {
213
+ "name": "id",
214
+ "type": "uuid",
215
+ "primaryKey": true,
216
+ "notNull": true,
217
+ "default": "gen_random_uuid()"
218
+ },
219
+ "company_id": {
220
+ "name": "company_id",
221
+ "type": "uuid",
222
+ "primaryKey": false,
223
+ "notNull": true
224
+ },
225
+ "post_id": {
226
+ "name": "post_id",
227
+ "type": "uuid",
228
+ "primaryKey": false,
229
+ "notNull": true
230
+ },
231
+ "reason": {
232
+ "name": "reason",
233
+ "type": "varchar(300)",
234
+ "primaryKey": false,
235
+ "notNull": true
236
+ },
237
+ "created_at": {
238
+ "name": "created_at",
239
+ "type": "timestamp with time zone",
240
+ "primaryKey": false,
241
+ "notNull": true,
242
+ "default": "now()"
243
+ },
244
+ "resolved_at": {
245
+ "name": "resolved_at",
246
+ "type": "timestamp with time zone",
247
+ "primaryKey": false,
248
+ "notNull": false
249
+ },
250
+ "resolved_by": {
251
+ "name": "resolved_by",
252
+ "type": "varchar(64)",
253
+ "primaryKey": false,
254
+ "notNull": false
255
+ }
256
+ },
257
+ "indexes": {
258
+ "idx_post_reports_open": {
259
+ "name": "idx_post_reports_open",
260
+ "columns": [
261
+ {
262
+ "expression": "company_id",
263
+ "isExpression": false,
264
+ "asc": true,
265
+ "nulls": "last"
266
+ },
267
+ {
268
+ "expression": "created_at",
269
+ "isExpression": false,
270
+ "asc": true,
271
+ "nulls": "last"
272
+ }
273
+ ],
274
+ "isUnique": false,
275
+ "where": "\"resolved_at\" IS NULL",
276
+ "concurrently": false,
277
+ "method": "btree",
278
+ "with": {}
279
+ }
280
+ },
281
+ "foreignKeys": {
282
+ "post_reports_post_id_posts_id_fk": {
283
+ "name": "post_reports_post_id_posts_id_fk",
284
+ "tableFrom": "post_reports",
285
+ "tableTo": "posts",
286
+ "schemaTo": "content",
287
+ "columnsFrom": ["post_id"],
288
+ "columnsTo": ["id"],
289
+ "onDelete": "no action",
290
+ "onUpdate": "no action"
291
+ }
292
+ },
293
+ "compositePrimaryKeys": {},
294
+ "uniqueConstraints": {},
295
+ "policies": {},
296
+ "checkConstraints": {},
297
+ "isRLSEnabled": false
298
+ },
299
+ "content.posts": {
300
+ "name": "posts",
301
+ "schema": "content",
302
+ "columns": {
303
+ "id": {
304
+ "name": "id",
305
+ "type": "uuid",
306
+ "primaryKey": true,
307
+ "notNull": true,
308
+ "default": "gen_random_uuid()"
309
+ },
310
+ "company_id": {
311
+ "name": "company_id",
312
+ "type": "uuid",
313
+ "primaryKey": false,
314
+ "notNull": true
315
+ },
316
+ "slug": {
317
+ "name": "slug",
318
+ "type": "varchar(120)",
319
+ "primaryKey": false,
320
+ "notNull": true
321
+ },
322
+ "short_id": {
323
+ "name": "short_id",
324
+ "type": "varchar(6)",
325
+ "primaryKey": false,
326
+ "notNull": true
327
+ },
328
+ "title": {
329
+ "name": "title",
330
+ "type": "varchar(200)",
331
+ "primaryKey": false,
332
+ "notNull": true
333
+ },
334
+ "excerpt": {
335
+ "name": "excerpt",
336
+ "type": "varchar(500)",
337
+ "primaryKey": false,
338
+ "notNull": false
339
+ },
340
+ "body": {
341
+ "name": "body",
342
+ "type": "text",
343
+ "primaryKey": false,
344
+ "notNull": true,
345
+ "default": "''"
346
+ },
347
+ "cover_image_url": {
348
+ "name": "cover_image_url",
349
+ "type": "varchar(2048)",
350
+ "primaryKey": false,
351
+ "notNull": false
352
+ },
353
+ "cover_image_alt": {
354
+ "name": "cover_image_alt",
355
+ "type": "varchar(300)",
356
+ "primaryKey": false,
357
+ "notNull": false
358
+ },
359
+ "tags": {
360
+ "name": "tags",
361
+ "type": "text[]",
362
+ "primaryKey": false,
363
+ "notNull": true,
364
+ "default": "'{}'"
365
+ },
366
+ "tag_labels": {
367
+ "name": "tag_labels",
368
+ "type": "jsonb",
369
+ "primaryKey": false,
370
+ "notNull": true,
371
+ "default": "'{}'::jsonb"
372
+ },
373
+ "status": {
374
+ "name": "status",
375
+ "type": "varchar(16)",
376
+ "primaryKey": false,
377
+ "notNull": true,
378
+ "default": "'draft'"
379
+ },
380
+ "is_template": {
381
+ "name": "is_template",
382
+ "type": "boolean",
383
+ "primaryKey": false,
384
+ "notNull": true,
385
+ "default": false
386
+ },
387
+ "published_at": {
388
+ "name": "published_at",
389
+ "type": "timestamp with time zone",
390
+ "primaryKey": false,
391
+ "notNull": false
392
+ },
393
+ "author_name": {
394
+ "name": "author_name",
395
+ "type": "varchar(120)",
396
+ "primaryKey": false,
397
+ "notNull": false
398
+ },
399
+ "seo_title": {
400
+ "name": "seo_title",
401
+ "type": "varchar(200)",
402
+ "primaryKey": false,
403
+ "notNull": false
404
+ },
405
+ "seo_description": {
406
+ "name": "seo_description",
407
+ "type": "varchar(320)",
408
+ "primaryKey": false,
409
+ "notNull": false
410
+ },
411
+ "canonical_url": {
412
+ "name": "canonical_url",
413
+ "type": "varchar(2048)",
414
+ "primaryKey": false,
415
+ "notNull": false
416
+ },
417
+ "reading_time_minutes": {
418
+ "name": "reading_time_minutes",
419
+ "type": "integer",
420
+ "primaryKey": false,
421
+ "notNull": true,
422
+ "default": 1
423
+ },
424
+ "created_at": {
425
+ "name": "created_at",
426
+ "type": "timestamp with time zone",
427
+ "primaryKey": false,
428
+ "notNull": true,
429
+ "default": "now()"
430
+ },
431
+ "updated_at": {
432
+ "name": "updated_at",
433
+ "type": "timestamp with time zone",
434
+ "primaryKey": false,
435
+ "notNull": true,
436
+ "default": "now()"
437
+ },
438
+ "origin": {
439
+ "name": "origin",
440
+ "type": "varchar(12)",
441
+ "primaryKey": false,
442
+ "notNull": true,
443
+ "default": "'staff'"
444
+ },
445
+ "author_account_id": {
446
+ "name": "author_account_id",
447
+ "type": "varchar(64)",
448
+ "primaryKey": false,
449
+ "notNull": false
450
+ },
451
+ "author_display_name": {
452
+ "name": "author_display_name",
453
+ "type": "varchar(80)",
454
+ "primaryKey": false,
455
+ "notNull": false
456
+ },
457
+ "author_reference_month": {
458
+ "name": "author_reference_month",
459
+ "type": "varchar(7)",
460
+ "primaryKey": false,
461
+ "notNull": false
462
+ },
463
+ "review_note": {
464
+ "name": "review_note",
465
+ "type": "varchar(500)",
466
+ "primaryKey": false,
467
+ "notNull": false
468
+ },
469
+ "terms_accepted_at": {
470
+ "name": "terms_accepted_at",
471
+ "type": "timestamp with time zone",
472
+ "primaryKey": false,
473
+ "notNull": false
474
+ },
475
+ "submitted_at": {
476
+ "name": "submitted_at",
477
+ "type": "timestamp with time zone",
478
+ "primaryKey": false,
479
+ "notNull": false
480
+ },
481
+ "pending_revision": {
482
+ "name": "pending_revision",
483
+ "type": "jsonb",
484
+ "primaryKey": false,
485
+ "notNull": false
486
+ }
487
+ },
488
+ "indexes": {
489
+ "idx_posts_company_slug": {
490
+ "name": "idx_posts_company_slug",
491
+ "columns": [
492
+ {
493
+ "expression": "company_id",
494
+ "isExpression": false,
495
+ "asc": true,
496
+ "nulls": "last"
497
+ },
498
+ {
499
+ "expression": "slug",
500
+ "isExpression": false,
501
+ "asc": true,
502
+ "nulls": "last"
503
+ }
504
+ ],
505
+ "isUnique": true,
506
+ "concurrently": false,
507
+ "method": "btree",
508
+ "with": {}
509
+ },
510
+ "idx_posts_company_short_id": {
511
+ "name": "idx_posts_company_short_id",
512
+ "columns": [
513
+ {
514
+ "expression": "company_id",
515
+ "isExpression": false,
516
+ "asc": true,
517
+ "nulls": "last"
518
+ },
519
+ {
520
+ "expression": "short_id",
521
+ "isExpression": false,
522
+ "asc": true,
523
+ "nulls": "last"
524
+ }
525
+ ],
526
+ "isUnique": true,
527
+ "concurrently": false,
528
+ "method": "btree",
529
+ "with": {}
530
+ },
531
+ "idx_posts_company_status_published": {
532
+ "name": "idx_posts_company_status_published",
533
+ "columns": [
534
+ {
535
+ "expression": "company_id",
536
+ "isExpression": false,
537
+ "asc": true,
538
+ "nulls": "last"
539
+ },
540
+ {
541
+ "expression": "status",
542
+ "isExpression": false,
543
+ "asc": true,
544
+ "nulls": "last"
545
+ },
546
+ {
547
+ "expression": "published_at",
548
+ "isExpression": false,
549
+ "asc": true,
550
+ "nulls": "last"
551
+ }
552
+ ],
553
+ "isUnique": false,
554
+ "concurrently": false,
555
+ "method": "btree",
556
+ "with": {}
557
+ },
558
+ "idx_posts_company_origin_status_published": {
559
+ "name": "idx_posts_company_origin_status_published",
560
+ "columns": [
561
+ {
562
+ "expression": "company_id",
563
+ "isExpression": false,
564
+ "asc": true,
565
+ "nulls": "last"
566
+ },
567
+ {
568
+ "expression": "origin",
569
+ "isExpression": false,
570
+ "asc": true,
571
+ "nulls": "last"
572
+ },
573
+ {
574
+ "expression": "status",
575
+ "isExpression": false,
576
+ "asc": true,
577
+ "nulls": "last"
578
+ },
579
+ {
580
+ "expression": "published_at",
581
+ "isExpression": false,
582
+ "asc": true,
583
+ "nulls": "last"
584
+ }
585
+ ],
586
+ "isUnique": false,
587
+ "concurrently": false,
588
+ "method": "btree",
589
+ "with": {}
590
+ },
591
+ "idx_posts_community_author_created": {
592
+ "name": "idx_posts_community_author_created",
593
+ "columns": [
594
+ {
595
+ "expression": "company_id",
596
+ "isExpression": false,
597
+ "asc": true,
598
+ "nulls": "last"
599
+ },
600
+ {
601
+ "expression": "author_account_id",
602
+ "isExpression": false,
603
+ "asc": true,
604
+ "nulls": "last"
605
+ },
606
+ {
607
+ "expression": "created_at",
608
+ "isExpression": false,
609
+ "asc": true,
610
+ "nulls": "last"
611
+ }
612
+ ],
613
+ "isUnique": false,
614
+ "where": "\"origin\" = 'community'",
615
+ "concurrently": false,
616
+ "method": "btree",
617
+ "with": {}
618
+ },
619
+ "idx_posts_moderation_queue": {
620
+ "name": "idx_posts_moderation_queue",
621
+ "columns": [
622
+ {
623
+ "expression": "company_id",
624
+ "isExpression": false,
625
+ "asc": true,
626
+ "nulls": "last"
627
+ },
628
+ {
629
+ "expression": "submitted_at",
630
+ "isExpression": false,
631
+ "asc": true,
632
+ "nulls": "last"
633
+ }
634
+ ],
635
+ "isUnique": false,
636
+ "where": "\"status\" = 'pending_review' OR \"pending_revision\" IS NOT NULL",
637
+ "concurrently": false,
638
+ "method": "btree",
639
+ "with": {}
640
+ },
641
+ "idx_posts_tags": {
642
+ "name": "idx_posts_tags",
643
+ "columns": [
644
+ {
645
+ "expression": "tags",
646
+ "isExpression": false,
647
+ "asc": true,
648
+ "nulls": "last"
649
+ }
650
+ ],
651
+ "isUnique": false,
652
+ "concurrently": false,
653
+ "method": "gin",
654
+ "with": {}
655
+ },
656
+ "idx_posts_due": {
657
+ "name": "idx_posts_due",
658
+ "columns": [
659
+ {
660
+ "expression": "published_at",
661
+ "isExpression": false,
662
+ "asc": true,
663
+ "nulls": "last"
664
+ }
665
+ ],
666
+ "isUnique": false,
667
+ "where": "\"status\" = 'scheduled'",
668
+ "concurrently": false,
669
+ "method": "btree",
670
+ "with": {}
671
+ }
672
+ },
673
+ "foreignKeys": {},
674
+ "compositePrimaryKeys": {},
675
+ "uniqueConstraints": {},
676
+ "policies": {},
677
+ "checkConstraints": {},
678
+ "isRLSEnabled": false
679
+ },
680
+ "content.recurrence_rules": {
681
+ "name": "recurrence_rules",
682
+ "schema": "content",
683
+ "columns": {
684
+ "id": {
685
+ "name": "id",
686
+ "type": "uuid",
687
+ "primaryKey": true,
688
+ "notNull": true,
689
+ "default": "gen_random_uuid()"
690
+ },
691
+ "company_id": {
692
+ "name": "company_id",
693
+ "type": "uuid",
694
+ "primaryKey": false,
695
+ "notNull": true
696
+ },
697
+ "template_id": {
698
+ "name": "template_id",
699
+ "type": "uuid",
700
+ "primaryKey": false,
701
+ "notNull": true
702
+ },
703
+ "frequency": {
704
+ "name": "frequency",
705
+ "type": "varchar(10)",
706
+ "primaryKey": false,
707
+ "notNull": true
708
+ },
709
+ "anchor_day": {
710
+ "name": "anchor_day",
711
+ "type": "integer",
712
+ "primaryKey": false,
713
+ "notNull": true
714
+ },
715
+ "is_active": {
716
+ "name": "is_active",
717
+ "type": "boolean",
718
+ "primaryKey": false,
719
+ "notNull": true,
720
+ "default": true
721
+ },
722
+ "next_run_at": {
723
+ "name": "next_run_at",
724
+ "type": "timestamp with time zone",
725
+ "primaryKey": false,
726
+ "notNull": true
727
+ },
728
+ "last_run_at": {
729
+ "name": "last_run_at",
730
+ "type": "timestamp with time zone",
731
+ "primaryKey": false,
732
+ "notNull": false
733
+ },
734
+ "last_post_id": {
735
+ "name": "last_post_id",
736
+ "type": "uuid",
737
+ "primaryKey": false,
738
+ "notNull": false
739
+ },
740
+ "created_at": {
741
+ "name": "created_at",
742
+ "type": "timestamp with time zone",
743
+ "primaryKey": false,
744
+ "notNull": true,
745
+ "default": "now()"
746
+ }
747
+ },
748
+ "indexes": {
749
+ "idx_recurrence_company": {
750
+ "name": "idx_recurrence_company",
751
+ "columns": [
752
+ {
753
+ "expression": "company_id",
754
+ "isExpression": false,
755
+ "asc": true,
756
+ "nulls": "last"
757
+ }
758
+ ],
759
+ "isUnique": false,
760
+ "concurrently": false,
761
+ "method": "btree",
762
+ "with": {}
763
+ },
764
+ "idx_recurrence_due": {
765
+ "name": "idx_recurrence_due",
766
+ "columns": [
767
+ {
768
+ "expression": "next_run_at",
769
+ "isExpression": false,
770
+ "asc": true,
771
+ "nulls": "last"
772
+ }
773
+ ],
774
+ "isUnique": false,
775
+ "where": "\"is_active\"",
776
+ "concurrently": false,
777
+ "method": "btree",
778
+ "with": {}
779
+ }
780
+ },
781
+ "foreignKeys": {
782
+ "recurrence_rules_template_id_posts_id_fk": {
783
+ "name": "recurrence_rules_template_id_posts_id_fk",
784
+ "tableFrom": "recurrence_rules",
785
+ "tableTo": "posts",
786
+ "schemaTo": "content",
787
+ "columnsFrom": ["template_id"],
788
+ "columnsTo": ["id"],
789
+ "onDelete": "no action",
790
+ "onUpdate": "no action"
791
+ }
792
+ },
793
+ "compositePrimaryKeys": {},
794
+ "uniqueConstraints": {},
795
+ "policies": {},
796
+ "checkConstraints": {},
797
+ "isRLSEnabled": false
798
+ }
799
+ },
800
+ "enums": {},
801
+ "schemas": {
802
+ "content": "content"
803
+ },
804
+ "sequences": {},
805
+ "roles": {},
806
+ "policies": {},
807
+ "views": {},
808
+ "_meta": {
809
+ "columns": {},
810
+ "schemas": {},
811
+ "tables": {}
812
+ }
813
+ }