@happyvertical/smrt-content 0.49.2 → 0.49.4

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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-content",
5
- "packageVersion": "0.49.2",
5
+ "packageVersion": "0.49.4",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-content:ContentAsset": {
8
8
  "name": "contentasset",
@@ -327,7 +327,7 @@
327
327
  "collectionExportName": "ContentAssetCollectionCollection",
328
328
  "schema": {
329
329
  "tableName": "content_assets",
330
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
330
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"content_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
331
331
  "columns": {
332
332
  "id": {
333
333
  "type": "UUID",
@@ -353,25 +353,75 @@
353
353
  "type": "TIMESTAMP",
354
354
  "notNull": true,
355
355
  "default": "current_timestamp"
356
+ },
357
+ "tenant_id": {
358
+ "type": "UUID",
359
+ "referenceKind": "tenantId",
360
+ "notNull": false,
361
+ "unique": false
362
+ },
363
+ "content_id": {
364
+ "type": "UUID",
365
+ "referenceKind": "foreignKey",
366
+ "notNull": true,
367
+ "unique": false,
368
+ "foreignKey": {
369
+ "table": "contents",
370
+ "column": "id",
371
+ "onDelete": "CASCADE",
372
+ "onUpdate": "CASCADE"
373
+ }
374
+ },
375
+ "asset_id": {
376
+ "type": "UUID",
377
+ "referenceKind": "crossPackageRef",
378
+ "notNull": true,
379
+ "unique": false
380
+ },
381
+ "relationship": {
382
+ "type": "TEXT",
383
+ "notNull": true,
384
+ "unique": false
385
+ },
386
+ "sort_order": {
387
+ "type": "INTEGER",
388
+ "notNull": true,
389
+ "unique": false,
390
+ "default": 0
356
391
  }
357
392
  },
358
393
  "indexes": [
394
+ {
395
+ "name": "content_assets_content_id_asset_id_idx",
396
+ "columns": [
397
+ "content_id",
398
+ "asset_id",
399
+ "relationship"
400
+ ],
401
+ "unique": true
402
+ },
359
403
  {
360
404
  "name": "content_assets_slug_context_idx",
361
405
  "columns": [
362
406
  "slug",
363
407
  "context"
364
- ],
365
- "unique": true
408
+ ]
366
409
  },
367
410
  {
368
- "name": "content_assets_created_at_idx",
411
+ "name": "content_assets_tenant_id_created_at_idx",
369
412
  "columns": [
413
+ "tenant_id",
370
414
  "created_at"
371
415
  ]
416
+ },
417
+ {
418
+ "name": "content_assets_asset_id_idx",
419
+ "columns": [
420
+ "asset_id"
421
+ ]
372
422
  }
373
423
  ],
374
- "version": "35bf42e8"
424
+ "version": "472d718d"
375
425
  }
376
426
  },
377
427
  "@happyvertical/smrt-content:ContentContributionAttachment": {
@@ -699,7 +749,7 @@
699
749
  "collectionExportName": "ContentContributionAttachmentCollectionCollection",
700
750
  "schema": {
701
751
  "tableName": "content_contribution_attachments",
702
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_contribution_attachments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
752
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_contribution_attachments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"contribution_id\" UUID NOT NULL,\n \"revision_id\" UUID,\n \"filename\" TEXT,\n \"mime_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"file_key\" TEXT,\n \"source_uri\" TEXT,\n \"channel\" TEXT DEFAULT 'web',\n \"promoted_asset_id\" UUID,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
703
753
  "columns": {
704
754
  "id": {
705
755
  "type": "UUID",
@@ -725,6 +775,79 @@
725
775
  "type": "TIMESTAMP",
726
776
  "notNull": true,
727
777
  "default": "current_timestamp"
778
+ },
779
+ "contribution_id": {
780
+ "type": "UUID",
781
+ "referenceKind": "foreignKey",
782
+ "notNull": true,
783
+ "unique": false,
784
+ "foreignKey": {
785
+ "table": "content_contributions",
786
+ "column": "id",
787
+ "onDelete": "NO ACTION",
788
+ "onUpdate": "CASCADE"
789
+ }
790
+ },
791
+ "revision_id": {
792
+ "type": "UUID",
793
+ "referenceKind": "foreignKey",
794
+ "notNull": false,
795
+ "unique": false,
796
+ "foreignKey": {
797
+ "table": "content_contribution_revisions",
798
+ "column": "id",
799
+ "onDelete": "NO ACTION",
800
+ "onUpdate": "CASCADE"
801
+ }
802
+ },
803
+ "filename": {
804
+ "type": "TEXT",
805
+ "notNull": false,
806
+ "unique": false
807
+ },
808
+ "mime_type": {
809
+ "type": "TEXT",
810
+ "notNull": false,
811
+ "unique": false
812
+ },
813
+ "size": {
814
+ "type": "INTEGER",
815
+ "notNull": true,
816
+ "unique": false,
817
+ "default": 0
818
+ },
819
+ "file_key": {
820
+ "type": "TEXT",
821
+ "notNull": false,
822
+ "unique": false
823
+ },
824
+ "source_uri": {
825
+ "type": "TEXT",
826
+ "notNull": false,
827
+ "unique": false
828
+ },
829
+ "channel": {
830
+ "type": "TEXT",
831
+ "notNull": false,
832
+ "unique": false,
833
+ "default": "web"
834
+ },
835
+ "promoted_asset_id": {
836
+ "type": "UUID",
837
+ "referenceKind": "crossPackageRef",
838
+ "notNull": false,
839
+ "unique": false
840
+ },
841
+ "metadata": {
842
+ "type": "TEXT",
843
+ "notNull": false,
844
+ "unique": false
845
+ },
846
+ "tenant_id": {
847
+ "type": "UUID",
848
+ "referenceKind": "tenantId",
849
+ "notNull": false,
850
+ "unique": false
728
851
  }
729
852
  },
730
853
  "indexes": [
@@ -733,17 +856,35 @@
733
856
  "columns": [
734
857
  "slug",
735
858
  "context"
736
- ],
737
- "unique": true
859
+ ]
738
860
  },
739
861
  {
740
- "name": "content_contribution_attachments_created_at_idx",
862
+ "name": "content_contribution_attachments_tenant_id_created_at_idx",
741
863
  "columns": [
864
+ "tenant_id",
742
865
  "created_at"
743
866
  ]
867
+ },
868
+ {
869
+ "name": "content_contribution_attachments_contribution_id_idx",
870
+ "columns": [
871
+ "contribution_id"
872
+ ]
873
+ },
874
+ {
875
+ "name": "content_contribution_attachments_revision_id_idx",
876
+ "columns": [
877
+ "revision_id"
878
+ ]
879
+ },
880
+ {
881
+ "name": "content_contribution_attachments_promoted_asset_id_idx",
882
+ "columns": [
883
+ "promoted_asset_id"
884
+ ]
744
885
  }
745
886
  ],
746
- "version": "d0c8b33f"
887
+ "version": "83e64a1b"
747
888
  }
748
889
  },
749
890
  "@happyvertical/smrt-content:ContentContributionRevision": {
@@ -1051,7 +1192,7 @@
1051
1192
  "collectionExportName": "ContentContributionRevisionCollectionCollection",
1052
1193
  "schema": {
1053
1194
  "tableName": "content_contribution_revisions",
1054
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_contribution_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
1195
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_contribution_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"contribution_id\" UUID NOT NULL,\n \"revision_number\" INTEGER NOT NULL DEFAULT 1,\n \"channel\" TEXT DEFAULT 'web',\n \"title\" TEXT,\n \"description\" TEXT,\n \"body\" TEXT,\n \"source_message_id\" UUID,\n \"source_thread_key\" TEXT,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
1055
1196
  "columns": {
1056
1197
  "id": {
1057
1198
  "type": "UUID",
@@ -1077,25 +1218,100 @@
1077
1218
  "type": "TIMESTAMP",
1078
1219
  "notNull": true,
1079
1220
  "default": "current_timestamp"
1221
+ },
1222
+ "contribution_id": {
1223
+ "type": "UUID",
1224
+ "referenceKind": "foreignKey",
1225
+ "notNull": true,
1226
+ "unique": false,
1227
+ "foreignKey": {
1228
+ "table": "content_contributions",
1229
+ "column": "id",
1230
+ "onDelete": "CASCADE",
1231
+ "onUpdate": "CASCADE"
1232
+ }
1233
+ },
1234
+ "revision_number": {
1235
+ "type": "INTEGER",
1236
+ "notNull": true,
1237
+ "unique": false,
1238
+ "default": 1
1239
+ },
1240
+ "channel": {
1241
+ "type": "TEXT",
1242
+ "notNull": false,
1243
+ "unique": false,
1244
+ "default": "web"
1245
+ },
1246
+ "title": {
1247
+ "type": "TEXT",
1248
+ "notNull": false,
1249
+ "unique": false
1250
+ },
1251
+ "description": {
1252
+ "type": "TEXT",
1253
+ "notNull": false,
1254
+ "unique": false
1255
+ },
1256
+ "body": {
1257
+ "type": "TEXT",
1258
+ "notNull": false,
1259
+ "unique": false
1260
+ },
1261
+ "source_message_id": {
1262
+ "type": "UUID",
1263
+ "referenceKind": "crossPackageRef",
1264
+ "notNull": false,
1265
+ "unique": false
1266
+ },
1267
+ "source_thread_key": {
1268
+ "type": "TEXT",
1269
+ "notNull": false,
1270
+ "unique": false
1271
+ },
1272
+ "metadata": {
1273
+ "type": "TEXT",
1274
+ "notNull": false,
1275
+ "unique": false
1276
+ },
1277
+ "tenant_id": {
1278
+ "type": "UUID",
1279
+ "referenceKind": "tenantId",
1280
+ "notNull": false,
1281
+ "unique": false
1080
1282
  }
1081
1283
  },
1082
1284
  "indexes": [
1285
+ {
1286
+ "name": "content_contribution_revisions_contribution_id_r_af43e6d599_idx",
1287
+ "columns": [
1288
+ "contribution_id",
1289
+ "revision_number"
1290
+ ],
1291
+ "unique": true
1292
+ },
1083
1293
  {
1084
1294
  "name": "content_contribution_revisions_slug_context_idx",
1085
1295
  "columns": [
1086
1296
  "slug",
1087
1297
  "context"
1088
- ],
1089
- "unique": true
1298
+ ]
1090
1299
  },
1091
1300
  {
1092
- "name": "content_contribution_revisions_created_at_idx",
1301
+ "name": "content_contribution_revisions_tenant_id_created_at_idx",
1093
1302
  "columns": [
1303
+ "tenant_id",
1094
1304
  "created_at"
1095
1305
  ]
1306
+ },
1307
+ {
1308
+ "name": "content_contribution_revisions_source_message_id_idx",
1309
+ "columns": [
1310
+ "source_message_id"
1311
+ ]
1096
1312
  }
1097
1313
  ],
1098
- "version": "cc3e0dfa"
1314
+ "version": "5051727c"
1099
1315
  }
1100
1316
  },
1101
1317
  "@happyvertical/smrt-content:ContentContributionType": {
@@ -1495,7 +1711,7 @@
1495
1711
  "collectionExportName": "ContentContributionTypeCollectionCollection",
1496
1712
  "schema": {
1497
1713
  "tableName": "content_contribution_types",
1498
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_contribution_types\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
1714
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_contribution_types\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"key\" TEXT NOT NULL,\n \"label\" TEXT,\n \"enabled\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"allowed_channels\" TEXT,\n \"allow_text\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"allow_files\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"allow_empty_text\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"intake_rules\" TEXT,\n \"promotion\" TEXT,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
1499
1715
  "columns": {
1500
1716
  "id": {
1501
1717
  "type": "UUID",
@@ -1521,27 +1737,94 @@
1521
1737
  "type": "TIMESTAMP",
1522
1738
  "notNull": true,
1523
1739
  "default": "current_timestamp"
1524
- }
1525
- },
1526
- "indexes": [
1527
- {
1528
- "name": "content_contribution_types_slug_context_idx",
1529
- "columns": [
1530
- "slug",
1531
- "context"
1532
- ],
1533
- "unique": true
1534
1740
  },
1535
- {
1536
- "name": "content_contribution_types_created_at_idx",
1537
- "columns": [
1538
- "created_at"
1539
- ]
1540
- }
1541
- ],
1542
- "version": "9c9a0367"
1543
- }
1544
- },
1741
+ "key": {
1742
+ "type": "TEXT",
1743
+ "notNull": true,
1744
+ "unique": false
1745
+ },
1746
+ "label": {
1747
+ "type": "TEXT",
1748
+ "notNull": false,
1749
+ "unique": false
1750
+ },
1751
+ "enabled": {
1752
+ "type": "BOOLEAN",
1753
+ "notNull": true,
1754
+ "unique": false,
1755
+ "default": true
1756
+ },
1757
+ "allowed_channels": {
1758
+ "type": "TEXT",
1759
+ "notNull": false,
1760
+ "unique": false
1761
+ },
1762
+ "allow_text": {
1763
+ "type": "BOOLEAN",
1764
+ "notNull": true,
1765
+ "unique": false,
1766
+ "default": true
1767
+ },
1768
+ "allow_files": {
1769
+ "type": "BOOLEAN",
1770
+ "notNull": true,
1771
+ "unique": false,
1772
+ "default": false
1773
+ },
1774
+ "allow_empty_text": {
1775
+ "type": "BOOLEAN",
1776
+ "notNull": true,
1777
+ "unique": false,
1778
+ "default": false
1779
+ },
1780
+ "intake_rules": {
1781
+ "type": "TEXT",
1782
+ "notNull": false,
1783
+ "unique": false
1784
+ },
1785
+ "promotion": {
1786
+ "type": "TEXT",
1787
+ "notNull": false,
1788
+ "unique": false
1789
+ },
1790
+ "metadata": {
1791
+ "type": "TEXT",
1792
+ "notNull": false,
1793
+ "unique": false
1794
+ },
1795
+ "tenant_id": {
1796
+ "type": "UUID",
1797
+ "referenceKind": "tenantId",
1798
+ "notNull": false,
1799
+ "unique": false
1800
+ }
1801
+ },
1802
+ "indexes": [
1803
+ {
1804
+ "name": "content_contribution_types_key_idx",
1805
+ "columns": [
1806
+ "key"
1807
+ ],
1808
+ "unique": true
1809
+ },
1810
+ {
1811
+ "name": "content_contribution_types_slug_context_idx",
1812
+ "columns": [
1813
+ "slug",
1814
+ "context"
1815
+ ]
1816
+ },
1817
+ {
1818
+ "name": "content_contribution_types_tenant_id_created_at_idx",
1819
+ "columns": [
1820
+ "tenant_id",
1821
+ "created_at"
1822
+ ]
1823
+ }
1824
+ ],
1825
+ "version": "35552300"
1826
+ }
1827
+ },
1545
1828
  "@happyvertical/smrt-content:ContentContribution": {
1546
1829
  "name": "contentcontribution",
1547
1830
  "className": "ContentContribution",
@@ -2241,7 +2524,7 @@
2241
2524
  "collectionExportName": "ContentContributionsCollection",
2242
2525
  "schema": {
2243
2526
  "tableName": "content_contributions",
2244
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_contributions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
2527
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_contributions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"contributor_id\" UUID NOT NULL,\n \"contribution_type_key\" TEXT NOT NULL,\n \"status\" TEXT DEFAULT 'submitted',\n \"intake_decision\" TEXT DEFAULT 'accepted',\n \"channel\" TEXT DEFAULT 'web',\n \"title\" TEXT,\n \"description\" TEXT,\n \"body\" TEXT,\n \"contributor_email\" TEXT,\n \"contributor_name\" TEXT,\n \"thread_key\" TEXT,\n \"source_message_id\" UUID,\n \"editor_notes\" TEXT,\n \"promoted_content_id\" UUID,\n \"revision_count\" INTEGER NOT NULL DEFAULT 0,\n \"approved_at\" TIMESTAMP,\n \"promoted_at\" TIMESTAMP,\n \"rejected_at\" TIMESTAMP,\n \"withdrawn_at\" TIMESTAMP,\n \"requested_changes_at\" TIMESTAMP,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
2245
2528
  "columns": {
2246
2529
  "id": {
2247
2530
  "type": "UUID",
@@ -2267,6 +2550,136 @@
2267
2550
  "type": "TIMESTAMP",
2268
2551
  "notNull": true,
2269
2552
  "default": "current_timestamp"
2553
+ },
2554
+ "contributor_id": {
2555
+ "type": "UUID",
2556
+ "referenceKind": "foreignKey",
2557
+ "notNull": true,
2558
+ "unique": false,
2559
+ "foreignKey": {
2560
+ "table": "content_contributors",
2561
+ "column": "id",
2562
+ "onDelete": "NO ACTION",
2563
+ "onUpdate": "CASCADE"
2564
+ }
2565
+ },
2566
+ "contribution_type_key": {
2567
+ "type": "TEXT",
2568
+ "notNull": true,
2569
+ "unique": false
2570
+ },
2571
+ "status": {
2572
+ "type": "TEXT",
2573
+ "notNull": false,
2574
+ "unique": false,
2575
+ "default": "submitted"
2576
+ },
2577
+ "intake_decision": {
2578
+ "type": "TEXT",
2579
+ "notNull": false,
2580
+ "unique": false,
2581
+ "default": "accepted"
2582
+ },
2583
+ "channel": {
2584
+ "type": "TEXT",
2585
+ "notNull": false,
2586
+ "unique": false,
2587
+ "default": "web"
2588
+ },
2589
+ "title": {
2590
+ "type": "TEXT",
2591
+ "notNull": false,
2592
+ "unique": false
2593
+ },
2594
+ "description": {
2595
+ "type": "TEXT",
2596
+ "notNull": false,
2597
+ "unique": false
2598
+ },
2599
+ "body": {
2600
+ "type": "TEXT",
2601
+ "notNull": false,
2602
+ "unique": false
2603
+ },
2604
+ "contributor_email": {
2605
+ "type": "TEXT",
2606
+ "notNull": false,
2607
+ "unique": false
2608
+ },
2609
+ "contributor_name": {
2610
+ "type": "TEXT",
2611
+ "notNull": false,
2612
+ "unique": false
2613
+ },
2614
+ "thread_key": {
2615
+ "type": "TEXT",
2616
+ "notNull": false,
2617
+ "unique": false
2618
+ },
2619
+ "source_message_id": {
2620
+ "type": "UUID",
2621
+ "referenceKind": "crossPackageRef",
2622
+ "notNull": false,
2623
+ "unique": false
2624
+ },
2625
+ "editor_notes": {
2626
+ "type": "TEXT",
2627
+ "notNull": false,
2628
+ "unique": false
2629
+ },
2630
+ "promoted_content_id": {
2631
+ "type": "UUID",
2632
+ "referenceKind": "foreignKey",
2633
+ "notNull": false,
2634
+ "unique": false,
2635
+ "foreignKey": {
2636
+ "table": "contents",
2637
+ "column": "id",
2638
+ "onDelete": "NO ACTION",
2639
+ "onUpdate": "CASCADE"
2640
+ }
2641
+ },
2642
+ "revision_count": {
2643
+ "type": "INTEGER",
2644
+ "notNull": true,
2645
+ "unique": false,
2646
+ "default": 0
2647
+ },
2648
+ "approved_at": {
2649
+ "type": "TIMESTAMP",
2650
+ "notNull": false,
2651
+ "unique": false
2652
+ },
2653
+ "promoted_at": {
2654
+ "type": "TIMESTAMP",
2655
+ "notNull": false,
2656
+ "unique": false
2657
+ },
2658
+ "rejected_at": {
2659
+ "type": "TIMESTAMP",
2660
+ "notNull": false,
2661
+ "unique": false
2662
+ },
2663
+ "withdrawn_at": {
2664
+ "type": "TIMESTAMP",
2665
+ "notNull": false,
2666
+ "unique": false
2667
+ },
2668
+ "requested_changes_at": {
2669
+ "type": "TIMESTAMP",
2670
+ "notNull": false,
2671
+ "unique": false
2672
+ },
2673
+ "metadata": {
2674
+ "type": "TEXT",
2675
+ "notNull": false,
2676
+ "unique": false
2677
+ },
2678
+ "tenant_id": {
2679
+ "type": "UUID",
2680
+ "referenceKind": "tenantId",
2681
+ "notNull": false,
2682
+ "unique": false
2270
2683
  }
2271
2684
  },
2272
2685
  "indexes": [
@@ -2275,17 +2688,35 @@
2275
2688
  "columns": [
2276
2689
  "slug",
2277
2690
  "context"
2278
- ],
2279
- "unique": true
2691
+ ]
2280
2692
  },
2281
2693
  {
2282
- "name": "content_contributions_created_at_idx",
2694
+ "name": "content_contributions_tenant_id_created_at_idx",
2283
2695
  "columns": [
2696
+ "tenant_id",
2284
2697
  "created_at"
2285
2698
  ]
2699
+ },
2700
+ {
2701
+ "name": "content_contributions_contributor_id_idx",
2702
+ "columns": [
2703
+ "contributor_id"
2704
+ ]
2705
+ },
2706
+ {
2707
+ "name": "content_contributions_source_message_id_idx",
2708
+ "columns": [
2709
+ "source_message_id"
2710
+ ]
2711
+ },
2712
+ {
2713
+ "name": "content_contributions_promoted_content_id_idx",
2714
+ "columns": [
2715
+ "promoted_content_id"
2716
+ ]
2286
2717
  }
2287
2718
  ],
2288
- "version": "641c0cc8"
2719
+ "version": "ef8fd792"
2289
2720
  }
2290
2721
  },
2291
2722
  "@happyvertical/smrt-content:ContentContributor": {
@@ -2572,7 +3003,7 @@
2572
3003
  "collectionExportName": "ContentContributorCollectionCollection",
2573
3004
  "schema": {
2574
3005
  "tableName": "content_contributors",
2575
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_contributors\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
3006
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_contributors\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"profile_id\" UUID,\n \"email\" TEXT NOT NULL,\n \"name\" TEXT,\n \"trust_level\" TEXT DEFAULT 'standard',\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
2576
3007
  "columns": {
2577
3008
  "id": {
2578
3009
  "type": "UUID",
@@ -2598,25 +3029,71 @@
2598
3029
  "type": "TIMESTAMP",
2599
3030
  "notNull": true,
2600
3031
  "default": "current_timestamp"
2601
- }
2602
- },
2603
- "indexes": [
2604
- {
2605
- "name": "content_contributors_slug_context_idx",
2606
- "columns": [
2607
- "slug",
2608
- "context"
2609
- ],
2610
- "unique": true
2611
3032
  },
2612
- {
2613
- "name": "content_contributors_created_at_idx",
2614
- "columns": [
2615
- "created_at"
3033
+ "profile_id": {
3034
+ "type": "UUID",
3035
+ "referenceKind": "crossPackageRef",
3036
+ "notNull": false,
3037
+ "unique": false
3038
+ },
3039
+ "email": {
3040
+ "type": "TEXT",
3041
+ "notNull": true,
3042
+ "unique": false
3043
+ },
3044
+ "name": {
3045
+ "type": "TEXT",
3046
+ "notNull": false,
3047
+ "unique": false
3048
+ },
3049
+ "trust_level": {
3050
+ "type": "TEXT",
3051
+ "notNull": false,
3052
+ "unique": false,
3053
+ "default": "standard"
3054
+ },
3055
+ "metadata": {
3056
+ "type": "TEXT",
3057
+ "notNull": false,
3058
+ "unique": false
3059
+ },
3060
+ "tenant_id": {
3061
+ "type": "UUID",
3062
+ "referenceKind": "tenantId",
3063
+ "notNull": false,
3064
+ "unique": false
3065
+ }
3066
+ },
3067
+ "indexes": [
3068
+ {
3069
+ "name": "content_contributors_email_idx",
3070
+ "columns": [
3071
+ "email"
3072
+ ],
3073
+ "unique": true
3074
+ },
3075
+ {
3076
+ "name": "content_contributors_slug_context_idx",
3077
+ "columns": [
3078
+ "slug",
3079
+ "context"
3080
+ ]
3081
+ },
3082
+ {
3083
+ "name": "content_contributors_tenant_id_created_at_idx",
3084
+ "columns": [
3085
+ "tenant_id",
3086
+ "created_at"
3087
+ ]
3088
+ },
3089
+ {
3090
+ "name": "content_contributors_profile_id_idx",
3091
+ "columns": [
3092
+ "profile_id"
2616
3093
  ]
2617
3094
  }
2618
3095
  ],
2619
- "version": "b457e60b"
3096
+ "version": "7eb9c661"
2620
3097
  }
2621
3098
  },
2622
3099
  "@happyvertical/smrt-content:ContentCorrection": {
@@ -2883,7 +3360,8 @@
2883
3360
  "slug",
2884
3361
  "context"
2885
3362
  ],
2886
- "unique": true
3363
+ "unique": true,
3364
+ "nullsNotDistinct": true
2887
3365
  },
2888
3366
  {
2889
3367
  "name": "content_corrections_tenant_id_created_at_idx",
@@ -2982,7 +3460,7 @@
2982
3460
  "collectionExportName": "ContentCorrectionCollectionCollection",
2983
3461
  "schema": {
2984
3462
  "tableName": "content_corrections",
2985
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_corrections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
3463
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_corrections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"content_id\" UUID NOT NULL,\n \"content_version_id\" UUID,\n \"fact_id\" UUID,\n \"replacement_fact_id\" UUID,\n \"correction_type\" TEXT DEFAULT 'fact',\n \"status\" TEXT DEFAULT 'draft',\n \"summary\" TEXT,\n \"incorrect_text\" TEXT,\n \"corrected_text\" TEXT,\n \"public_note\" TEXT,\n \"metadata\" TEXT,\n \"tenant_id\" UUID,\n \"published_at\" TIMESTAMP\n);",
2986
3464
  "columns": {
2987
3465
  "id": {
2988
3466
  "type": "UUID",
@@ -3008,25 +3486,136 @@
3008
3486
  "type": "TIMESTAMP",
3009
3487
  "notNull": true,
3010
3488
  "default": "current_timestamp"
3489
+ },
3490
+ "content_id": {
3491
+ "type": "UUID",
3492
+ "referenceKind": "foreignKey",
3493
+ "notNull": true,
3494
+ "unique": false,
3495
+ "foreignKey": {
3496
+ "table": "contents",
3497
+ "column": "id",
3498
+ "onDelete": "NO ACTION",
3499
+ "onUpdate": "CASCADE"
3500
+ }
3501
+ },
3502
+ "content_version_id": {
3503
+ "type": "UUID",
3504
+ "referenceKind": "foreignKey",
3505
+ "notNull": false,
3506
+ "unique": false,
3507
+ "foreignKey": {
3508
+ "table": "content_versions",
3509
+ "column": "id",
3510
+ "onDelete": "NO ACTION",
3511
+ "onUpdate": "CASCADE"
3512
+ }
3513
+ },
3514
+ "fact_id": {
3515
+ "type": "UUID",
3516
+ "referenceKind": "crossPackageRef",
3517
+ "notNull": false,
3518
+ "unique": false
3519
+ },
3520
+ "replacement_fact_id": {
3521
+ "type": "UUID",
3522
+ "referenceKind": "crossPackageRef",
3523
+ "notNull": false,
3524
+ "unique": false
3525
+ },
3526
+ "correction_type": {
3527
+ "type": "TEXT",
3528
+ "notNull": false,
3529
+ "unique": false,
3530
+ "default": "fact"
3531
+ },
3532
+ "status": {
3533
+ "type": "TEXT",
3534
+ "notNull": false,
3535
+ "unique": false,
3536
+ "default": "draft"
3537
+ },
3538
+ "summary": {
3539
+ "type": "TEXT",
3540
+ "notNull": false,
3541
+ "unique": false
3542
+ },
3543
+ "incorrect_text": {
3544
+ "type": "TEXT",
3545
+ "notNull": false,
3546
+ "unique": false
3547
+ },
3548
+ "corrected_text": {
3549
+ "type": "TEXT",
3550
+ "notNull": false,
3551
+ "unique": false
3552
+ },
3553
+ "public_note": {
3554
+ "type": "TEXT",
3555
+ "notNull": false,
3556
+ "unique": false
3557
+ },
3558
+ "metadata": {
3559
+ "type": "TEXT",
3560
+ "notNull": false,
3561
+ "unique": false
3562
+ },
3563
+ "tenant_id": {
3564
+ "type": "UUID",
3565
+ "referenceKind": "tenantId",
3566
+ "notNull": false,
3567
+ "unique": false
3568
+ },
3569
+ "published_at": {
3570
+ "type": "TIMESTAMP",
3571
+ "notNull": false,
3572
+ "unique": false
3011
3573
  }
3012
3574
  },
3013
3575
  "indexes": [
3014
3576
  {
3015
3577
  "name": "content_corrections_slug_context_idx",
3016
3578
  "columns": [
3579
+ "tenant_id",
3017
3580
  "slug",
3018
3581
  "context"
3019
3582
  ],
3020
- "unique": true
3583
+ "unique": true,
3584
+ "nullsNotDistinct": true
3021
3585
  },
3022
3586
  {
3023
- "name": "content_corrections_created_at_idx",
3587
+ "name": "content_corrections_tenant_id_created_at_idx",
3024
3588
  "columns": [
3589
+ "tenant_id",
3025
3590
  "created_at"
3026
3591
  ]
3592
+ },
3593
+ {
3594
+ "name": "content_corrections_content_id_idx",
3595
+ "columns": [
3596
+ "content_id"
3597
+ ]
3598
+ },
3599
+ {
3600
+ "name": "content_corrections_content_version_id_idx",
3601
+ "columns": [
3602
+ "content_version_id"
3603
+ ]
3604
+ },
3605
+ {
3606
+ "name": "content_corrections_fact_id_idx",
3607
+ "columns": [
3608
+ "fact_id"
3609
+ ]
3610
+ },
3611
+ {
3612
+ "name": "content_corrections_replacement_fact_id_idx",
3613
+ "columns": [
3614
+ "replacement_fact_id"
3615
+ ]
3027
3616
  }
3028
3617
  ],
3029
- "version": "6ebe142d"
3618
+ "version": "bf2808c7"
3030
3619
  }
3031
3620
  },
3032
3621
  "@happyvertical/smrt-content:ContentFeedSource": {
@@ -3384,7 +3973,8 @@
3384
3973
  "tenant_id",
3385
3974
  "feed_url"
3386
3975
  ],
3387
- "unique": true
3976
+ "unique": true,
3977
+ "nullsNotDistinct": true
3388
3978
  },
3389
3979
  {
3390
3980
  "name": "content_feed_sources_slug_context_idx",
@@ -3499,7 +4089,7 @@
3499
4089
  "collectionExportName": "ContentFeedSourceCollectionCollection",
3500
4090
  "schema": {
3501
4091
  "tableName": "content_feed_sources",
3502
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_feed_sources\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
4092
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_feed_sources\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT NOT NULL,\n \"feed_url\" TEXT NOT NULL,\n \"homepage_url\" TEXT,\n \"format\" TEXT,\n \"status\" TEXT NOT NULL DEFAULT 'active',\n \"default_category\" TEXT,\n \"source_group\" TEXT,\n \"poll_interval_minutes\" INTEGER NOT NULL DEFAULT 15,\n \"etag\" TEXT,\n \"last_modified\" TEXT,\n \"last_fetched_at\" TIMESTAMP,\n \"last_success_at\" TIMESTAMP,\n \"last_error\" TEXT,\n \"metadata\" JSON DEFAULT '{}'\n);",
3503
4093
  "columns": {
3504
4094
  "id": {
3505
4095
  "type": "UUID",
@@ -3525,25 +4115,113 @@
3525
4115
  "type": "TIMESTAMP",
3526
4116
  "notNull": true,
3527
4117
  "default": "current_timestamp"
4118
+ },
4119
+ "tenant_id": {
4120
+ "type": "UUID",
4121
+ "referenceKind": "tenantId",
4122
+ "notNull": false,
4123
+ "unique": false
4124
+ },
4125
+ "name": {
4126
+ "type": "TEXT",
4127
+ "notNull": true,
4128
+ "unique": false
4129
+ },
4130
+ "feed_url": {
4131
+ "type": "TEXT",
4132
+ "notNull": true,
4133
+ "unique": false
4134
+ },
4135
+ "homepage_url": {
4136
+ "type": "TEXT",
4137
+ "notNull": false,
4138
+ "unique": false
4139
+ },
4140
+ "format": {
4141
+ "type": "TEXT",
4142
+ "notNull": false,
4143
+ "unique": false
4144
+ },
4145
+ "status": {
4146
+ "type": "TEXT",
4147
+ "notNull": true,
4148
+ "unique": false,
4149
+ "default": "active"
4150
+ },
4151
+ "default_category": {
4152
+ "type": "TEXT",
4153
+ "notNull": false,
4154
+ "unique": false
4155
+ },
4156
+ "source_group": {
4157
+ "type": "TEXT",
4158
+ "notNull": false,
4159
+ "unique": false
4160
+ },
4161
+ "poll_interval_minutes": {
4162
+ "type": "INTEGER",
4163
+ "notNull": true,
4164
+ "unique": false,
4165
+ "default": 15
4166
+ },
4167
+ "etag": {
4168
+ "type": "TEXT",
4169
+ "notNull": false,
4170
+ "unique": false
4171
+ },
4172
+ "last_modified": {
4173
+ "type": "TEXT",
4174
+ "notNull": false,
4175
+ "unique": false
4176
+ },
4177
+ "last_fetched_at": {
4178
+ "type": "TIMESTAMP",
4179
+ "notNull": false,
4180
+ "unique": false
4181
+ },
4182
+ "last_success_at": {
4183
+ "type": "TIMESTAMP",
4184
+ "notNull": false,
4185
+ "unique": false
4186
+ },
4187
+ "last_error": {
4188
+ "type": "TEXT",
4189
+ "notNull": false,
4190
+ "unique": false
4191
+ },
4192
+ "metadata": {
4193
+ "type": "JSON",
4194
+ "notNull": false,
4195
+ "unique": false,
4196
+ "default": {}
3528
4197
  }
3529
4198
  },
3530
4199
  "indexes": [
4200
+ {
4201
+ "name": "content_feed_sources_tenant_id_feed_url_idx",
4202
+ "columns": [
4203
+ "tenant_id",
4204
+ "feed_url"
4205
+ ],
4206
+ "unique": true,
4207
+ "nullsNotDistinct": true
4208
+ },
3531
4209
  {
3532
4210
  "name": "content_feed_sources_slug_context_idx",
3533
4211
  "columns": [
3534
4212
  "slug",
3535
4213
  "context"
3536
- ],
3537
- "unique": true
4214
+ ]
3538
4215
  },
3539
4216
  {
3540
- "name": "content_feed_sources_created_at_idx",
4217
+ "name": "content_feed_sources_tenant_id_created_at_idx",
3541
4218
  "columns": [
4219
+ "tenant_id",
3542
4220
  "created_at"
3543
4221
  ]
3544
4222
  }
3545
4223
  ],
3546
- "version": "bb0cca9e"
4224
+ "version": "bbcb36e5"
3547
4225
  }
3548
4226
  },
3549
4227
  "@happyvertical/smrt-content:ContentGovernanceAssignment": {
@@ -3901,7 +4579,7 @@
3901
4579
  "collectionExportName": "ContentGovernanceAssignmentCollectionCollection",
3902
4580
  "schema": {
3903
4581
  "tableName": "content_governance_assignments",
3904
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_governance_assignments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
4582
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_governance_assignments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"key\" TEXT NOT NULL,\n \"label\" TEXT,\n \"content_type\" TEXT NOT NULL,\n \"content_variant\" TEXT,\n \"enabled\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"fact_linking_enabled\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"transparency_enabled\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"publication_profile_key\" TEXT,\n \"correction_profile_key\" TEXT,\n \"enforce_publish_readiness\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"default_fact_relationship\" TEXT DEFAULT 'supports',\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
3905
4583
  "columns": {
3906
4584
  "id": {
3907
4585
  "type": "UUID",
@@ -3927,25 +4605,103 @@
3927
4605
  "type": "TIMESTAMP",
3928
4606
  "notNull": true,
3929
4607
  "default": "current_timestamp"
4608
+ },
4609
+ "key": {
4610
+ "type": "TEXT",
4611
+ "notNull": true,
4612
+ "unique": false
4613
+ },
4614
+ "label": {
4615
+ "type": "TEXT",
4616
+ "notNull": false,
4617
+ "unique": false
4618
+ },
4619
+ "content_type": {
4620
+ "type": "TEXT",
4621
+ "notNull": true,
4622
+ "unique": false
4623
+ },
4624
+ "content_variant": {
4625
+ "type": "TEXT",
4626
+ "notNull": false,
4627
+ "unique": false
4628
+ },
4629
+ "enabled": {
4630
+ "type": "BOOLEAN",
4631
+ "notNull": true,
4632
+ "unique": false,
4633
+ "default": true
4634
+ },
4635
+ "fact_linking_enabled": {
4636
+ "type": "BOOLEAN",
4637
+ "notNull": true,
4638
+ "unique": false,
4639
+ "default": false
4640
+ },
4641
+ "transparency_enabled": {
4642
+ "type": "BOOLEAN",
4643
+ "notNull": true,
4644
+ "unique": false,
4645
+ "default": false
4646
+ },
4647
+ "publication_profile_key": {
4648
+ "type": "TEXT",
4649
+ "notNull": false,
4650
+ "unique": false
4651
+ },
4652
+ "correction_profile_key": {
4653
+ "type": "TEXT",
4654
+ "notNull": false,
4655
+ "unique": false
4656
+ },
4657
+ "enforce_publish_readiness": {
4658
+ "type": "BOOLEAN",
4659
+ "notNull": true,
4660
+ "unique": false,
4661
+ "default": false
4662
+ },
4663
+ "default_fact_relationship": {
4664
+ "type": "TEXT",
4665
+ "notNull": false,
4666
+ "unique": false,
4667
+ "default": "supports"
4668
+ },
4669
+ "metadata": {
4670
+ "type": "TEXT",
4671
+ "notNull": false,
4672
+ "unique": false
4673
+ },
4674
+ "tenant_id": {
4675
+ "type": "UUID",
4676
+ "referenceKind": "tenantId",
4677
+ "notNull": false,
4678
+ "unique": false
3930
4679
  }
3931
4680
  },
3932
4681
  "indexes": [
4682
+ {
4683
+ "name": "content_governance_assignments_key_idx",
4684
+ "columns": [
4685
+ "key"
4686
+ ],
4687
+ "unique": true
4688
+ },
3933
4689
  {
3934
4690
  "name": "content_governance_assignments_slug_context_idx",
3935
4691
  "columns": [
3936
4692
  "slug",
3937
4693
  "context"
3938
- ],
3939
- "unique": true
4694
+ ]
3940
4695
  },
3941
4696
  {
3942
- "name": "content_governance_assignments_created_at_idx",
4697
+ "name": "content_governance_assignments_tenant_id_created_at_idx",
3943
4698
  "columns": [
4699
+ "tenant_id",
3944
4700
  "created_at"
3945
4701
  ]
3946
4702
  }
3947
4703
  ],
3948
- "version": "21471529"
4704
+ "version": "00a2c610"
3949
4705
  }
3950
4706
  },
3951
4707
  "@happyvertical/smrt-content:ContentGovernancePolicyCollection": {
@@ -3981,7 +4737,7 @@
3981
4737
  "collectionExportName": "ContentGovernancePolicyCollectionCollection",
3982
4738
  "schema": {
3983
4739
  "tableName": "content_governance_policies",
3984
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_governance_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
4740
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_governance_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"key\" TEXT NOT NULL,\n \"label\" TEXT,\n \"kind\" TEXT DEFAULT 'custom',\n \"instructions\" TEXT,\n \"enabled\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
3985
4741
  "columns": {
3986
4742
  "id": {
3987
4743
  "type": "UUID",
@@ -4007,25 +4763,70 @@
4007
4763
  "type": "TIMESTAMP",
4008
4764
  "notNull": true,
4009
4765
  "default": "current_timestamp"
4766
+ },
4767
+ "key": {
4768
+ "type": "TEXT",
4769
+ "notNull": true,
4770
+ "unique": false
4771
+ },
4772
+ "label": {
4773
+ "type": "TEXT",
4774
+ "notNull": false,
4775
+ "unique": false
4776
+ },
4777
+ "kind": {
4778
+ "type": "TEXT",
4779
+ "notNull": false,
4780
+ "unique": false,
4781
+ "default": "custom"
4782
+ },
4783
+ "instructions": {
4784
+ "type": "TEXT",
4785
+ "notNull": false,
4786
+ "unique": false
4787
+ },
4788
+ "enabled": {
4789
+ "type": "BOOLEAN",
4790
+ "notNull": true,
4791
+ "unique": false,
4792
+ "default": true
4793
+ },
4794
+ "metadata": {
4795
+ "type": "TEXT",
4796
+ "notNull": false,
4797
+ "unique": false
4798
+ },
4799
+ "tenant_id": {
4800
+ "type": "UUID",
4801
+ "referenceKind": "tenantId",
4802
+ "notNull": false,
4803
+ "unique": false
4010
4804
  }
4011
4805
  },
4012
4806
  "indexes": [
4807
+ {
4808
+ "name": "content_governance_policies_key_idx",
4809
+ "columns": [
4810
+ "key"
4811
+ ],
4812
+ "unique": true
4813
+ },
4013
4814
  {
4014
4815
  "name": "content_governance_policies_slug_context_idx",
4015
4816
  "columns": [
4016
4817
  "slug",
4017
4818
  "context"
4018
- ],
4019
- "unique": true
4819
+ ]
4020
4820
  },
4021
4821
  {
4022
- "name": "content_governance_policies_created_at_idx",
4822
+ "name": "content_governance_policies_tenant_id_created_at_idx",
4023
4823
  "columns": [
4824
+ "tenant_id",
4024
4825
  "created_at"
4025
4826
  ]
4026
4827
  }
4027
4828
  ],
4028
- "version": "e2da0e5b"
4829
+ "version": "3cc24f80"
4029
4830
  }
4030
4831
  },
4031
4832
  "@happyvertical/smrt-content:ContentGovernancePolicy": {
@@ -4525,7 +5326,7 @@
4525
5326
  "collectionExportName": "ContentGovernanceProfileCollectionCollection",
4526
5327
  "schema": {
4527
5328
  "tableName": "content_governance_profiles",
4528
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_governance_profiles\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
5329
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_governance_profiles\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"key\" TEXT NOT NULL,\n \"label\" TEXT,\n \"description\" TEXT,\n \"enabled\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"requirements\" TEXT,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
4529
5330
  "columns": {
4530
5331
  "id": {
4531
5332
  "type": "UUID",
@@ -4551,25 +5352,69 @@
4551
5352
  "type": "TIMESTAMP",
4552
5353
  "notNull": true,
4553
5354
  "default": "current_timestamp"
5355
+ },
5356
+ "key": {
5357
+ "type": "TEXT",
5358
+ "notNull": true,
5359
+ "unique": false
5360
+ },
5361
+ "label": {
5362
+ "type": "TEXT",
5363
+ "notNull": false,
5364
+ "unique": false
5365
+ },
5366
+ "description": {
5367
+ "type": "TEXT",
5368
+ "notNull": false,
5369
+ "unique": false
5370
+ },
5371
+ "enabled": {
5372
+ "type": "BOOLEAN",
5373
+ "notNull": true,
5374
+ "unique": false,
5375
+ "default": true
5376
+ },
5377
+ "requirements": {
5378
+ "type": "TEXT",
5379
+ "notNull": false,
5380
+ "unique": false
5381
+ },
5382
+ "metadata": {
5383
+ "type": "TEXT",
5384
+ "notNull": false,
5385
+ "unique": false
5386
+ },
5387
+ "tenant_id": {
5388
+ "type": "UUID",
5389
+ "referenceKind": "tenantId",
5390
+ "notNull": false,
5391
+ "unique": false
4554
5392
  }
4555
5393
  },
4556
5394
  "indexes": [
5395
+ {
5396
+ "name": "content_governance_profiles_key_idx",
5397
+ "columns": [
5398
+ "key"
5399
+ ],
5400
+ "unique": true
5401
+ },
4557
5402
  {
4558
5403
  "name": "content_governance_profiles_slug_context_idx",
4559
5404
  "columns": [
4560
5405
  "slug",
4561
5406
  "context"
4562
- ],
4563
- "unique": true
5407
+ ]
4564
5408
  },
4565
5409
  {
4566
- "name": "content_governance_profiles_created_at_idx",
5410
+ "name": "content_governance_profiles_tenant_id_created_at_idx",
4567
5411
  "columns": [
5412
+ "tenant_id",
4568
5413
  "created_at"
4569
5414
  ]
4570
5415
  }
4571
5416
  ],
4572
- "version": "496f0f56"
5417
+ "version": "4bfc2afc"
4573
5418
  }
4574
5419
  },
4575
5420
  "@happyvertical/smrt-content:ContentReference": {
@@ -4926,7 +5771,7 @@
4926
5771
  "collectionExportName": "ContentReferencesCollection",
4927
5772
  "schema": {
4928
5773
  "tableName": "content_references",
4929
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_references\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
5774
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_references\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"source_id\" UUID NOT NULL,\n \"target_id\" UUID NOT NULL,\n \"target_version\" INTEGER\n);",
4930
5775
  "columns": {
4931
5776
  "id": {
4932
5777
  "type": "UUID",
@@ -4952,25 +5797,74 @@
4952
5797
  "type": "TIMESTAMP",
4953
5798
  "notNull": true,
4954
5799
  "default": "current_timestamp"
5800
+ },
5801
+ "tenant_id": {
5802
+ "type": "UUID",
5803
+ "referenceKind": "tenantId",
5804
+ "notNull": false,
5805
+ "unique": false
5806
+ },
5807
+ "source_id": {
5808
+ "type": "UUID",
5809
+ "referenceKind": "foreignKey",
5810
+ "notNull": true,
5811
+ "unique": false,
5812
+ "foreignKey": {
5813
+ "table": "contents",
5814
+ "column": "id",
5815
+ "onDelete": "CASCADE",
5816
+ "onUpdate": "CASCADE"
5817
+ }
5818
+ },
5819
+ "target_id": {
5820
+ "type": "UUID",
5821
+ "referenceKind": "foreignKey",
5822
+ "notNull": true,
5823
+ "unique": false,
5824
+ "foreignKey": {
5825
+ "table": "contents",
5826
+ "column": "id",
5827
+ "onDelete": "CASCADE",
5828
+ "onUpdate": "CASCADE"
5829
+ }
5830
+ },
5831
+ "target_version": {
5832
+ "type": "INTEGER",
5833
+ "notNull": false,
5834
+ "unique": false
4955
5835
  }
4956
5836
  },
4957
5837
  "indexes": [
5838
+ {
5839
+ "name": "content_references_source_id_target_id_idx",
5840
+ "columns": [
5841
+ "source_id",
5842
+ "target_id"
5843
+ ],
5844
+ "unique": true
5845
+ },
4958
5846
  {
4959
5847
  "name": "content_references_slug_context_idx",
4960
5848
  "columns": [
4961
5849
  "slug",
4962
5850
  "context"
4963
- ],
4964
- "unique": true
5851
+ ]
4965
5852
  },
4966
5853
  {
4967
- "name": "content_references_created_at_idx",
5854
+ "name": "content_references_tenant_id_created_at_idx",
4968
5855
  "columns": [
5856
+ "tenant_id",
4969
5857
  "created_at"
4970
5858
  ]
5859
+ },
5860
+ {
5861
+ "name": "content_references_target_id_idx",
5862
+ "columns": [
5863
+ "target_id"
5864
+ ]
4971
5865
  }
4972
5866
  ],
4973
- "version": "e9ad3cf0"
5867
+ "version": "3347ea2a"
4974
5868
  }
4975
5869
  },
4976
5870
  "@happyvertical/smrt-content:ContentReview": {
@@ -5214,7 +6108,8 @@
5214
6108
  "slug",
5215
6109
  "context"
5216
6110
  ],
5217
- "unique": true
6111
+ "unique": true,
6112
+ "nullsNotDistinct": true
5218
6113
  },
5219
6114
  {
5220
6115
  "name": "content_reviews_tenant_id_created_at_idx",
@@ -5355,7 +6250,7 @@
5355
6250
  "collectionExportName": "ContentReviewCollectionCollection",
5356
6251
  "schema": {
5357
6252
  "tableName": "content_reviews",
5358
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_reviews\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
6253
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_reviews\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"content_id\" UUID NOT NULL,\n \"content_version_id\" UUID,\n \"kind\" TEXT DEFAULT 'custom',\n \"policy_key\" TEXT,\n \"status\" TEXT DEFAULT 'pending',\n \"summary\" TEXT,\n \"findings\" TEXT,\n \"reviewer\" TEXT,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
5359
6254
  "columns": {
5360
6255
  "id": {
5361
6256
  "type": "UUID",
@@ -5381,25 +6276,107 @@
5381
6276
  "type": "TIMESTAMP",
5382
6277
  "notNull": true,
5383
6278
  "default": "current_timestamp"
6279
+ },
6280
+ "content_id": {
6281
+ "type": "UUID",
6282
+ "referenceKind": "foreignKey",
6283
+ "notNull": true,
6284
+ "unique": false,
6285
+ "foreignKey": {
6286
+ "table": "contents",
6287
+ "column": "id",
6288
+ "onDelete": "NO ACTION",
6289
+ "onUpdate": "CASCADE"
6290
+ }
6291
+ },
6292
+ "content_version_id": {
6293
+ "type": "UUID",
6294
+ "referenceKind": "foreignKey",
6295
+ "notNull": false,
6296
+ "unique": false,
6297
+ "foreignKey": {
6298
+ "table": "content_versions",
6299
+ "column": "id",
6300
+ "onDelete": "NO ACTION",
6301
+ "onUpdate": "CASCADE"
6302
+ }
6303
+ },
6304
+ "kind": {
6305
+ "type": "TEXT",
6306
+ "notNull": false,
6307
+ "unique": false,
6308
+ "default": "custom"
6309
+ },
6310
+ "policy_key": {
6311
+ "type": "TEXT",
6312
+ "notNull": false,
6313
+ "unique": false
6314
+ },
6315
+ "status": {
6316
+ "type": "TEXT",
6317
+ "notNull": false,
6318
+ "unique": false,
6319
+ "default": "pending"
6320
+ },
6321
+ "summary": {
6322
+ "type": "TEXT",
6323
+ "notNull": false,
6324
+ "unique": false
6325
+ },
6326
+ "findings": {
6327
+ "type": "TEXT",
6328
+ "notNull": false,
6329
+ "unique": false
6330
+ },
6331
+ "reviewer": {
6332
+ "type": "TEXT",
6333
+ "notNull": false,
6334
+ "unique": false
6335
+ },
6336
+ "metadata": {
6337
+ "type": "TEXT",
6338
+ "notNull": false,
6339
+ "unique": false
6340
+ },
6341
+ "tenant_id": {
6342
+ "type": "UUID",
6343
+ "referenceKind": "tenantId",
6344
+ "notNull": false,
6345
+ "unique": false
5384
6346
  }
5385
6347
  },
5386
6348
  "indexes": [
5387
6349
  {
5388
6350
  "name": "content_reviews_slug_context_idx",
5389
6351
  "columns": [
6352
+ "tenant_id",
5390
6353
  "slug",
5391
6354
  "context"
5392
6355
  ],
5393
- "unique": true
6356
+ "unique": true,
6357
+ "nullsNotDistinct": true
6358
+ },
6359
+ {
6360
+ "name": "content_reviews_tenant_id_created_at_idx",
6361
+ "columns": [
6362
+ "tenant_id",
6363
+ "created_at"
6364
+ ]
6365
+ },
6366
+ {
6367
+ "name": "content_reviews_content_id_idx",
6368
+ "columns": [
6369
+ "content_id"
6370
+ ]
5394
6371
  },
5395
6372
  {
5396
- "name": "content_reviews_created_at_idx",
6373
+ "name": "content_reviews_content_version_id_idx",
5397
6374
  "columns": [
5398
- "created_at"
6375
+ "content_version_id"
5399
6376
  ]
5400
6377
  }
5401
6378
  ],
5402
- "version": "03b7d1d3"
6379
+ "version": "7b2c0ad7"
5403
6380
  }
5404
6381
  },
5405
6382
  "@happyvertical/smrt-content:Article": {
@@ -6630,7 +7607,8 @@
6630
7607
  "context",
6631
7608
  "_meta_type"
6632
7609
  ],
6633
- "unique": true
7610
+ "unique": true,
7611
+ "nullsNotDistinct": true
6634
7612
  },
6635
7613
  {
6636
7614
  "name": "contents_meta_type_idx",
@@ -7896,7 +8874,8 @@
7896
8874
  "context",
7897
8875
  "_meta_type"
7898
8876
  ],
7899
- "unique": true
8877
+ "unique": true,
8878
+ "nullsNotDistinct": true
7900
8879
  },
7901
8880
  {
7902
8881
  "name": "contents_meta_type_idx",
@@ -9191,7 +10170,8 @@
9191
10170
  "context",
9192
10171
  "_meta_type"
9193
10172
  ],
9194
- "unique": true
10173
+ "unique": true,
10174
+ "nullsNotDistinct": true
9195
10175
  },
9196
10176
  {
9197
10177
  "name": "contents_meta_type_idx",
@@ -9645,7 +10625,7 @@
9645
10625
  "collectionExportName": "ContentVersionCollectionCollection",
9646
10626
  "schema": {
9647
10627
  "tableName": "content_versions",
9648
- "ddl": "CREATE TABLE IF NOT EXISTS \"content_versions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
10628
+ "ddl": "CREATE TABLE IF NOT EXISTS \"content_versions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"content_id\" UUID NOT NULL,\n \"version\" INTEGER NOT NULL DEFAULT 1,\n \"kind\" TEXT DEFAULT 'manual',\n \"title\" TEXT,\n \"description\" TEXT,\n \"body\" TEXT,\n \"status\" TEXT,\n \"summary\" TEXT,\n \"snapshot\" TEXT,\n \"metadata\" TEXT,\n \"tenant_id\" UUID\n);",
9649
10629
  "columns": {
9650
10630
  "id": {
9651
10631
  "type": "UUID",
@@ -9671,25 +10651,98 @@
9671
10651
  "type": "TIMESTAMP",
9672
10652
  "notNull": true,
9673
10653
  "default": "current_timestamp"
10654
+ },
10655
+ "content_id": {
10656
+ "type": "UUID",
10657
+ "referenceKind": "foreignKey",
10658
+ "notNull": true,
10659
+ "unique": false,
10660
+ "foreignKey": {
10661
+ "table": "contents",
10662
+ "column": "id",
10663
+ "onDelete": "CASCADE",
10664
+ "onUpdate": "CASCADE"
10665
+ }
10666
+ },
10667
+ "version": {
10668
+ "type": "INTEGER",
10669
+ "notNull": true,
10670
+ "unique": false,
10671
+ "default": 1
10672
+ },
10673
+ "kind": {
10674
+ "type": "TEXT",
10675
+ "notNull": false,
10676
+ "unique": false,
10677
+ "default": "manual"
10678
+ },
10679
+ "title": {
10680
+ "type": "TEXT",
10681
+ "notNull": false,
10682
+ "unique": false
10683
+ },
10684
+ "description": {
10685
+ "type": "TEXT",
10686
+ "notNull": false,
10687
+ "unique": false
10688
+ },
10689
+ "body": {
10690
+ "type": "TEXT",
10691
+ "notNull": false,
10692
+ "unique": false
10693
+ },
10694
+ "status": {
10695
+ "type": "TEXT",
10696
+ "notNull": false,
10697
+ "unique": false
10698
+ },
10699
+ "summary": {
10700
+ "type": "TEXT",
10701
+ "notNull": false,
10702
+ "unique": false
10703
+ },
10704
+ "snapshot": {
10705
+ "type": "TEXT",
10706
+ "notNull": false,
10707
+ "unique": false
10708
+ },
10709
+ "metadata": {
10710
+ "type": "TEXT",
10711
+ "notNull": false,
10712
+ "unique": false
10713
+ },
10714
+ "tenant_id": {
10715
+ "type": "UUID",
10716
+ "referenceKind": "tenantId",
10717
+ "notNull": false,
10718
+ "unique": false
9674
10719
  }
9675
10720
  },
9676
10721
  "indexes": [
10722
+ {
10723
+ "name": "content_versions_content_id_version_idx",
10724
+ "columns": [
10725
+ "content_id",
10726
+ "version"
10727
+ ],
10728
+ "unique": true
10729
+ },
9677
10730
  {
9678
10731
  "name": "content_versions_slug_context_idx",
9679
10732
  "columns": [
9680
10733
  "slug",
9681
10734
  "context"
9682
- ],
9683
- "unique": true
10735
+ ]
9684
10736
  },
9685
10737
  {
9686
- "name": "content_versions_created_at_idx",
10738
+ "name": "content_versions_tenant_id_created_at_idx",
9687
10739
  "columns": [
10740
+ "tenant_id",
9688
10741
  "created_at"
9689
10742
  ]
9690
10743
  }
9691
10744
  ],
9692
- "version": "56acd806"
10745
+ "version": "66cda211"
9693
10746
  }
9694
10747
  },
9695
10748
  "@happyvertical/smrt-content:Content": {
@@ -11053,7 +12106,8 @@
11053
12106
  "context",
11054
12107
  "_meta_type"
11055
12108
  ],
11056
- "unique": true
12109
+ "unique": true,
12110
+ "nullsNotDistinct": true
11057
12111
  },
11058
12112
  {
11059
12113
  "name": "contents_meta_type_idx",
@@ -11371,7 +12425,7 @@
11371
12425
  ],
11372
12426
  "schema": {
11373
12427
  "tableName": "contents",
11374
- "ddl": "CREATE TABLE IF NOT EXISTS \"contents\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"content_dir\" TEXT,\n \"loaded\" JSON NOT NULL\n);",
12428
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contents\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"type\" TEXT,\n \"variant\" TEXT,\n \"file_key\" TEXT,\n \"author\" TEXT,\n \"name\" TEXT DEFAULT '',\n \"title\" TEXT,\n \"description\" TEXT,\n \"body\" TEXT,\n \"body_format\" TEXT,\n \"publish_date\" TIMESTAMP,\n \"url\" TEXT,\n \"source\" TEXT,\n \"original_url\" TEXT,\n \"language\" TEXT,\n \"tags\" JSON DEFAULT '[]',\n \"category\" TEXT,\n \"status\" TEXT DEFAULT 'draft',\n \"state\" TEXT DEFAULT 'active',\n \"metadata\" JSON DEFAULT '{}',\n \"thumbnail_asset_id\" UUID,\n \"feed_source_id\" UUID,\n \"source_guid\" TEXT,\n \"source_name\" TEXT,\n \"source_homepage_url\" TEXT,\n \"external_url\" TEXT,\n \"original_published_at\" TIMESTAMP,\n \"dedupe_key\" TEXT\n);",
11375
12429
  "columns": {
11376
12430
  "id": {
11377
12431
  "type": "UUID",
@@ -11388,6 +12442,14 @@
11388
12442
  "notNull": true,
11389
12443
  "default": ""
11390
12444
  },
12445
+ "_meta_type": {
12446
+ "type": "TEXT",
12447
+ "notNull": true
12448
+ },
12449
+ "_meta_data": {
12450
+ "type": "JSON",
12451
+ "notNull": false
12452
+ },
11391
12453
  "created_at": {
11392
12454
  "type": "TIMESTAMP",
11393
12455
  "notNull": true,
@@ -11398,34 +12460,179 @@
11398
12460
  "notNull": true,
11399
12461
  "default": "current_timestamp"
11400
12462
  },
11401
- "content_dir": {
12463
+ "tenant_id": {
12464
+ "type": "UUID",
12465
+ "referenceKind": "tenantId",
12466
+ "notNull": false
12467
+ },
12468
+ "type": {
12469
+ "type": "TEXT",
12470
+ "notNull": false
12471
+ },
12472
+ "variant": {
12473
+ "type": "TEXT",
12474
+ "notNull": false
12475
+ },
12476
+ "file_key": {
12477
+ "type": "TEXT",
12478
+ "notNull": false
12479
+ },
12480
+ "author": {
12481
+ "type": "TEXT",
12482
+ "notNull": false
12483
+ },
12484
+ "name": {
11402
12485
  "type": "TEXT",
11403
12486
  "notNull": false,
11404
- "unique": false
12487
+ "default": ""
12488
+ },
12489
+ "title": {
12490
+ "type": "TEXT",
12491
+ "notNull": false
12492
+ },
12493
+ "description": {
12494
+ "type": "TEXT",
12495
+ "notNull": false
12496
+ },
12497
+ "body": {
12498
+ "type": "TEXT",
12499
+ "notNull": false
12500
+ },
12501
+ "body_format": {
12502
+ "type": "TEXT",
12503
+ "notNull": false
12504
+ },
12505
+ "publish_date": {
12506
+ "type": "TIMESTAMP",
12507
+ "notNull": false
12508
+ },
12509
+ "url": {
12510
+ "type": "TEXT",
12511
+ "notNull": false
12512
+ },
12513
+ "source": {
12514
+ "type": "TEXT",
12515
+ "notNull": false
12516
+ },
12517
+ "original_url": {
12518
+ "type": "TEXT",
12519
+ "notNull": false
12520
+ },
12521
+ "language": {
12522
+ "type": "TEXT",
12523
+ "notNull": false
11405
12524
  },
11406
- "loaded": {
12525
+ "tags": {
11407
12526
  "type": "JSON",
11408
- "notNull": true,
11409
- "unique": false
12527
+ "notNull": false,
12528
+ "default": []
12529
+ },
12530
+ "category": {
12531
+ "type": "TEXT",
12532
+ "notNull": false
12533
+ },
12534
+ "status": {
12535
+ "type": "TEXT",
12536
+ "notNull": false,
12537
+ "default": "draft"
12538
+ },
12539
+ "state": {
12540
+ "type": "TEXT",
12541
+ "notNull": false,
12542
+ "default": "active"
12543
+ },
12544
+ "metadata": {
12545
+ "type": "JSON",
12546
+ "notNull": false,
12547
+ "default": {}
12548
+ },
12549
+ "thumbnail_asset_id": {
12550
+ "type": "UUID",
12551
+ "referenceKind": "crossPackageRef",
12552
+ "notNull": false
12553
+ },
12554
+ "feed_source_id": {
12555
+ "type": "UUID",
12556
+ "referenceKind": "foreignKey",
12557
+ "notNull": false,
12558
+ "foreignKey": {
12559
+ "table": "content_feed_sources",
12560
+ "column": "id",
12561
+ "onDelete": "NO ACTION",
12562
+ "onUpdate": "CASCADE"
12563
+ }
12564
+ },
12565
+ "source_guid": {
12566
+ "type": "TEXT",
12567
+ "notNull": false
12568
+ },
12569
+ "source_name": {
12570
+ "type": "TEXT",
12571
+ "notNull": false
12572
+ },
12573
+ "source_homepage_url": {
12574
+ "type": "TEXT",
12575
+ "notNull": false
12576
+ },
12577
+ "external_url": {
12578
+ "type": "TEXT",
12579
+ "notNull": false
12580
+ },
12581
+ "original_published_at": {
12582
+ "type": "TIMESTAMP",
12583
+ "notNull": false
12584
+ },
12585
+ "dedupe_key": {
12586
+ "type": "TEXT",
12587
+ "notNull": false
11410
12588
  }
11411
12589
  },
11412
12590
  "indexes": [
11413
12591
  {
11414
- "name": "contents_slug_context_idx",
12592
+ "name": "contents_slug_context_meta_type_idx",
11415
12593
  "columns": [
12594
+ "tenant_id",
11416
12595
  "slug",
11417
- "context"
12596
+ "context",
12597
+ "_meta_type"
11418
12598
  ],
11419
- "unique": true
12599
+ "unique": true,
12600
+ "nullsNotDistinct": true
12601
+ },
12602
+ {
12603
+ "name": "contents_meta_type_idx",
12604
+ "columns": [
12605
+ "_meta_type"
12606
+ ]
12607
+ },
12608
+ {
12609
+ "name": "contents_tenant_id_publish_date_idx",
12610
+ "columns": [
12611
+ "tenant_id",
12612
+ "publish_date"
12613
+ ]
11420
12614
  },
11421
12615
  {
11422
- "name": "contents_created_at_idx",
12616
+ "name": "contents_tenant_id_created_at_idx",
11423
12617
  "columns": [
12618
+ "tenant_id",
11424
12619
  "created_at"
11425
12620
  ]
12621
+ },
12622
+ {
12623
+ "name": "contents_thumbnail_asset_id_idx",
12624
+ "columns": [
12625
+ "thumbnail_asset_id"
12626
+ ]
12627
+ },
12628
+ {
12629
+ "name": "contents_feed_source_id_idx",
12630
+ "columns": [
12631
+ "feed_source_id"
12632
+ ]
11426
12633
  }
11427
12634
  ],
11428
- "version": "c11f9ec0"
12635
+ "version": "40e4ddf4"
11429
12636
  }
11430
12637
  }
11431
12638
  },
@@ -11440,6 +12647,7 @@
11440
12647
  "@happyvertical/smrt-messages",
11441
12648
  "@happyvertical/smrt-profiles",
11442
12649
  "@happyvertical/smrt-prompts",
11443
- "@happyvertical/smrt-tenancy"
12650
+ "@happyvertical/smrt-tenancy",
12651
+ "@happyvertical/smrt-users"
11444
12652
  ]
11445
12653
  }