From 3033285a0b9eaad7447ecc58b200ca9c4a679414 Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Thu, 30 Jan 2025 01:36:45 -0500 Subject: [PATCH 1/4] schema --- backend/src/Logitar.Cms.Infrastructure/CmsContext.cs | 2 ++ backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentLocales.cs | 2 +- backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentTypes.cs | 2 +- backend/src/Logitar.Cms.Infrastructure/CmsDb/Contents.cs | 2 +- .../src/Logitar.Cms.Infrastructure/CmsDb/FieldDefinitions.cs | 2 +- backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldIndex.cs | 2 +- backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldTypes.cs | 2 +- backend/src/Logitar.Cms.Infrastructure/CmsDb/Languages.cs | 2 +- .../src/Logitar.Cms.Infrastructure/CmsDb/PublishedContents.cs | 2 +- backend/src/Logitar.Cms.Infrastructure/CmsDb/UniqueIndex.cs | 2 +- 10 files changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsContext.cs b/backend/src/Logitar.Cms.Infrastructure/CmsContext.cs index e5aeec80..00e7ccd1 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsContext.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsContext.cs @@ -5,6 +5,8 @@ namespace Logitar.Cms.Infrastructure; public class CmsContext : DbContext { + public const string Schema = "Cms"; + public CmsContext(DbContextOptions options) : base(options) { } diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentLocales.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentLocales.cs index 69753f33..cf843beb 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentLocales.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentLocales.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class ContentLocales { - public static readonly TableId Table = new(nameof(CmsContext.ContentLocales)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.ContentLocales), alias: null); public static readonly ColumnId CreatedBy = new(nameof(ContentLocaleEntity.CreatedBy), Table); public static readonly ColumnId CreatedOn = new(nameof(ContentLocaleEntity.CreatedOn), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentTypes.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentTypes.cs index 08d0f844..bd30b965 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentTypes.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/ContentTypes.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class ContentTypes { - public static readonly TableId Table = new(nameof(CmsContext.ContentTypes)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.ContentTypes), alias: null); public static readonly ColumnId CreatedBy = new(nameof(ContentTypeEntity.CreatedBy), Table); public static readonly ColumnId CreatedOn = new(nameof(ContentTypeEntity.CreatedOn), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/Contents.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/Contents.cs index 0af0b05e..8aa78147 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/Contents.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/Contents.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class Contents { - public static readonly TableId Table = new(nameof(CmsContext.Contents)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.Contents), alias: null); public static readonly ColumnId CreatedBy = new(nameof(ContentEntity.CreatedBy), Table); public static readonly ColumnId CreatedOn = new(nameof(ContentEntity.CreatedOn), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldDefinitions.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldDefinitions.cs index f5b21180..7120337a 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldDefinitions.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldDefinitions.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class FieldDefinitions { - public static readonly TableId Table = new(nameof(CmsContext.FieldDefinitions)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.FieldDefinitions), alias: null); public static readonly ColumnId ContentTypeId = new(nameof(FieldDefinitionEntity.ContentTypeId), Table); public static readonly ColumnId Description = new(nameof(FieldDefinitionEntity.Description), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldIndex.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldIndex.cs index 04df08ff..bf01ed22 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldIndex.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldIndex.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class FieldIndex { - public static readonly TableId Table = new(nameof(CmsContext.FieldIndex)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.FieldIndex), alias: null); public static readonly ColumnId ContentId = new(nameof(FieldIndexEntity.ContentId), Table); public static readonly ColumnId ContentLocaleId = new(nameof(FieldIndexEntity.ContentLocaleId), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldTypes.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldTypes.cs index 43617725..a2e0ea95 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldTypes.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/FieldTypes.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class FieldTypes { - public static readonly TableId Table = new(nameof(CmsContext.FieldTypes)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.FieldTypes), alias: null); public static readonly ColumnId CreatedBy = new(nameof(FieldTypeEntity.CreatedBy), Table); public static readonly ColumnId CreatedOn = new(nameof(FieldTypeEntity.CreatedOn), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/Languages.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/Languages.cs index b56e439d..6a4854ff 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/Languages.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/Languages.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class Languages { - public static readonly TableId Table = new(nameof(CmsContext.Languages)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.Languages), alias: null); public static readonly ColumnId CreatedBy = new(nameof(LanguageEntity.CreatedBy), Table); public static readonly ColumnId CreatedOn = new(nameof(LanguageEntity.CreatedOn), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/PublishedContents.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/PublishedContents.cs index f8697221..888fa81d 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/PublishedContents.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/PublishedContents.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class PublishedContents { - public static readonly TableId Table = new(nameof(CmsContext.PublishedContents)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.PublishedContents), alias: null); public static readonly ColumnId ContentId = new(nameof(PublishedContentEntity.ContentId), Table); public static readonly ColumnId ContentLocaleId = new(nameof(PublishedContentEntity.ContentLocaleId), Table); diff --git a/backend/src/Logitar.Cms.Infrastructure/CmsDb/UniqueIndex.cs b/backend/src/Logitar.Cms.Infrastructure/CmsDb/UniqueIndex.cs index b3a872cb..71e2e673 100644 --- a/backend/src/Logitar.Cms.Infrastructure/CmsDb/UniqueIndex.cs +++ b/backend/src/Logitar.Cms.Infrastructure/CmsDb/UniqueIndex.cs @@ -5,7 +5,7 @@ namespace Logitar.Cms.Infrastructure.CmsDb; public static class UniqueIndex { - public static readonly TableId Table = new(nameof(CmsContext.UniqueIndex)); + public static readonly TableId Table = new(CmsContext.Schema, nameof(CmsContext.UniqueIndex), alias: null); public static readonly ColumnId ContentId = new(nameof(UniqueIndexEntity.ContentId), Table); public static readonly ColumnId ContentLocaleId = new(nameof(UniqueIndexEntity.ContentLocaleId), Table); From 4180fe35f9ca79dcf63280aa5b202523507b931f Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Thu, 30 Jan 2025 01:37:02 -0500 Subject: [PATCH 2/4] migrations --- ...250130063448_Cms_Release_1_0_0.Designer.cs | 1185 ++++++++++++++++ .../20250130063448_Cms_Release_1_0_0.cs | 1236 +++++++++++++++++ .../Migrations/CmsContextModelSnapshot.cs | 1182 ++++++++++++++++ ...50130063047_Cms_Release_1_0_0.Designer.cs} | 20 +- ...cs => 20250130063047_Cms_Release_1_0_0.cs} | 186 ++- .../Migrations/CmsContextModelSnapshot.cs | 18 +- 6 files changed, 3799 insertions(+), 28 deletions(-) create mode 100644 backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.Designer.cs create mode 100644 backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.cs create mode 100644 backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/CmsContextModelSnapshot.cs rename backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/{20250128023410_Cms_Release_1_0_0.Designer.cs => 20250130063047_Cms_Release_1_0_0.Designer.cs} (98%) rename backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/{20250128023410_Cms_Release_1_0_0.cs => 20250130063047_Cms_Release_1_0_0.cs} (89%) diff --git a/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.Designer.cs b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.Designer.cs new file mode 100644 index 00000000..45ca6689 --- /dev/null +++ b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.Designer.cs @@ -0,0 +1,1185 @@ +// +using Logitar.Cms.Infrastructure; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Logitar.Cms.Infrastructure.PostgreSQL.Migrations +{ + [DbContext(typeof(CmsContext))] + [Migration("20250130063448_Cms_Release_1_0_0")] + partial class Cms_Release_1_0_0 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => + { + b.Property("ContentId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ContentId")); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("ContentId"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("Contents", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => + { + b.Property("ContentLocaleId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ContentLocaleId")); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldValues") + .HasColumnType("text"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("PublishedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("PublishedRevision") + .HasColumnType("bigint"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("ContentLocaleId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DisplayName"); + + b.HasIndex("IsPublished"); + + b.HasIndex("LanguageId"); + + b.HasIndex("PublishedBy"); + + b.HasIndex("PublishedOn"); + + b.HasIndex("PublishedRevision"); + + b.HasIndex("Revision"); + + b.HasIndex("UniqueName"); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("ContentId", "LanguageId") + .IsUnique(); + + b.HasIndex("ContentTypeId", "LanguageId", "UniqueNameNormalized") + .IsUnique(); + + b.ToTable("ContentLocales", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", b => + { + b.Property("ContentTypeId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ContentTypeId")); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldCount") + .HasColumnType("integer"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("IsInvariant") + .HasColumnType("boolean"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("ContentTypeId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DisplayName"); + + b.HasIndex("FieldCount"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("IsInvariant"); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UniqueName"); + + b.HasIndex("UniqueNameNormalized") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("ContentTypes", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => + { + b.Property("FieldDefinitionId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("FieldDefinitionId")); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldTypeId") + .HasColumnType("integer"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("IsIndexed") + .HasColumnType("boolean"); + + b.Property("IsInvariant") + .HasColumnType("boolean"); + + b.Property("IsRequired") + .HasColumnType("boolean"); + + b.Property("IsUnique") + .HasColumnType("boolean"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Placeholder") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("FieldDefinitionId"); + + b.HasIndex("FieldTypeId"); + + b.HasIndex("ContentTypeId", "Id") + .IsUnique(); + + b.HasIndex("ContentTypeId", "Order") + .IsUnique(); + + b.HasIndex("ContentTypeId", "UniqueNameNormalized") + .IsUnique(); + + b.ToTable("FieldDefinitions", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldIndexEntity", b => + { + b.Property("FieldIndexId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("FieldIndexId")); + + b.Property("Boolean") + .HasColumnType("boolean"); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentLocaleId") + .HasColumnType("integer"); + + b.Property("ContentLocaleName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("ContentTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeUid") + .HasColumnType("uuid"); + + b.Property("ContentUid") + .HasColumnType("uuid"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("FieldDefinitionId") + .HasColumnType("integer"); + + b.Property("FieldDefinitionName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldDefinitionUid") + .HasColumnType("uuid"); + + b.Property("FieldTypeId") + .HasColumnType("integer"); + + b.Property("FieldTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldTypeUid") + .HasColumnType("uuid"); + + b.Property("LanguageCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("LanguageIsDefault") + .HasColumnType("boolean"); + + b.Property("LanguageUid") + .HasColumnType("uuid"); + + b.Property("Number") + .HasColumnType("double precision"); + + b.Property("RelatedContent") + .HasColumnType("text"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("RichText") + .HasColumnType("text"); + + b.Property("Select") + .HasColumnType("text"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("String") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Tags") + .HasColumnType("text"); + + b.HasKey("FieldIndexId"); + + b.HasIndex("Boolean"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentLocaleId"); + + b.HasIndex("ContentLocaleName"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("ContentTypeName"); + + b.HasIndex("ContentTypeUid"); + + b.HasIndex("ContentUid"); + + b.HasIndex("DateTime"); + + b.HasIndex("FieldDefinitionId"); + + b.HasIndex("FieldDefinitionName"); + + b.HasIndex("FieldDefinitionUid"); + + b.HasIndex("FieldTypeId"); + + b.HasIndex("FieldTypeName"); + + b.HasIndex("FieldTypeUid"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("LanguageId"); + + b.HasIndex("LanguageIsDefault"); + + b.HasIndex("LanguageUid"); + + b.HasIndex("Number"); + + b.HasIndex("Revision"); + + b.HasIndex("Status"); + + b.HasIndex("String"); + + b.HasIndex("ContentLocaleId", "FieldDefinitionId", "Status") + .IsUnique(); + + b.ToTable("FieldIndex", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", b => + { + b.Property("FieldTypeId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("FieldTypeId")); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("DataType") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Settings") + .HasColumnType("text"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("FieldTypeId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DataType"); + + b.HasIndex("DisplayName"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UniqueName"); + + b.HasIndex("UniqueNameNormalized") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("FieldTypes", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.LanguageEntity", b => + { + b.Property("LanguageId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("LanguageId")); + + b.Property("Code") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("CodeNormalized") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("EnglishName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("IsDefault") + .HasColumnType("boolean"); + + b.Property("LCID") + .HasColumnType("integer"); + + b.Property("NativeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("LanguageId"); + + b.HasIndex("Code"); + + b.HasIndex("CodeNormalized") + .IsUnique(); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DisplayName"); + + b.HasIndex("EnglishName"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("IsDefault"); + + b.HasIndex("LCID"); + + b.HasIndex("NativeName"); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("Languages", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", b => + { + b.Property("ContentLocaleId") + .HasColumnType("integer"); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("ContentTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeUid") + .HasColumnType("uuid"); + + b.Property("ContentUid") + .HasColumnType("uuid"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldValues") + .HasColumnType("text"); + + b.Property("LanguageCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("LanguageIsDefault") + .HasColumnType("boolean"); + + b.Property("LanguageUid") + .HasColumnType("uuid"); + + b.Property("PublishedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("ContentLocaleId"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("ContentTypeName"); + + b.HasIndex("ContentTypeUid"); + + b.HasIndex("ContentUid"); + + b.HasIndex("DisplayName"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("LanguageId"); + + b.HasIndex("LanguageIsDefault"); + + b.HasIndex("LanguageUid"); + + b.HasIndex("PublishedBy"); + + b.HasIndex("PublishedOn"); + + b.HasIndex("Revision"); + + b.HasIndex("UniqueName"); + + b.HasIndex("UniqueNameNormalized"); + + b.ToTable("PublishedContents", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.UniqueIndexEntity", b => + { + b.Property("UniqueIndexId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UniqueIndexId")); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentLocaleId") + .HasColumnType("integer"); + + b.Property("ContentLocaleName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("ContentTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeUid") + .HasColumnType("uuid"); + + b.Property("ContentUid") + .HasColumnType("uuid"); + + b.Property("FieldDefinitionId") + .HasColumnType("integer"); + + b.Property("FieldDefinitionName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldDefinitionUid") + .HasColumnType("uuid"); + + b.Property("FieldTypeId") + .HasColumnType("integer"); + + b.Property("FieldTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldTypeUid") + .HasColumnType("uuid"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(278) + .HasColumnType("character varying(278)"); + + b.Property("LanguageCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("LanguageIsDefault") + .HasColumnType("boolean"); + + b.Property("LanguageUid") + .HasColumnType("uuid"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ValueNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("UniqueIndexId"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentLocaleId"); + + b.HasIndex("ContentLocaleName"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("ContentTypeName"); + + b.HasIndex("ContentTypeUid"); + + b.HasIndex("ContentUid"); + + b.HasIndex("FieldDefinitionId"); + + b.HasIndex("FieldDefinitionName"); + + b.HasIndex("FieldDefinitionUid"); + + b.HasIndex("FieldTypeId"); + + b.HasIndex("FieldTypeName"); + + b.HasIndex("FieldTypeUid"); + + b.HasIndex("Key"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("LanguageId"); + + b.HasIndex("LanguageIsDefault"); + + b.HasIndex("LanguageUid"); + + b.HasIndex("Revision"); + + b.HasIndex("Status"); + + b.HasIndex("Value"); + + b.HasIndex("ValueNormalized"); + + b.HasIndex("FieldDefinitionId", "LanguageId", "Status", "ValueNormalized") + .IsUnique(); + + b.ToTable("UniqueIndex", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("Contents") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContentType"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("Locales") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("ContentLocales") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("ContentLocales") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Content"); + + b.Navigation("ContentType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("Fields") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", "FieldType") + .WithMany("FieldDefinitions") + .HasForeignKey("FieldTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContentType"); + + b.Navigation("FieldType"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldIndexEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("FieldIndex") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", "ContentLocale") + .WithMany("FieldIndex") + .HasForeignKey("ContentLocaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("FieldIndex") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", "FieldDefinition") + .WithMany("FieldIndex") + .HasForeignKey("FieldDefinitionId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", "FieldType") + .WithMany("FieldIndex") + .HasForeignKey("FieldTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("FieldIndex") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Content"); + + b.Navigation("ContentLocale"); + + b.Navigation("ContentType"); + + b.Navigation("FieldDefinition"); + + b.Navigation("FieldType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("PublishedContents") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", "ContentLocale") + .WithOne("PublishedContent") + .HasForeignKey("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", "ContentLocaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("PublishedContents") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("PublishedContents") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Content"); + + b.Navigation("ContentLocale"); + + b.Navigation("ContentType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.UniqueIndexEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("UniqueIndex") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", "ContentLocale") + .WithMany("UniqueIndex") + .HasForeignKey("ContentLocaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("UniqueIndex") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", "FieldDefinition") + .WithMany("UniqueIndex") + .HasForeignKey("FieldDefinitionId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", "FieldType") + .WithMany("UniqueIndex") + .HasForeignKey("FieldTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("UniqueIndex") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Content"); + + b.Navigation("ContentLocale"); + + b.Navigation("ContentType"); + + b.Navigation("FieldDefinition"); + + b.Navigation("FieldType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => + { + b.Navigation("FieldIndex"); + + b.Navigation("Locales"); + + b.Navigation("PublishedContents"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => + { + b.Navigation("FieldIndex"); + + b.Navigation("PublishedContent"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", b => + { + b.Navigation("ContentLocales"); + + b.Navigation("Contents"); + + b.Navigation("FieldIndex"); + + b.Navigation("Fields"); + + b.Navigation("PublishedContents"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => + { + b.Navigation("FieldIndex"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", b => + { + b.Navigation("FieldDefinitions"); + + b.Navigation("FieldIndex"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.LanguageEntity", b => + { + b.Navigation("ContentLocales"); + + b.Navigation("FieldIndex"); + + b.Navigation("PublishedContents"); + + b.Navigation("UniqueIndex"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.cs b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.cs new file mode 100644 index 00000000..b74df592 --- /dev/null +++ b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/20250130063448_Cms_Release_1_0_0.cs @@ -0,0 +1,1236 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Logitar.Cms.Infrastructure.PostgreSQL.Migrations +{ + /// + public partial class Cms_Release_1_0_0 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.EnsureSchema( + name: "Cms"); + + migrationBuilder.CreateTable( + name: "ContentTypes", + schema: "Cms", + columns: table => new + { + ContentTypeId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Id = table.Column(type: "uuid", nullable: false), + IsInvariant = table.Column(type: "boolean", nullable: false), + UniqueName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + UniqueNameNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + Description = table.Column(type: "text", nullable: true), + FieldCount = table.Column(type: "integer", nullable: false), + StreamId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Version = table.Column(type: "bigint", nullable: false), + CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ContentTypes", x => x.ContentTypeId); + }); + + migrationBuilder.CreateTable( + name: "FieldTypes", + schema: "Cms", + columns: table => new + { + FieldTypeId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Id = table.Column(type: "uuid", nullable: false), + UniqueName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + UniqueNameNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + Description = table.Column(type: "text", nullable: true), + DataType = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Settings = table.Column(type: "text", nullable: true), + StreamId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Version = table.Column(type: "bigint", nullable: false), + CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FieldTypes", x => x.FieldTypeId); + }); + + migrationBuilder.CreateTable( + name: "Languages", + schema: "Cms", + columns: table => new + { + LanguageId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Id = table.Column(type: "uuid", nullable: false), + IsDefault = table.Column(type: "boolean", nullable: false), + LCID = table.Column(type: "integer", nullable: false), + Code = table.Column(type: "character varying(16)", maxLength: 16, nullable: false), + CodeNormalized = table.Column(type: "character varying(16)", maxLength: 16, nullable: false), + DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + EnglishName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + NativeName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + StreamId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Version = table.Column(type: "bigint", nullable: false), + CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Languages", x => x.LanguageId); + }); + + migrationBuilder.CreateTable( + name: "Contents", + schema: "Cms", + columns: table => new + { + ContentId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Id = table.Column(type: "uuid", nullable: false), + ContentTypeId = table.Column(type: "integer", nullable: false), + StreamId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Version = table.Column(type: "bigint", nullable: false), + CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Contents", x => x.ContentId); + table.ForeignKey( + name: "FK_Contents_ContentTypes_ContentTypeId", + column: x => x.ContentTypeId, + principalSchema: "Cms", + principalTable: "ContentTypes", + principalColumn: "ContentTypeId", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "FieldDefinitions", + schema: "Cms", + columns: table => new + { + FieldDefinitionId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ContentTypeId = table.Column(type: "integer", nullable: false), + Id = table.Column(type: "uuid", nullable: false), + Order = table.Column(type: "integer", nullable: false), + FieldTypeId = table.Column(type: "integer", nullable: false), + IsInvariant = table.Column(type: "boolean", nullable: false), + IsRequired = table.Column(type: "boolean", nullable: false), + IsIndexed = table.Column(type: "boolean", nullable: false), + IsUnique = table.Column(type: "boolean", nullable: false), + UniqueName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + UniqueNameNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + Description = table.Column(type: "text", nullable: true), + Placeholder = table.Column(type: "character varying(255)", maxLength: 255, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_FieldDefinitions", x => x.FieldDefinitionId); + table.ForeignKey( + name: "FK_FieldDefinitions_ContentTypes_ContentTypeId", + column: x => x.ContentTypeId, + principalSchema: "Cms", + principalTable: "ContentTypes", + principalColumn: "ContentTypeId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_FieldDefinitions_FieldTypes_FieldTypeId", + column: x => x.FieldTypeId, + principalSchema: "Cms", + principalTable: "FieldTypes", + principalColumn: "FieldTypeId", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ContentLocales", + schema: "Cms", + columns: table => new + { + ContentLocaleId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ContentTypeId = table.Column(type: "integer", nullable: false), + ContentId = table.Column(type: "integer", nullable: false), + LanguageId = table.Column(type: "integer", nullable: true), + UniqueName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + UniqueNameNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + Description = table.Column(type: "text", nullable: true), + FieldValues = table.Column(type: "text", nullable: true), + Revision = table.Column(type: "bigint", nullable: false), + CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false), + IsPublished = table.Column(type: "boolean", nullable: false), + PublishedRevision = table.Column(type: "bigint", nullable: true), + PublishedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + PublishedOn = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ContentLocales", x => x.ContentLocaleId); + table.ForeignKey( + name: "FK_ContentLocales_ContentTypes_ContentTypeId", + column: x => x.ContentTypeId, + principalSchema: "Cms", + principalTable: "ContentTypes", + principalColumn: "ContentTypeId", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ContentLocales_Contents_ContentId", + column: x => x.ContentId, + principalSchema: "Cms", + principalTable: "Contents", + principalColumn: "ContentId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_ContentLocales_Languages_LanguageId", + column: x => x.LanguageId, + principalSchema: "Cms", + principalTable: "Languages", + principalColumn: "LanguageId", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "FieldIndex", + schema: "Cms", + columns: table => new + { + FieldIndexId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ContentTypeId = table.Column(type: "integer", nullable: false), + ContentTypeUid = table.Column(type: "uuid", nullable: false), + ContentTypeName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + LanguageId = table.Column(type: "integer", nullable: true), + LanguageUid = table.Column(type: "uuid", nullable: true), + LanguageCode = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + LanguageIsDefault = table.Column(type: "boolean", nullable: false), + FieldTypeId = table.Column(type: "integer", nullable: false), + FieldTypeUid = table.Column(type: "uuid", nullable: false), + FieldTypeName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + FieldDefinitionId = table.Column(type: "integer", nullable: false), + FieldDefinitionUid = table.Column(type: "uuid", nullable: false), + FieldDefinitionName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + ContentId = table.Column(type: "integer", nullable: false), + ContentUid = table.Column(type: "uuid", nullable: false), + ContentLocaleId = table.Column(type: "integer", nullable: false), + ContentLocaleName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Revision = table.Column(type: "bigint", nullable: false), + Status = table.Column(type: "character varying(10)", maxLength: 10, nullable: false), + Boolean = table.Column(type: "boolean", nullable: true), + DateTime = table.Column(type: "timestamp with time zone", nullable: true), + Number = table.Column(type: "double precision", nullable: true), + RelatedContent = table.Column(type: "text", nullable: true), + RichText = table.Column(type: "text", nullable: true), + Select = table.Column(type: "text", nullable: true), + String = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + Tags = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_FieldIndex", x => x.FieldIndexId); + table.ForeignKey( + name: "FK_FieldIndex_ContentLocales_ContentLocaleId", + column: x => x.ContentLocaleId, + principalSchema: "Cms", + principalTable: "ContentLocales", + principalColumn: "ContentLocaleId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_FieldIndex_ContentTypes_ContentTypeId", + column: x => x.ContentTypeId, + principalSchema: "Cms", + principalTable: "ContentTypes", + principalColumn: "ContentTypeId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_FieldIndex_Contents_ContentId", + column: x => x.ContentId, + principalSchema: "Cms", + principalTable: "Contents", + principalColumn: "ContentId"); + table.ForeignKey( + name: "FK_FieldIndex_FieldDefinitions_FieldDefinitionId", + column: x => x.FieldDefinitionId, + principalSchema: "Cms", + principalTable: "FieldDefinitions", + principalColumn: "FieldDefinitionId"); + table.ForeignKey( + name: "FK_FieldIndex_FieldTypes_FieldTypeId", + column: x => x.FieldTypeId, + principalSchema: "Cms", + principalTable: "FieldTypes", + principalColumn: "FieldTypeId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_FieldIndex_Languages_LanguageId", + column: x => x.LanguageId, + principalSchema: "Cms", + principalTable: "Languages", + principalColumn: "LanguageId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "PublishedContents", + schema: "Cms", + columns: table => new + { + ContentLocaleId = table.Column(type: "integer", nullable: false), + ContentId = table.Column(type: "integer", nullable: false), + ContentUid = table.Column(type: "uuid", nullable: false), + ContentTypeId = table.Column(type: "integer", nullable: false), + ContentTypeUid = table.Column(type: "uuid", nullable: false), + ContentTypeName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + LanguageId = table.Column(type: "integer", nullable: true), + LanguageUid = table.Column(type: "uuid", nullable: true), + LanguageCode = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + LanguageIsDefault = table.Column(type: "boolean", nullable: false), + UniqueName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + UniqueNameNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + Description = table.Column(type: "text", nullable: true), + FieldValues = table.Column(type: "text", nullable: true), + Revision = table.Column(type: "bigint", nullable: false), + PublishedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), + PublishedOn = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PublishedContents", x => x.ContentLocaleId); + table.ForeignKey( + name: "FK_PublishedContents_ContentLocales_ContentLocaleId", + column: x => x.ContentLocaleId, + principalSchema: "Cms", + principalTable: "ContentLocales", + principalColumn: "ContentLocaleId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_PublishedContents_ContentTypes_ContentTypeId", + column: x => x.ContentTypeId, + principalSchema: "Cms", + principalTable: "ContentTypes", + principalColumn: "ContentTypeId", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_PublishedContents_Contents_ContentId", + column: x => x.ContentId, + principalSchema: "Cms", + principalTable: "Contents", + principalColumn: "ContentId", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_PublishedContents_Languages_LanguageId", + column: x => x.LanguageId, + principalSchema: "Cms", + principalTable: "Languages", + principalColumn: "LanguageId", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "UniqueIndex", + schema: "Cms", + columns: table => new + { + UniqueIndexId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ContentTypeId = table.Column(type: "integer", nullable: false), + ContentTypeUid = table.Column(type: "uuid", nullable: false), + ContentTypeName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + LanguageId = table.Column(type: "integer", nullable: true), + LanguageUid = table.Column(type: "uuid", nullable: true), + LanguageCode = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + LanguageIsDefault = table.Column(type: "boolean", nullable: false), + FieldTypeId = table.Column(type: "integer", nullable: false), + FieldTypeUid = table.Column(type: "uuid", nullable: false), + FieldTypeName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + FieldDefinitionId = table.Column(type: "integer", nullable: false), + FieldDefinitionUid = table.Column(type: "uuid", nullable: false), + FieldDefinitionName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Revision = table.Column(type: "bigint", nullable: false), + Status = table.Column(type: "character varying(10)", maxLength: 10, nullable: false), + Value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + ValueNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + Key = table.Column(type: "character varying(278)", maxLength: 278, nullable: false), + ContentId = table.Column(type: "integer", nullable: false), + ContentUid = table.Column(type: "uuid", nullable: false), + ContentLocaleId = table.Column(type: "integer", nullable: false), + ContentLocaleName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UniqueIndex", x => x.UniqueIndexId); + table.ForeignKey( + name: "FK_UniqueIndex_ContentLocales_ContentLocaleId", + column: x => x.ContentLocaleId, + principalSchema: "Cms", + principalTable: "ContentLocales", + principalColumn: "ContentLocaleId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_UniqueIndex_ContentTypes_ContentTypeId", + column: x => x.ContentTypeId, + principalSchema: "Cms", + principalTable: "ContentTypes", + principalColumn: "ContentTypeId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_UniqueIndex_Contents_ContentId", + column: x => x.ContentId, + principalSchema: "Cms", + principalTable: "Contents", + principalColumn: "ContentId"); + table.ForeignKey( + name: "FK_UniqueIndex_FieldDefinitions_FieldDefinitionId", + column: x => x.FieldDefinitionId, + principalSchema: "Cms", + principalTable: "FieldDefinitions", + principalColumn: "FieldDefinitionId"); + table.ForeignKey( + name: "FK_UniqueIndex_FieldTypes_FieldTypeId", + column: x => x.FieldTypeId, + principalSchema: "Cms", + principalTable: "FieldTypes", + principalColumn: "FieldTypeId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_UniqueIndex_Languages_LanguageId", + column: x => x.LanguageId, + principalSchema: "Cms", + principalTable: "Languages", + principalColumn: "LanguageId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_ContentId_LanguageId", + schema: "Cms", + table: "ContentLocales", + columns: new[] { "ContentId", "LanguageId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_ContentTypeId_LanguageId_UniqueNameNormalized", + schema: "Cms", + table: "ContentLocales", + columns: new[] { "ContentTypeId", "LanguageId", "UniqueNameNormalized" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_CreatedBy", + schema: "Cms", + table: "ContentLocales", + column: "CreatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_CreatedOn", + schema: "Cms", + table: "ContentLocales", + column: "CreatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_DisplayName", + schema: "Cms", + table: "ContentLocales", + column: "DisplayName"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_IsPublished", + schema: "Cms", + table: "ContentLocales", + column: "IsPublished"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_LanguageId", + schema: "Cms", + table: "ContentLocales", + column: "LanguageId"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_PublishedBy", + schema: "Cms", + table: "ContentLocales", + column: "PublishedBy"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_PublishedOn", + schema: "Cms", + table: "ContentLocales", + column: "PublishedOn"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_PublishedRevision", + schema: "Cms", + table: "ContentLocales", + column: "PublishedRevision"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_Revision", + schema: "Cms", + table: "ContentLocales", + column: "Revision"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_UniqueName", + schema: "Cms", + table: "ContentLocales", + column: "UniqueName"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_UpdatedBy", + schema: "Cms", + table: "ContentLocales", + column: "UpdatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_ContentLocales_UpdatedOn", + schema: "Cms", + table: "ContentLocales", + column: "UpdatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_Contents_ContentTypeId", + schema: "Cms", + table: "Contents", + column: "ContentTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Contents_CreatedBy", + schema: "Cms", + table: "Contents", + column: "CreatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_Contents_CreatedOn", + schema: "Cms", + table: "Contents", + column: "CreatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_Contents_Id", + schema: "Cms", + table: "Contents", + column: "Id", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Contents_StreamId", + schema: "Cms", + table: "Contents", + column: "StreamId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Contents_UpdatedBy", + schema: "Cms", + table: "Contents", + column: "UpdatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_Contents_UpdatedOn", + schema: "Cms", + table: "Contents", + column: "UpdatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_Contents_Version", + schema: "Cms", + table: "Contents", + column: "Version"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_CreatedBy", + schema: "Cms", + table: "ContentTypes", + column: "CreatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_CreatedOn", + schema: "Cms", + table: "ContentTypes", + column: "CreatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_DisplayName", + schema: "Cms", + table: "ContentTypes", + column: "DisplayName"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_FieldCount", + schema: "Cms", + table: "ContentTypes", + column: "FieldCount"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_Id", + schema: "Cms", + table: "ContentTypes", + column: "Id", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_IsInvariant", + schema: "Cms", + table: "ContentTypes", + column: "IsInvariant"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_StreamId", + schema: "Cms", + table: "ContentTypes", + column: "StreamId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_UniqueName", + schema: "Cms", + table: "ContentTypes", + column: "UniqueName"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_UniqueNameNormalized", + schema: "Cms", + table: "ContentTypes", + column: "UniqueNameNormalized", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_UpdatedBy", + schema: "Cms", + table: "ContentTypes", + column: "UpdatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_UpdatedOn", + schema: "Cms", + table: "ContentTypes", + column: "UpdatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_ContentTypes_Version", + schema: "Cms", + table: "ContentTypes", + column: "Version"); + + migrationBuilder.CreateIndex( + name: "IX_FieldDefinitions_ContentTypeId_Id", + schema: "Cms", + table: "FieldDefinitions", + columns: new[] { "ContentTypeId", "Id" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_FieldDefinitions_ContentTypeId_Order", + schema: "Cms", + table: "FieldDefinitions", + columns: new[] { "ContentTypeId", "Order" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_FieldDefinitions_ContentTypeId_UniqueNameNormalized", + schema: "Cms", + table: "FieldDefinitions", + columns: new[] { "ContentTypeId", "UniqueNameNormalized" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_FieldDefinitions_FieldTypeId", + schema: "Cms", + table: "FieldDefinitions", + column: "FieldTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_Boolean", + schema: "Cms", + table: "FieldIndex", + column: "Boolean"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentId", + schema: "Cms", + table: "FieldIndex", + column: "ContentId"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentLocaleId", + schema: "Cms", + table: "FieldIndex", + column: "ContentLocaleId"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentLocaleId_FieldDefinitionId_Status", + schema: "Cms", + table: "FieldIndex", + columns: new[] { "ContentLocaleId", "FieldDefinitionId", "Status" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentLocaleName", + schema: "Cms", + table: "FieldIndex", + column: "ContentLocaleName"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentTypeId", + schema: "Cms", + table: "FieldIndex", + column: "ContentTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentTypeName", + schema: "Cms", + table: "FieldIndex", + column: "ContentTypeName"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentTypeUid", + schema: "Cms", + table: "FieldIndex", + column: "ContentTypeUid"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_ContentUid", + schema: "Cms", + table: "FieldIndex", + column: "ContentUid"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_DateTime", + schema: "Cms", + table: "FieldIndex", + column: "DateTime"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_FieldDefinitionId", + schema: "Cms", + table: "FieldIndex", + column: "FieldDefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_FieldDefinitionName", + schema: "Cms", + table: "FieldIndex", + column: "FieldDefinitionName"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_FieldDefinitionUid", + schema: "Cms", + table: "FieldIndex", + column: "FieldDefinitionUid"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_FieldTypeId", + schema: "Cms", + table: "FieldIndex", + column: "FieldTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_FieldTypeName", + schema: "Cms", + table: "FieldIndex", + column: "FieldTypeName"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_FieldTypeUid", + schema: "Cms", + table: "FieldIndex", + column: "FieldTypeUid"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_LanguageCode", + schema: "Cms", + table: "FieldIndex", + column: "LanguageCode"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_LanguageId", + schema: "Cms", + table: "FieldIndex", + column: "LanguageId"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_LanguageIsDefault", + schema: "Cms", + table: "FieldIndex", + column: "LanguageIsDefault"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_LanguageUid", + schema: "Cms", + table: "FieldIndex", + column: "LanguageUid"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_Number", + schema: "Cms", + table: "FieldIndex", + column: "Number"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_Revision", + schema: "Cms", + table: "FieldIndex", + column: "Revision"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_Status", + schema: "Cms", + table: "FieldIndex", + column: "Status"); + + migrationBuilder.CreateIndex( + name: "IX_FieldIndex_String", + schema: "Cms", + table: "FieldIndex", + column: "String"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_CreatedBy", + schema: "Cms", + table: "FieldTypes", + column: "CreatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_CreatedOn", + schema: "Cms", + table: "FieldTypes", + column: "CreatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_DataType", + schema: "Cms", + table: "FieldTypes", + column: "DataType"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_DisplayName", + schema: "Cms", + table: "FieldTypes", + column: "DisplayName"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_Id", + schema: "Cms", + table: "FieldTypes", + column: "Id", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_StreamId", + schema: "Cms", + table: "FieldTypes", + column: "StreamId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_UniqueName", + schema: "Cms", + table: "FieldTypes", + column: "UniqueName"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_UniqueNameNormalized", + schema: "Cms", + table: "FieldTypes", + column: "UniqueNameNormalized", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_UpdatedBy", + schema: "Cms", + table: "FieldTypes", + column: "UpdatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_UpdatedOn", + schema: "Cms", + table: "FieldTypes", + column: "UpdatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_FieldTypes_Version", + schema: "Cms", + table: "FieldTypes", + column: "Version"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_Code", + schema: "Cms", + table: "Languages", + column: "Code"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_CodeNormalized", + schema: "Cms", + table: "Languages", + column: "CodeNormalized", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Languages_CreatedBy", + schema: "Cms", + table: "Languages", + column: "CreatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_CreatedOn", + schema: "Cms", + table: "Languages", + column: "CreatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_DisplayName", + schema: "Cms", + table: "Languages", + column: "DisplayName"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_EnglishName", + schema: "Cms", + table: "Languages", + column: "EnglishName"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_Id", + schema: "Cms", + table: "Languages", + column: "Id", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Languages_IsDefault", + schema: "Cms", + table: "Languages", + column: "IsDefault"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_LCID", + schema: "Cms", + table: "Languages", + column: "LCID"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_NativeName", + schema: "Cms", + table: "Languages", + column: "NativeName"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_StreamId", + schema: "Cms", + table: "Languages", + column: "StreamId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Languages_UpdatedBy", + schema: "Cms", + table: "Languages", + column: "UpdatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_UpdatedOn", + schema: "Cms", + table: "Languages", + column: "UpdatedOn"); + + migrationBuilder.CreateIndex( + name: "IX_Languages_Version", + schema: "Cms", + table: "Languages", + column: "Version"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_ContentId", + schema: "Cms", + table: "PublishedContents", + column: "ContentId"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_ContentTypeId", + schema: "Cms", + table: "PublishedContents", + column: "ContentTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_ContentTypeName", + schema: "Cms", + table: "PublishedContents", + column: "ContentTypeName"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_ContentTypeUid", + schema: "Cms", + table: "PublishedContents", + column: "ContentTypeUid"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_ContentUid", + schema: "Cms", + table: "PublishedContents", + column: "ContentUid"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_DisplayName", + schema: "Cms", + table: "PublishedContents", + column: "DisplayName"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_LanguageCode", + schema: "Cms", + table: "PublishedContents", + column: "LanguageCode"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_LanguageId", + schema: "Cms", + table: "PublishedContents", + column: "LanguageId"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_LanguageIsDefault", + schema: "Cms", + table: "PublishedContents", + column: "LanguageIsDefault"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_LanguageUid", + schema: "Cms", + table: "PublishedContents", + column: "LanguageUid"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_PublishedBy", + schema: "Cms", + table: "PublishedContents", + column: "PublishedBy"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_PublishedOn", + schema: "Cms", + table: "PublishedContents", + column: "PublishedOn"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_Revision", + schema: "Cms", + table: "PublishedContents", + column: "Revision"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_UniqueName", + schema: "Cms", + table: "PublishedContents", + column: "UniqueName"); + + migrationBuilder.CreateIndex( + name: "IX_PublishedContents_UniqueNameNormalized", + schema: "Cms", + table: "PublishedContents", + column: "UniqueNameNormalized"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ContentId", + schema: "Cms", + table: "UniqueIndex", + column: "ContentId"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ContentLocaleId", + schema: "Cms", + table: "UniqueIndex", + column: "ContentLocaleId"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ContentLocaleName", + schema: "Cms", + table: "UniqueIndex", + column: "ContentLocaleName"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ContentTypeId", + schema: "Cms", + table: "UniqueIndex", + column: "ContentTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ContentTypeName", + schema: "Cms", + table: "UniqueIndex", + column: "ContentTypeName"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ContentTypeUid", + schema: "Cms", + table: "UniqueIndex", + column: "ContentTypeUid"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ContentUid", + schema: "Cms", + table: "UniqueIndex", + column: "ContentUid"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_FieldDefinitionId", + schema: "Cms", + table: "UniqueIndex", + column: "FieldDefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_FieldDefinitionId_LanguageId_Status_ValueNormal~", + schema: "Cms", + table: "UniqueIndex", + columns: new[] { "FieldDefinitionId", "LanguageId", "Status", "ValueNormalized" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_FieldDefinitionName", + schema: "Cms", + table: "UniqueIndex", + column: "FieldDefinitionName"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_FieldDefinitionUid", + schema: "Cms", + table: "UniqueIndex", + column: "FieldDefinitionUid"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_FieldTypeId", + schema: "Cms", + table: "UniqueIndex", + column: "FieldTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_FieldTypeName", + schema: "Cms", + table: "UniqueIndex", + column: "FieldTypeName"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_FieldTypeUid", + schema: "Cms", + table: "UniqueIndex", + column: "FieldTypeUid"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_Key", + schema: "Cms", + table: "UniqueIndex", + column: "Key"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_LanguageCode", + schema: "Cms", + table: "UniqueIndex", + column: "LanguageCode"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_LanguageId", + schema: "Cms", + table: "UniqueIndex", + column: "LanguageId"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_LanguageIsDefault", + schema: "Cms", + table: "UniqueIndex", + column: "LanguageIsDefault"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_LanguageUid", + schema: "Cms", + table: "UniqueIndex", + column: "LanguageUid"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_Revision", + schema: "Cms", + table: "UniqueIndex", + column: "Revision"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_Status", + schema: "Cms", + table: "UniqueIndex", + column: "Status"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_Value", + schema: "Cms", + table: "UniqueIndex", + column: "Value"); + + migrationBuilder.CreateIndex( + name: "IX_UniqueIndex_ValueNormalized", + schema: "Cms", + table: "UniqueIndex", + column: "ValueNormalized"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "FieldIndex", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "PublishedContents", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "UniqueIndex", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "ContentLocales", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "FieldDefinitions", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "Contents", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "Languages", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "FieldTypes", + schema: "Cms"); + + migrationBuilder.DropTable( + name: "ContentTypes", + schema: "Cms"); + } + } +} diff --git a/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/CmsContextModelSnapshot.cs b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/CmsContextModelSnapshot.cs new file mode 100644 index 00000000..b3a86e35 --- /dev/null +++ b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Migrations/CmsContextModelSnapshot.cs @@ -0,0 +1,1182 @@ +// +using Logitar.Cms.Infrastructure; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Logitar.Cms.Infrastructure.PostgreSQL.Migrations +{ + [DbContext(typeof(CmsContext))] + partial class CmsContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => + { + b.Property("ContentId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ContentId")); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("ContentId"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("Contents", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => + { + b.Property("ContentLocaleId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ContentLocaleId")); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldValues") + .HasColumnType("text"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("PublishedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("PublishedRevision") + .HasColumnType("bigint"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.HasKey("ContentLocaleId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DisplayName"); + + b.HasIndex("IsPublished"); + + b.HasIndex("LanguageId"); + + b.HasIndex("PublishedBy"); + + b.HasIndex("PublishedOn"); + + b.HasIndex("PublishedRevision"); + + b.HasIndex("Revision"); + + b.HasIndex("UniqueName"); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("ContentId", "LanguageId") + .IsUnique(); + + b.HasIndex("ContentTypeId", "LanguageId", "UniqueNameNormalized") + .IsUnique(); + + b.ToTable("ContentLocales", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", b => + { + b.Property("ContentTypeId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ContentTypeId")); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldCount") + .HasColumnType("integer"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("IsInvariant") + .HasColumnType("boolean"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("ContentTypeId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DisplayName"); + + b.HasIndex("FieldCount"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("IsInvariant"); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UniqueName"); + + b.HasIndex("UniqueNameNormalized") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("ContentTypes", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => + { + b.Property("FieldDefinitionId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("FieldDefinitionId")); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldTypeId") + .HasColumnType("integer"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("IsIndexed") + .HasColumnType("boolean"); + + b.Property("IsInvariant") + .HasColumnType("boolean"); + + b.Property("IsRequired") + .HasColumnType("boolean"); + + b.Property("IsUnique") + .HasColumnType("boolean"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Placeholder") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("FieldDefinitionId"); + + b.HasIndex("FieldTypeId"); + + b.HasIndex("ContentTypeId", "Id") + .IsUnique(); + + b.HasIndex("ContentTypeId", "Order") + .IsUnique(); + + b.HasIndex("ContentTypeId", "UniqueNameNormalized") + .IsUnique(); + + b.ToTable("FieldDefinitions", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldIndexEntity", b => + { + b.Property("FieldIndexId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("FieldIndexId")); + + b.Property("Boolean") + .HasColumnType("boolean"); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentLocaleId") + .HasColumnType("integer"); + + b.Property("ContentLocaleName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("ContentTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeUid") + .HasColumnType("uuid"); + + b.Property("ContentUid") + .HasColumnType("uuid"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("FieldDefinitionId") + .HasColumnType("integer"); + + b.Property("FieldDefinitionName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldDefinitionUid") + .HasColumnType("uuid"); + + b.Property("FieldTypeId") + .HasColumnType("integer"); + + b.Property("FieldTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldTypeUid") + .HasColumnType("uuid"); + + b.Property("LanguageCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("LanguageIsDefault") + .HasColumnType("boolean"); + + b.Property("LanguageUid") + .HasColumnType("uuid"); + + b.Property("Number") + .HasColumnType("double precision"); + + b.Property("RelatedContent") + .HasColumnType("text"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("RichText") + .HasColumnType("text"); + + b.Property("Select") + .HasColumnType("text"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("String") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Tags") + .HasColumnType("text"); + + b.HasKey("FieldIndexId"); + + b.HasIndex("Boolean"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentLocaleId"); + + b.HasIndex("ContentLocaleName"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("ContentTypeName"); + + b.HasIndex("ContentTypeUid"); + + b.HasIndex("ContentUid"); + + b.HasIndex("DateTime"); + + b.HasIndex("FieldDefinitionId"); + + b.HasIndex("FieldDefinitionName"); + + b.HasIndex("FieldDefinitionUid"); + + b.HasIndex("FieldTypeId"); + + b.HasIndex("FieldTypeName"); + + b.HasIndex("FieldTypeUid"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("LanguageId"); + + b.HasIndex("LanguageIsDefault"); + + b.HasIndex("LanguageUid"); + + b.HasIndex("Number"); + + b.HasIndex("Revision"); + + b.HasIndex("Status"); + + b.HasIndex("String"); + + b.HasIndex("ContentLocaleId", "FieldDefinitionId", "Status") + .IsUnique(); + + b.ToTable("FieldIndex", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", b => + { + b.Property("FieldTypeId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("FieldTypeId")); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("DataType") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Settings") + .HasColumnType("text"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("FieldTypeId"); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DataType"); + + b.HasIndex("DisplayName"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UniqueName"); + + b.HasIndex("UniqueNameNormalized") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("FieldTypes", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.LanguageEntity", b => + { + b.Property("LanguageId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("LanguageId")); + + b.Property("Code") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("CodeNormalized") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("CreatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("EnglishName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("IsDefault") + .HasColumnType("boolean"); + + b.Property("LCID") + .HasColumnType("integer"); + + b.Property("NativeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("StreamId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("LanguageId"); + + b.HasIndex("Code"); + + b.HasIndex("CodeNormalized") + .IsUnique(); + + b.HasIndex("CreatedBy"); + + b.HasIndex("CreatedOn"); + + b.HasIndex("DisplayName"); + + b.HasIndex("EnglishName"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("IsDefault"); + + b.HasIndex("LCID"); + + b.HasIndex("NativeName"); + + b.HasIndex("StreamId") + .IsUnique(); + + b.HasIndex("UpdatedBy"); + + b.HasIndex("UpdatedOn"); + + b.HasIndex("Version"); + + b.ToTable("Languages", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", b => + { + b.Property("ContentLocaleId") + .HasColumnType("integer"); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("ContentTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeUid") + .HasColumnType("uuid"); + + b.Property("ContentUid") + .HasColumnType("uuid"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldValues") + .HasColumnType("text"); + + b.Property("LanguageCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("LanguageIsDefault") + .HasColumnType("boolean"); + + b.Property("LanguageUid") + .HasColumnType("uuid"); + + b.Property("PublishedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("UniqueName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("UniqueNameNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("ContentLocaleId"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("ContentTypeName"); + + b.HasIndex("ContentTypeUid"); + + b.HasIndex("ContentUid"); + + b.HasIndex("DisplayName"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("LanguageId"); + + b.HasIndex("LanguageIsDefault"); + + b.HasIndex("LanguageUid"); + + b.HasIndex("PublishedBy"); + + b.HasIndex("PublishedOn"); + + b.HasIndex("Revision"); + + b.HasIndex("UniqueName"); + + b.HasIndex("UniqueNameNormalized"); + + b.ToTable("PublishedContents", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.UniqueIndexEntity", b => + { + b.Property("UniqueIndexId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UniqueIndexId")); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentLocaleId") + .HasColumnType("integer"); + + b.Property("ContentLocaleName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeId") + .HasColumnType("integer"); + + b.Property("ContentTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ContentTypeUid") + .HasColumnType("uuid"); + + b.Property("ContentUid") + .HasColumnType("uuid"); + + b.Property("FieldDefinitionId") + .HasColumnType("integer"); + + b.Property("FieldDefinitionName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldDefinitionUid") + .HasColumnType("uuid"); + + b.Property("FieldTypeId") + .HasColumnType("integer"); + + b.Property("FieldTypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("FieldTypeUid") + .HasColumnType("uuid"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(278) + .HasColumnType("character varying(278)"); + + b.Property("LanguageCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("LanguageId") + .HasColumnType("integer"); + + b.Property("LanguageIsDefault") + .HasColumnType("boolean"); + + b.Property("LanguageUid") + .HasColumnType("uuid"); + + b.Property("Revision") + .HasColumnType("bigint"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ValueNormalized") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("UniqueIndexId"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentLocaleId"); + + b.HasIndex("ContentLocaleName"); + + b.HasIndex("ContentTypeId"); + + b.HasIndex("ContentTypeName"); + + b.HasIndex("ContentTypeUid"); + + b.HasIndex("ContentUid"); + + b.HasIndex("FieldDefinitionId"); + + b.HasIndex("FieldDefinitionName"); + + b.HasIndex("FieldDefinitionUid"); + + b.HasIndex("FieldTypeId"); + + b.HasIndex("FieldTypeName"); + + b.HasIndex("FieldTypeUid"); + + b.HasIndex("Key"); + + b.HasIndex("LanguageCode"); + + b.HasIndex("LanguageId"); + + b.HasIndex("LanguageIsDefault"); + + b.HasIndex("LanguageUid"); + + b.HasIndex("Revision"); + + b.HasIndex("Status"); + + b.HasIndex("Value"); + + b.HasIndex("ValueNormalized"); + + b.HasIndex("FieldDefinitionId", "LanguageId", "Status", "ValueNormalized") + .IsUnique(); + + b.ToTable("UniqueIndex", "Cms"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("Contents") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContentType"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("Locales") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("ContentLocales") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("ContentLocales") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Content"); + + b.Navigation("ContentType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("Fields") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", "FieldType") + .WithMany("FieldDefinitions") + .HasForeignKey("FieldTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContentType"); + + b.Navigation("FieldType"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldIndexEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("FieldIndex") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", "ContentLocale") + .WithMany("FieldIndex") + .HasForeignKey("ContentLocaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("FieldIndex") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", "FieldDefinition") + .WithMany("FieldIndex") + .HasForeignKey("FieldDefinitionId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", "FieldType") + .WithMany("FieldIndex") + .HasForeignKey("FieldTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("FieldIndex") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Content"); + + b.Navigation("ContentLocale"); + + b.Navigation("ContentType"); + + b.Navigation("FieldDefinition"); + + b.Navigation("FieldType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("PublishedContents") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", "ContentLocale") + .WithOne("PublishedContent") + .HasForeignKey("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", "ContentLocaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("PublishedContents") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("PublishedContents") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Content"); + + b.Navigation("ContentLocale"); + + b.Navigation("ContentType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.UniqueIndexEntity", b => + { + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentEntity", "Content") + .WithMany("UniqueIndex") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", "ContentLocale") + .WithMany("UniqueIndex") + .HasForeignKey("ContentLocaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", "ContentType") + .WithMany("UniqueIndex") + .HasForeignKey("ContentTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", "FieldDefinition") + .WithMany("UniqueIndex") + .HasForeignKey("FieldDefinitionId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", "FieldType") + .WithMany("UniqueIndex") + .HasForeignKey("FieldTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Logitar.Cms.Infrastructure.Entities.LanguageEntity", "Language") + .WithMany("UniqueIndex") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Content"); + + b.Navigation("ContentLocale"); + + b.Navigation("ContentType"); + + b.Navigation("FieldDefinition"); + + b.Navigation("FieldType"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => + { + b.Navigation("FieldIndex"); + + b.Navigation("Locales"); + + b.Navigation("PublishedContents"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => + { + b.Navigation("FieldIndex"); + + b.Navigation("PublishedContent"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", b => + { + b.Navigation("ContentLocales"); + + b.Navigation("Contents"); + + b.Navigation("FieldIndex"); + + b.Navigation("Fields"); + + b.Navigation("PublishedContents"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => + { + b.Navigation("FieldIndex"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", b => + { + b.Navigation("FieldDefinitions"); + + b.Navigation("FieldIndex"); + + b.Navigation("UniqueIndex"); + }); + + modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.LanguageEntity", b => + { + b.Navigation("ContentLocales"); + + b.Navigation("FieldIndex"); + + b.Navigation("PublishedContents"); + + b.Navigation("UniqueIndex"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250128023410_Cms_Release_1_0_0.Designer.cs b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250130063047_Cms_Release_1_0_0.Designer.cs similarity index 98% rename from backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250128023410_Cms_Release_1_0_0.Designer.cs rename to backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250130063047_Cms_Release_1_0_0.Designer.cs index 23d49267..ae485125 100644 --- a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250128023410_Cms_Release_1_0_0.Designer.cs +++ b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250130063047_Cms_Release_1_0_0.Designer.cs @@ -11,7 +11,7 @@ namespace Logitar.Cms.Infrastructure.SqlServer.Migrations { [DbContext(typeof(CmsContext))] - [Migration("20250128023410_Cms_Release_1_0_0")] + [Migration("20250130063047_Cms_Release_1_0_0")] partial class Cms_Release_1_0_0 { /// @@ -80,7 +80,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("Contents", (string)null); + b.ToTable("Contents", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => @@ -184,7 +184,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsUnique() .HasFilter("[LanguageId] IS NOT NULL"); - b.ToTable("ContentLocales", (string)null); + b.ToTable("ContentLocales", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", b => @@ -272,7 +272,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("ContentTypes", (string)null); + b.ToTable("ContentTypes", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => @@ -341,7 +341,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ContentTypeId", "UniqueNameNormalized") .IsUnique(); - b.ToTable("FieldDefinitions", (string)null); + b.ToTable("FieldDefinitions", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldIndexEntity", b => @@ -496,7 +496,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("ContentLocaleId", "FieldDefinitionId", "Status") .IsUnique(); - b.ToTable("FieldIndex", (string)null); + b.ToTable("FieldIndex", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", b => @@ -584,7 +584,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("FieldTypes", (string)null); + b.ToTable("FieldTypes", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.LanguageEntity", b => @@ -684,7 +684,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("Languages", (string)null); + b.ToTable("Languages", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", b => @@ -784,7 +784,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("UniqueNameNormalized"); - b.ToTable("PublishedContents", (string)null); + b.ToTable("PublishedContents", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.UniqueIndexEntity", b => @@ -928,7 +928,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsUnique() .HasFilter("[LanguageId] IS NOT NULL"); - b.ToTable("UniqueIndex", (string)null); + b.ToTable("UniqueIndex", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => diff --git a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250128023410_Cms_Release_1_0_0.cs b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250130063047_Cms_Release_1_0_0.cs similarity index 89% rename from backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250128023410_Cms_Release_1_0_0.cs rename to backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250130063047_Cms_Release_1_0_0.cs index 06b5265a..6dbe1c7e 100644 --- a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250128023410_Cms_Release_1_0_0.cs +++ b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/20250130063047_Cms_Release_1_0_0.cs @@ -10,8 +10,12 @@ public partial class Cms_Release_1_0_0 : Migration /// protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.EnsureSchema( + name: "Cms"); + migrationBuilder.CreateTable( name: "ContentTypes", + schema: "Cms", columns: table => new { ContentTypeId = table.Column(type: "int", nullable: false) @@ -37,6 +41,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "FieldTypes", + schema: "Cms", columns: table => new { FieldTypeId = table.Column(type: "int", nullable: false) @@ -62,6 +67,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "Languages", + schema: "Cms", columns: table => new { LanguageId = table.Column(type: "int", nullable: false) @@ -88,6 +94,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "Contents", + schema: "Cms", columns: table => new { ContentId = table.Column(type: "int", nullable: false) @@ -107,6 +114,7 @@ protected override void Up(MigrationBuilder migrationBuilder) table.ForeignKey( name: "FK_Contents_ContentTypes_ContentTypeId", column: x => x.ContentTypeId, + principalSchema: "Cms", principalTable: "ContentTypes", principalColumn: "ContentTypeId", onDelete: ReferentialAction.Restrict); @@ -114,6 +122,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "FieldDefinitions", + schema: "Cms", columns: table => new { FieldDefinitionId = table.Column(type: "int", nullable: false) @@ -138,12 +147,14 @@ protected override void Up(MigrationBuilder migrationBuilder) table.ForeignKey( name: "FK_FieldDefinitions_ContentTypes_ContentTypeId", column: x => x.ContentTypeId, + principalSchema: "Cms", principalTable: "ContentTypes", principalColumn: "ContentTypeId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_FieldDefinitions_FieldTypes_FieldTypeId", column: x => x.FieldTypeId, + principalSchema: "Cms", principalTable: "FieldTypes", principalColumn: "FieldTypeId", onDelete: ReferentialAction.Restrict); @@ -151,6 +162,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "ContentLocales", + schema: "Cms", columns: table => new { ContentLocaleId = table.Column(type: "int", nullable: false) @@ -179,18 +191,21 @@ protected override void Up(MigrationBuilder migrationBuilder) table.ForeignKey( name: "FK_ContentLocales_ContentTypes_ContentTypeId", column: x => x.ContentTypeId, + principalSchema: "Cms", principalTable: "ContentTypes", principalColumn: "ContentTypeId", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_ContentLocales_Contents_ContentId", column: x => x.ContentId, + principalSchema: "Cms", principalTable: "Contents", principalColumn: "ContentId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ContentLocales_Languages_LanguageId", column: x => x.LanguageId, + principalSchema: "Cms", principalTable: "Languages", principalColumn: "LanguageId", onDelete: ReferentialAction.Restrict); @@ -198,6 +213,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "FieldIndex", + schema: "Cms", columns: table => new { FieldIndexId = table.Column(type: "int", nullable: false) @@ -236,34 +252,40 @@ protected override void Up(MigrationBuilder migrationBuilder) table.ForeignKey( name: "FK_FieldIndex_ContentLocales_ContentLocaleId", column: x => x.ContentLocaleId, + principalSchema: "Cms", principalTable: "ContentLocales", principalColumn: "ContentLocaleId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_FieldIndex_ContentTypes_ContentTypeId", column: x => x.ContentTypeId, + principalSchema: "Cms", principalTable: "ContentTypes", principalColumn: "ContentTypeId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_FieldIndex_Contents_ContentId", column: x => x.ContentId, + principalSchema: "Cms", principalTable: "Contents", principalColumn: "ContentId"); table.ForeignKey( name: "FK_FieldIndex_FieldDefinitions_FieldDefinitionId", column: x => x.FieldDefinitionId, + principalSchema: "Cms", principalTable: "FieldDefinitions", principalColumn: "FieldDefinitionId"); table.ForeignKey( name: "FK_FieldIndex_FieldTypes_FieldTypeId", column: x => x.FieldTypeId, + principalSchema: "Cms", principalTable: "FieldTypes", principalColumn: "FieldTypeId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_FieldIndex_Languages_LanguageId", column: x => x.LanguageId, + principalSchema: "Cms", principalTable: "Languages", principalColumn: "LanguageId", onDelete: ReferentialAction.Cascade); @@ -271,6 +293,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "PublishedContents", + schema: "Cms", columns: table => new { ContentLocaleId = table.Column(type: "int", nullable: false), @@ -298,24 +321,28 @@ protected override void Up(MigrationBuilder migrationBuilder) table.ForeignKey( name: "FK_PublishedContents_ContentLocales_ContentLocaleId", column: x => x.ContentLocaleId, + principalSchema: "Cms", principalTable: "ContentLocales", principalColumn: "ContentLocaleId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PublishedContents_ContentTypes_ContentTypeId", column: x => x.ContentTypeId, + principalSchema: "Cms", principalTable: "ContentTypes", principalColumn: "ContentTypeId", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_PublishedContents_Contents_ContentId", column: x => x.ContentId, + principalSchema: "Cms", principalTable: "Contents", principalColumn: "ContentId", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_PublishedContents_Languages_LanguageId", column: x => x.LanguageId, + principalSchema: "Cms", principalTable: "Languages", principalColumn: "LanguageId", onDelete: ReferentialAction.Restrict); @@ -323,6 +350,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "UniqueIndex", + schema: "Cms", columns: table => new { UniqueIndexId = table.Column(type: "int", nullable: false) @@ -356,34 +384,40 @@ protected override void Up(MigrationBuilder migrationBuilder) table.ForeignKey( name: "FK_UniqueIndex_ContentLocales_ContentLocaleId", column: x => x.ContentLocaleId, + principalSchema: "Cms", principalTable: "ContentLocales", principalColumn: "ContentLocaleId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_UniqueIndex_ContentTypes_ContentTypeId", column: x => x.ContentTypeId, + principalSchema: "Cms", principalTable: "ContentTypes", principalColumn: "ContentTypeId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_UniqueIndex_Contents_ContentId", column: x => x.ContentId, + principalSchema: "Cms", principalTable: "Contents", principalColumn: "ContentId"); table.ForeignKey( name: "FK_UniqueIndex_FieldDefinitions_FieldDefinitionId", column: x => x.FieldDefinitionId, + principalSchema: "Cms", principalTable: "FieldDefinitions", principalColumn: "FieldDefinitionId"); table.ForeignKey( name: "FK_UniqueIndex_FieldTypes_FieldTypeId", column: x => x.FieldTypeId, + principalSchema: "Cms", principalTable: "FieldTypes", principalColumn: "FieldTypeId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_UniqueIndex_Languages_LanguageId", column: x => x.LanguageId, + principalSchema: "Cms", principalTable: "Languages", principalColumn: "LanguageId", onDelete: ReferentialAction.Cascade); @@ -391,6 +425,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_ContentLocales_ContentId_LanguageId", + schema: "Cms", table: "ContentLocales", columns: new[] { "ContentId", "LanguageId" }, unique: true, @@ -398,6 +433,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_ContentLocales_ContentTypeId_LanguageId_UniqueNameNormalized", + schema: "Cms", table: "ContentLocales", columns: new[] { "ContentTypeId", "LanguageId", "UniqueNameNormalized" }, unique: true, @@ -405,561 +441,670 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_ContentLocales_CreatedBy", + schema: "Cms", table: "ContentLocales", column: "CreatedBy"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_CreatedOn", + schema: "Cms", table: "ContentLocales", column: "CreatedOn"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_DisplayName", + schema: "Cms", table: "ContentLocales", column: "DisplayName"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_IsPublished", + schema: "Cms", table: "ContentLocales", column: "IsPublished"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_LanguageId", + schema: "Cms", table: "ContentLocales", column: "LanguageId"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_PublishedBy", + schema: "Cms", table: "ContentLocales", column: "PublishedBy"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_PublishedOn", + schema: "Cms", table: "ContentLocales", column: "PublishedOn"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_PublishedRevision", + schema: "Cms", table: "ContentLocales", column: "PublishedRevision"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_Revision", + schema: "Cms", table: "ContentLocales", column: "Revision"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_UniqueName", + schema: "Cms", table: "ContentLocales", column: "UniqueName"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_UpdatedBy", + schema: "Cms", table: "ContentLocales", column: "UpdatedBy"); migrationBuilder.CreateIndex( name: "IX_ContentLocales_UpdatedOn", + schema: "Cms", table: "ContentLocales", column: "UpdatedOn"); migrationBuilder.CreateIndex( name: "IX_Contents_ContentTypeId", + schema: "Cms", table: "Contents", column: "ContentTypeId"); migrationBuilder.CreateIndex( name: "IX_Contents_CreatedBy", + schema: "Cms", table: "Contents", column: "CreatedBy"); migrationBuilder.CreateIndex( name: "IX_Contents_CreatedOn", + schema: "Cms", table: "Contents", column: "CreatedOn"); migrationBuilder.CreateIndex( name: "IX_Contents_Id", + schema: "Cms", table: "Contents", column: "Id", unique: true); migrationBuilder.CreateIndex( name: "IX_Contents_StreamId", + schema: "Cms", table: "Contents", column: "StreamId", unique: true); migrationBuilder.CreateIndex( name: "IX_Contents_UpdatedBy", + schema: "Cms", table: "Contents", column: "UpdatedBy"); migrationBuilder.CreateIndex( name: "IX_Contents_UpdatedOn", + schema: "Cms", table: "Contents", column: "UpdatedOn"); migrationBuilder.CreateIndex( name: "IX_Contents_Version", + schema: "Cms", table: "Contents", column: "Version"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_CreatedBy", + schema: "Cms", table: "ContentTypes", column: "CreatedBy"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_CreatedOn", + schema: "Cms", table: "ContentTypes", column: "CreatedOn"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_DisplayName", + schema: "Cms", table: "ContentTypes", column: "DisplayName"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_FieldCount", + schema: "Cms", table: "ContentTypes", column: "FieldCount"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_Id", + schema: "Cms", table: "ContentTypes", column: "Id", unique: true); migrationBuilder.CreateIndex( name: "IX_ContentTypes_IsInvariant", + schema: "Cms", table: "ContentTypes", column: "IsInvariant"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_StreamId", + schema: "Cms", table: "ContentTypes", column: "StreamId", unique: true); migrationBuilder.CreateIndex( name: "IX_ContentTypes_UniqueName", + schema: "Cms", table: "ContentTypes", column: "UniqueName"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_UniqueNameNormalized", + schema: "Cms", table: "ContentTypes", column: "UniqueNameNormalized", unique: true); migrationBuilder.CreateIndex( name: "IX_ContentTypes_UpdatedBy", + schema: "Cms", table: "ContentTypes", column: "UpdatedBy"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_UpdatedOn", + schema: "Cms", table: "ContentTypes", column: "UpdatedOn"); migrationBuilder.CreateIndex( name: "IX_ContentTypes_Version", + schema: "Cms", table: "ContentTypes", column: "Version"); migrationBuilder.CreateIndex( name: "IX_FieldDefinitions_ContentTypeId_Id", + schema: "Cms", table: "FieldDefinitions", columns: new[] { "ContentTypeId", "Id" }, unique: true); migrationBuilder.CreateIndex( name: "IX_FieldDefinitions_ContentTypeId_Order", + schema: "Cms", table: "FieldDefinitions", columns: new[] { "ContentTypeId", "Order" }, unique: true); migrationBuilder.CreateIndex( name: "IX_FieldDefinitions_ContentTypeId_UniqueNameNormalized", + schema: "Cms", table: "FieldDefinitions", columns: new[] { "ContentTypeId", "UniqueNameNormalized" }, unique: true); migrationBuilder.CreateIndex( name: "IX_FieldDefinitions_FieldTypeId", + schema: "Cms", table: "FieldDefinitions", column: "FieldTypeId"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_Boolean", + schema: "Cms", table: "FieldIndex", column: "Boolean"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentId", + schema: "Cms", table: "FieldIndex", column: "ContentId"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentLocaleId", + schema: "Cms", table: "FieldIndex", column: "ContentLocaleId"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentLocaleId_FieldDefinitionId_Status", + schema: "Cms", table: "FieldIndex", columns: new[] { "ContentLocaleId", "FieldDefinitionId", "Status" }, unique: true); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentLocaleName", + schema: "Cms", table: "FieldIndex", column: "ContentLocaleName"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentTypeId", + schema: "Cms", table: "FieldIndex", column: "ContentTypeId"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentTypeName", + schema: "Cms", table: "FieldIndex", column: "ContentTypeName"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentTypeUid", + schema: "Cms", table: "FieldIndex", column: "ContentTypeUid"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_ContentUid", + schema: "Cms", table: "FieldIndex", column: "ContentUid"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_DateTime", + schema: "Cms", table: "FieldIndex", column: "DateTime"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_FieldDefinitionId", + schema: "Cms", table: "FieldIndex", column: "FieldDefinitionId"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_FieldDefinitionName", + schema: "Cms", table: "FieldIndex", column: "FieldDefinitionName"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_FieldDefinitionUid", + schema: "Cms", table: "FieldIndex", column: "FieldDefinitionUid"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_FieldTypeId", + schema: "Cms", table: "FieldIndex", column: "FieldTypeId"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_FieldTypeName", + schema: "Cms", table: "FieldIndex", column: "FieldTypeName"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_FieldTypeUid", + schema: "Cms", table: "FieldIndex", column: "FieldTypeUid"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_LanguageCode", + schema: "Cms", table: "FieldIndex", column: "LanguageCode"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_LanguageId", + schema: "Cms", table: "FieldIndex", column: "LanguageId"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_LanguageIsDefault", + schema: "Cms", table: "FieldIndex", column: "LanguageIsDefault"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_LanguageUid", + schema: "Cms", table: "FieldIndex", column: "LanguageUid"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_Number", + schema: "Cms", table: "FieldIndex", column: "Number"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_Revision", + schema: "Cms", table: "FieldIndex", column: "Revision"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_Status", + schema: "Cms", table: "FieldIndex", column: "Status"); migrationBuilder.CreateIndex( name: "IX_FieldIndex_String", + schema: "Cms", table: "FieldIndex", column: "String"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_CreatedBy", + schema: "Cms", table: "FieldTypes", column: "CreatedBy"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_CreatedOn", + schema: "Cms", table: "FieldTypes", column: "CreatedOn"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_DataType", + schema: "Cms", table: "FieldTypes", column: "DataType"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_DisplayName", + schema: "Cms", table: "FieldTypes", column: "DisplayName"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_Id", + schema: "Cms", table: "FieldTypes", column: "Id", unique: true); migrationBuilder.CreateIndex( name: "IX_FieldTypes_StreamId", + schema: "Cms", table: "FieldTypes", column: "StreamId", unique: true); migrationBuilder.CreateIndex( name: "IX_FieldTypes_UniqueName", + schema: "Cms", table: "FieldTypes", column: "UniqueName"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_UniqueNameNormalized", + schema: "Cms", table: "FieldTypes", column: "UniqueNameNormalized", unique: true); migrationBuilder.CreateIndex( name: "IX_FieldTypes_UpdatedBy", + schema: "Cms", table: "FieldTypes", column: "UpdatedBy"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_UpdatedOn", + schema: "Cms", table: "FieldTypes", column: "UpdatedOn"); migrationBuilder.CreateIndex( name: "IX_FieldTypes_Version", + schema: "Cms", table: "FieldTypes", column: "Version"); migrationBuilder.CreateIndex( name: "IX_Languages_Code", + schema: "Cms", table: "Languages", column: "Code"); migrationBuilder.CreateIndex( name: "IX_Languages_CodeNormalized", + schema: "Cms", table: "Languages", column: "CodeNormalized", unique: true); migrationBuilder.CreateIndex( name: "IX_Languages_CreatedBy", + schema: "Cms", table: "Languages", column: "CreatedBy"); migrationBuilder.CreateIndex( name: "IX_Languages_CreatedOn", + schema: "Cms", table: "Languages", column: "CreatedOn"); migrationBuilder.CreateIndex( name: "IX_Languages_DisplayName", + schema: "Cms", table: "Languages", column: "DisplayName"); migrationBuilder.CreateIndex( name: "IX_Languages_EnglishName", + schema: "Cms", table: "Languages", column: "EnglishName"); migrationBuilder.CreateIndex( name: "IX_Languages_Id", + schema: "Cms", table: "Languages", column: "Id", unique: true); migrationBuilder.CreateIndex( name: "IX_Languages_IsDefault", + schema: "Cms", table: "Languages", column: "IsDefault"); migrationBuilder.CreateIndex( name: "IX_Languages_LCID", + schema: "Cms", table: "Languages", column: "LCID"); migrationBuilder.CreateIndex( name: "IX_Languages_NativeName", + schema: "Cms", table: "Languages", column: "NativeName"); migrationBuilder.CreateIndex( name: "IX_Languages_StreamId", + schema: "Cms", table: "Languages", column: "StreamId", unique: true); migrationBuilder.CreateIndex( name: "IX_Languages_UpdatedBy", + schema: "Cms", table: "Languages", column: "UpdatedBy"); migrationBuilder.CreateIndex( name: "IX_Languages_UpdatedOn", + schema: "Cms", table: "Languages", column: "UpdatedOn"); migrationBuilder.CreateIndex( name: "IX_Languages_Version", + schema: "Cms", table: "Languages", column: "Version"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_ContentId", + schema: "Cms", table: "PublishedContents", column: "ContentId"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_ContentTypeId", + schema: "Cms", table: "PublishedContents", column: "ContentTypeId"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_ContentTypeName", + schema: "Cms", table: "PublishedContents", column: "ContentTypeName"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_ContentTypeUid", + schema: "Cms", table: "PublishedContents", column: "ContentTypeUid"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_ContentUid", + schema: "Cms", table: "PublishedContents", column: "ContentUid"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_DisplayName", + schema: "Cms", table: "PublishedContents", column: "DisplayName"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_LanguageCode", + schema: "Cms", table: "PublishedContents", column: "LanguageCode"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_LanguageId", + schema: "Cms", table: "PublishedContents", column: "LanguageId"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_LanguageIsDefault", + schema: "Cms", table: "PublishedContents", column: "LanguageIsDefault"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_LanguageUid", + schema: "Cms", table: "PublishedContents", column: "LanguageUid"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_PublishedBy", + schema: "Cms", table: "PublishedContents", column: "PublishedBy"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_PublishedOn", + schema: "Cms", table: "PublishedContents", column: "PublishedOn"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_Revision", + schema: "Cms", table: "PublishedContents", column: "Revision"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_UniqueName", + schema: "Cms", table: "PublishedContents", column: "UniqueName"); migrationBuilder.CreateIndex( name: "IX_PublishedContents_UniqueNameNormalized", + schema: "Cms", table: "PublishedContents", column: "UniqueNameNormalized"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ContentId", + schema: "Cms", table: "UniqueIndex", column: "ContentId"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ContentLocaleId", + schema: "Cms", table: "UniqueIndex", column: "ContentLocaleId"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ContentLocaleName", + schema: "Cms", table: "UniqueIndex", column: "ContentLocaleName"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ContentTypeId", + schema: "Cms", table: "UniqueIndex", column: "ContentTypeId"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ContentTypeName", + schema: "Cms", table: "UniqueIndex", column: "ContentTypeName"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ContentTypeUid", + schema: "Cms", table: "UniqueIndex", column: "ContentTypeUid"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ContentUid", + schema: "Cms", table: "UniqueIndex", column: "ContentUid"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_FieldDefinitionId", + schema: "Cms", table: "UniqueIndex", column: "FieldDefinitionId"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_FieldDefinitionId_LanguageId_Status_ValueNormalized", + schema: "Cms", table: "UniqueIndex", columns: new[] { "FieldDefinitionId", "LanguageId", "Status", "ValueNormalized" }, unique: true, @@ -967,71 +1112,85 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_UniqueIndex_FieldDefinitionName", + schema: "Cms", table: "UniqueIndex", column: "FieldDefinitionName"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_FieldDefinitionUid", + schema: "Cms", table: "UniqueIndex", column: "FieldDefinitionUid"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_FieldTypeId", + schema: "Cms", table: "UniqueIndex", column: "FieldTypeId"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_FieldTypeName", + schema: "Cms", table: "UniqueIndex", column: "FieldTypeName"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_FieldTypeUid", + schema: "Cms", table: "UniqueIndex", column: "FieldTypeUid"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_Key", + schema: "Cms", table: "UniqueIndex", column: "Key"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_LanguageCode", + schema: "Cms", table: "UniqueIndex", column: "LanguageCode"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_LanguageId", + schema: "Cms", table: "UniqueIndex", column: "LanguageId"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_LanguageIsDefault", + schema: "Cms", table: "UniqueIndex", column: "LanguageIsDefault"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_LanguageUid", + schema: "Cms", table: "UniqueIndex", column: "LanguageUid"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_Revision", + schema: "Cms", table: "UniqueIndex", column: "Revision"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_Status", + schema: "Cms", table: "UniqueIndex", column: "Status"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_Value", + schema: "Cms", table: "UniqueIndex", column: "Value"); migrationBuilder.CreateIndex( name: "IX_UniqueIndex_ValueNormalized", + schema: "Cms", table: "UniqueIndex", column: "ValueNormalized"); } @@ -1040,31 +1199,40 @@ protected override void Up(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "FieldIndex"); + name: "FieldIndex", + schema: "Cms"); migrationBuilder.DropTable( - name: "PublishedContents"); + name: "PublishedContents", + schema: "Cms"); migrationBuilder.DropTable( - name: "UniqueIndex"); + name: "UniqueIndex", + schema: "Cms"); migrationBuilder.DropTable( - name: "ContentLocales"); + name: "ContentLocales", + schema: "Cms"); migrationBuilder.DropTable( - name: "FieldDefinitions"); + name: "FieldDefinitions", + schema: "Cms"); migrationBuilder.DropTable( - name: "Contents"); + name: "Contents", + schema: "Cms"); migrationBuilder.DropTable( - name: "Languages"); + name: "Languages", + schema: "Cms"); migrationBuilder.DropTable( - name: "FieldTypes"); + name: "FieldTypes", + schema: "Cms"); migrationBuilder.DropTable( - name: "ContentTypes"); + name: "ContentTypes", + schema: "Cms"); } } } diff --git a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/CmsContextModelSnapshot.cs b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/CmsContextModelSnapshot.cs index 8461d57f..989145fa 100644 --- a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/CmsContextModelSnapshot.cs +++ b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Migrations/CmsContextModelSnapshot.cs @@ -77,7 +77,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("Contents", (string)null); + b.ToTable("Contents", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentLocaleEntity", b => @@ -181,7 +181,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsUnique() .HasFilter("[LanguageId] IS NOT NULL"); - b.ToTable("ContentLocales", (string)null); + b.ToTable("ContentLocales", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentTypeEntity", b => @@ -269,7 +269,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("ContentTypes", (string)null); + b.ToTable("ContentTypes", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldDefinitionEntity", b => @@ -338,7 +338,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ContentTypeId", "UniqueNameNormalized") .IsUnique(); - b.ToTable("FieldDefinitions", (string)null); + b.ToTable("FieldDefinitions", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldIndexEntity", b => @@ -493,7 +493,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ContentLocaleId", "FieldDefinitionId", "Status") .IsUnique(); - b.ToTable("FieldIndex", (string)null); + b.ToTable("FieldIndex", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.FieldTypeEntity", b => @@ -581,7 +581,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("FieldTypes", (string)null); + b.ToTable("FieldTypes", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.LanguageEntity", b => @@ -681,7 +681,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("Version"); - b.ToTable("Languages", (string)null); + b.ToTable("Languages", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.PublishedContentEntity", b => @@ -781,7 +781,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("UniqueNameNormalized"); - b.ToTable("PublishedContents", (string)null); + b.ToTable("PublishedContents", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.UniqueIndexEntity", b => @@ -925,7 +925,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsUnique() .HasFilter("[LanguageId] IS NOT NULL"); - b.ToTable("UniqueIndex", (string)null); + b.ToTable("UniqueIndex", "Cms"); }); modelBuilder.Entity("Logitar.Cms.Infrastructure.Entities.ContentEntity", b => From 3ab34ed862b2c032bc8c13ea56bd10540339776e Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Thu, 30 Jan 2025 01:37:06 -0500 Subject: [PATCH 3/4] scripts --- .../20250130063448_Cms_Release_1_0_0.sql | 479 ++++++++++++++++++ .../20250130063047_Cms_Release_1_0_0.sql | 479 ++++++++++++++++++ 2 files changed, 958 insertions(+) create mode 100644 backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Scripts/20250130063448_Cms_Release_1_0_0.sql create mode 100644 backend/src/Logitar.Cms.Infrastructure.SqlServer/Scripts/20250130063047_Cms_Release_1_0_0.sql diff --git a/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Scripts/20250130063448_Cms_Release_1_0_0.sql b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Scripts/20250130063448_Cms_Release_1_0_0.sql new file mode 100644 index 00000000..5562f825 --- /dev/null +++ b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Scripts/20250130063448_Cms_Release_1_0_0.sql @@ -0,0 +1,479 @@ +CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" ( + "MigrationId" character varying(150) NOT NULL, + "ProductVersion" character varying(32) NOT NULL, + CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId") +); + +START TRANSACTION; +DO $EF$ +BEGIN + IF NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'Cms') THEN + CREATE SCHEMA "Cms"; + END IF; +END $EF$; + +CREATE TABLE "Cms"."ContentTypes" ( + "ContentTypeId" integer GENERATED BY DEFAULT AS IDENTITY, + "Id" uuid NOT NULL, + "IsInvariant" boolean NOT NULL, + "UniqueName" character varying(255) NOT NULL, + "UniqueNameNormalized" character varying(255) NOT NULL, + "DisplayName" character varying(255), + "Description" text, + "FieldCount" integer NOT NULL, + "StreamId" character varying(255) NOT NULL, + "Version" bigint NOT NULL, + "CreatedBy" character varying(255), + "CreatedOn" timestamp with time zone NOT NULL, + "UpdatedBy" character varying(255), + "UpdatedOn" timestamp with time zone NOT NULL, + CONSTRAINT "PK_ContentTypes" PRIMARY KEY ("ContentTypeId") +); + +CREATE TABLE "Cms"."FieldTypes" ( + "FieldTypeId" integer GENERATED BY DEFAULT AS IDENTITY, + "Id" uuid NOT NULL, + "UniqueName" character varying(255) NOT NULL, + "UniqueNameNormalized" character varying(255) NOT NULL, + "DisplayName" character varying(255), + "Description" text, + "DataType" character varying(255) NOT NULL, + "Settings" text, + "StreamId" character varying(255) NOT NULL, + "Version" bigint NOT NULL, + "CreatedBy" character varying(255), + "CreatedOn" timestamp with time zone NOT NULL, + "UpdatedBy" character varying(255), + "UpdatedOn" timestamp with time zone NOT NULL, + CONSTRAINT "PK_FieldTypes" PRIMARY KEY ("FieldTypeId") +); + +CREATE TABLE "Cms"."Languages" ( + "LanguageId" integer GENERATED BY DEFAULT AS IDENTITY, + "Id" uuid NOT NULL, + "IsDefault" boolean NOT NULL, + "LCID" integer NOT NULL, + "Code" character varying(16) NOT NULL, + "CodeNormalized" character varying(16) NOT NULL, + "DisplayName" character varying(255) NOT NULL, + "EnglishName" character varying(255) NOT NULL, + "NativeName" character varying(255) NOT NULL, + "StreamId" character varying(255) NOT NULL, + "Version" bigint NOT NULL, + "CreatedBy" character varying(255), + "CreatedOn" timestamp with time zone NOT NULL, + "UpdatedBy" character varying(255), + "UpdatedOn" timestamp with time zone NOT NULL, + CONSTRAINT "PK_Languages" PRIMARY KEY ("LanguageId") +); + +CREATE TABLE "Cms"."Contents" ( + "ContentId" integer GENERATED BY DEFAULT AS IDENTITY, + "Id" uuid NOT NULL, + "ContentTypeId" integer NOT NULL, + "StreamId" character varying(255) NOT NULL, + "Version" bigint NOT NULL, + "CreatedBy" character varying(255), + "CreatedOn" timestamp with time zone NOT NULL, + "UpdatedBy" character varying(255), + "UpdatedOn" timestamp with time zone NOT NULL, + CONSTRAINT "PK_Contents" PRIMARY KEY ("ContentId"), + CONSTRAINT "FK_Contents_ContentTypes_ContentTypeId" FOREIGN KEY ("ContentTypeId") REFERENCES "Cms"."ContentTypes" ("ContentTypeId") ON DELETE RESTRICT +); + +CREATE TABLE "Cms"."FieldDefinitions" ( + "FieldDefinitionId" integer GENERATED BY DEFAULT AS IDENTITY, + "ContentTypeId" integer NOT NULL, + "Id" uuid NOT NULL, + "Order" integer NOT NULL, + "FieldTypeId" integer NOT NULL, + "IsInvariant" boolean NOT NULL, + "IsRequired" boolean NOT NULL, + "IsIndexed" boolean NOT NULL, + "IsUnique" boolean NOT NULL, + "UniqueName" character varying(255) NOT NULL, + "UniqueNameNormalized" character varying(255) NOT NULL, + "DisplayName" character varying(255), + "Description" text, + "Placeholder" character varying(255), + CONSTRAINT "PK_FieldDefinitions" PRIMARY KEY ("FieldDefinitionId"), + CONSTRAINT "FK_FieldDefinitions_ContentTypes_ContentTypeId" FOREIGN KEY ("ContentTypeId") REFERENCES "Cms"."ContentTypes" ("ContentTypeId") ON DELETE CASCADE, + CONSTRAINT "FK_FieldDefinitions_FieldTypes_FieldTypeId" FOREIGN KEY ("FieldTypeId") REFERENCES "Cms"."FieldTypes" ("FieldTypeId") ON DELETE RESTRICT +); + +CREATE TABLE "Cms"."ContentLocales" ( + "ContentLocaleId" integer GENERATED BY DEFAULT AS IDENTITY, + "ContentTypeId" integer NOT NULL, + "ContentId" integer NOT NULL, + "LanguageId" integer, + "UniqueName" character varying(255) NOT NULL, + "UniqueNameNormalized" character varying(255) NOT NULL, + "DisplayName" character varying(255), + "Description" text, + "FieldValues" text, + "Revision" bigint NOT NULL, + "CreatedBy" character varying(255), + "CreatedOn" timestamp with time zone NOT NULL, + "UpdatedBy" character varying(255), + "UpdatedOn" timestamp with time zone NOT NULL, + "IsPublished" boolean NOT NULL, + "PublishedRevision" bigint, + "PublishedBy" character varying(255), + "PublishedOn" timestamp with time zone, + CONSTRAINT "PK_ContentLocales" PRIMARY KEY ("ContentLocaleId"), + CONSTRAINT "FK_ContentLocales_ContentTypes_ContentTypeId" FOREIGN KEY ("ContentTypeId") REFERENCES "Cms"."ContentTypes" ("ContentTypeId") ON DELETE RESTRICT, + CONSTRAINT "FK_ContentLocales_Contents_ContentId" FOREIGN KEY ("ContentId") REFERENCES "Cms"."Contents" ("ContentId") ON DELETE CASCADE, + CONSTRAINT "FK_ContentLocales_Languages_LanguageId" FOREIGN KEY ("LanguageId") REFERENCES "Cms"."Languages" ("LanguageId") ON DELETE RESTRICT +); + +CREATE TABLE "Cms"."FieldIndex" ( + "FieldIndexId" integer GENERATED BY DEFAULT AS IDENTITY, + "ContentTypeId" integer NOT NULL, + "ContentTypeUid" uuid NOT NULL, + "ContentTypeName" character varying(255) NOT NULL, + "LanguageId" integer, + "LanguageUid" uuid, + "LanguageCode" character varying(16), + "LanguageIsDefault" boolean NOT NULL, + "FieldTypeId" integer NOT NULL, + "FieldTypeUid" uuid NOT NULL, + "FieldTypeName" character varying(255) NOT NULL, + "FieldDefinitionId" integer NOT NULL, + "FieldDefinitionUid" uuid NOT NULL, + "FieldDefinitionName" character varying(255) NOT NULL, + "ContentId" integer NOT NULL, + "ContentUid" uuid NOT NULL, + "ContentLocaleId" integer NOT NULL, + "ContentLocaleName" character varying(255) NOT NULL, + "Revision" bigint NOT NULL, + "Status" character varying(10) NOT NULL, + "Boolean" boolean, + "DateTime" timestamp with time zone, + "Number" double precision, + "RelatedContent" text, + "RichText" text, + "Select" text, + "String" character varying(255), + "Tags" text, + CONSTRAINT "PK_FieldIndex" PRIMARY KEY ("FieldIndexId"), + CONSTRAINT "FK_FieldIndex_ContentLocales_ContentLocaleId" FOREIGN KEY ("ContentLocaleId") REFERENCES "Cms"."ContentLocales" ("ContentLocaleId") ON DELETE CASCADE, + CONSTRAINT "FK_FieldIndex_ContentTypes_ContentTypeId" FOREIGN KEY ("ContentTypeId") REFERENCES "Cms"."ContentTypes" ("ContentTypeId") ON DELETE CASCADE, + CONSTRAINT "FK_FieldIndex_Contents_ContentId" FOREIGN KEY ("ContentId") REFERENCES "Cms"."Contents" ("ContentId"), + CONSTRAINT "FK_FieldIndex_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "Cms"."FieldDefinitions" ("FieldDefinitionId"), + CONSTRAINT "FK_FieldIndex_FieldTypes_FieldTypeId" FOREIGN KEY ("FieldTypeId") REFERENCES "Cms"."FieldTypes" ("FieldTypeId") ON DELETE CASCADE, + CONSTRAINT "FK_FieldIndex_Languages_LanguageId" FOREIGN KEY ("LanguageId") REFERENCES "Cms"."Languages" ("LanguageId") ON DELETE CASCADE +); + +CREATE TABLE "Cms"."PublishedContents" ( + "ContentLocaleId" integer NOT NULL, + "ContentId" integer NOT NULL, + "ContentUid" uuid NOT NULL, + "ContentTypeId" integer NOT NULL, + "ContentTypeUid" uuid NOT NULL, + "ContentTypeName" character varying(255) NOT NULL, + "LanguageId" integer, + "LanguageUid" uuid, + "LanguageCode" character varying(16), + "LanguageIsDefault" boolean NOT NULL, + "UniqueName" character varying(255) NOT NULL, + "UniqueNameNormalized" character varying(255) NOT NULL, + "DisplayName" character varying(255), + "Description" text, + "FieldValues" text, + "Revision" bigint NOT NULL, + "PublishedBy" character varying(255), + "PublishedOn" timestamp with time zone NOT NULL, + CONSTRAINT "PK_PublishedContents" PRIMARY KEY ("ContentLocaleId"), + CONSTRAINT "FK_PublishedContents_ContentLocales_ContentLocaleId" FOREIGN KEY ("ContentLocaleId") REFERENCES "Cms"."ContentLocales" ("ContentLocaleId") ON DELETE CASCADE, + CONSTRAINT "FK_PublishedContents_ContentTypes_ContentTypeId" FOREIGN KEY ("ContentTypeId") REFERENCES "Cms"."ContentTypes" ("ContentTypeId") ON DELETE RESTRICT, + CONSTRAINT "FK_PublishedContents_Contents_ContentId" FOREIGN KEY ("ContentId") REFERENCES "Cms"."Contents" ("ContentId") ON DELETE RESTRICT, + CONSTRAINT "FK_PublishedContents_Languages_LanguageId" FOREIGN KEY ("LanguageId") REFERENCES "Cms"."Languages" ("LanguageId") ON DELETE RESTRICT +); + +CREATE TABLE "Cms"."UniqueIndex" ( + "UniqueIndexId" integer GENERATED BY DEFAULT AS IDENTITY, + "ContentTypeId" integer NOT NULL, + "ContentTypeUid" uuid NOT NULL, + "ContentTypeName" character varying(255) NOT NULL, + "LanguageId" integer, + "LanguageUid" uuid, + "LanguageCode" character varying(16), + "LanguageIsDefault" boolean NOT NULL, + "FieldTypeId" integer NOT NULL, + "FieldTypeUid" uuid NOT NULL, + "FieldTypeName" character varying(255) NOT NULL, + "FieldDefinitionId" integer NOT NULL, + "FieldDefinitionUid" uuid NOT NULL, + "FieldDefinitionName" character varying(255) NOT NULL, + "Revision" bigint NOT NULL, + "Status" character varying(10) NOT NULL, + "Value" character varying(255) NOT NULL, + "ValueNormalized" character varying(255) NOT NULL, + "Key" character varying(278) NOT NULL, + "ContentId" integer NOT NULL, + "ContentUid" uuid NOT NULL, + "ContentLocaleId" integer NOT NULL, + "ContentLocaleName" character varying(255) NOT NULL, + CONSTRAINT "PK_UniqueIndex" PRIMARY KEY ("UniqueIndexId"), + CONSTRAINT "FK_UniqueIndex_ContentLocales_ContentLocaleId" FOREIGN KEY ("ContentLocaleId") REFERENCES "Cms"."ContentLocales" ("ContentLocaleId") ON DELETE CASCADE, + CONSTRAINT "FK_UniqueIndex_ContentTypes_ContentTypeId" FOREIGN KEY ("ContentTypeId") REFERENCES "Cms"."ContentTypes" ("ContentTypeId") ON DELETE CASCADE, + CONSTRAINT "FK_UniqueIndex_Contents_ContentId" FOREIGN KEY ("ContentId") REFERENCES "Cms"."Contents" ("ContentId"), + CONSTRAINT "FK_UniqueIndex_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "Cms"."FieldDefinitions" ("FieldDefinitionId"), + CONSTRAINT "FK_UniqueIndex_FieldTypes_FieldTypeId" FOREIGN KEY ("FieldTypeId") REFERENCES "Cms"."FieldTypes" ("FieldTypeId") ON DELETE CASCADE, + CONSTRAINT "FK_UniqueIndex_Languages_LanguageId" FOREIGN KEY ("LanguageId") REFERENCES "Cms"."Languages" ("LanguageId") ON DELETE CASCADE +); + +CREATE UNIQUE INDEX "IX_ContentLocales_ContentId_LanguageId" ON "Cms"."ContentLocales" ("ContentId", "LanguageId"); + +CREATE UNIQUE INDEX "IX_ContentLocales_ContentTypeId_LanguageId_UniqueNameNormalized" ON "Cms"."ContentLocales" ("ContentTypeId", "LanguageId", "UniqueNameNormalized"); + +CREATE INDEX "IX_ContentLocales_CreatedBy" ON "Cms"."ContentLocales" ("CreatedBy"); + +CREATE INDEX "IX_ContentLocales_CreatedOn" ON "Cms"."ContentLocales" ("CreatedOn"); + +CREATE INDEX "IX_ContentLocales_DisplayName" ON "Cms"."ContentLocales" ("DisplayName"); + +CREATE INDEX "IX_ContentLocales_IsPublished" ON "Cms"."ContentLocales" ("IsPublished"); + +CREATE INDEX "IX_ContentLocales_LanguageId" ON "Cms"."ContentLocales" ("LanguageId"); + +CREATE INDEX "IX_ContentLocales_PublishedBy" ON "Cms"."ContentLocales" ("PublishedBy"); + +CREATE INDEX "IX_ContentLocales_PublishedOn" ON "Cms"."ContentLocales" ("PublishedOn"); + +CREATE INDEX "IX_ContentLocales_PublishedRevision" ON "Cms"."ContentLocales" ("PublishedRevision"); + +CREATE INDEX "IX_ContentLocales_Revision" ON "Cms"."ContentLocales" ("Revision"); + +CREATE INDEX "IX_ContentLocales_UniqueName" ON "Cms"."ContentLocales" ("UniqueName"); + +CREATE INDEX "IX_ContentLocales_UpdatedBy" ON "Cms"."ContentLocales" ("UpdatedBy"); + +CREATE INDEX "IX_ContentLocales_UpdatedOn" ON "Cms"."ContentLocales" ("UpdatedOn"); + +CREATE INDEX "IX_Contents_ContentTypeId" ON "Cms"."Contents" ("ContentTypeId"); + +CREATE INDEX "IX_Contents_CreatedBy" ON "Cms"."Contents" ("CreatedBy"); + +CREATE INDEX "IX_Contents_CreatedOn" ON "Cms"."Contents" ("CreatedOn"); + +CREATE UNIQUE INDEX "IX_Contents_Id" ON "Cms"."Contents" ("Id"); + +CREATE UNIQUE INDEX "IX_Contents_StreamId" ON "Cms"."Contents" ("StreamId"); + +CREATE INDEX "IX_Contents_UpdatedBy" ON "Cms"."Contents" ("UpdatedBy"); + +CREATE INDEX "IX_Contents_UpdatedOn" ON "Cms"."Contents" ("UpdatedOn"); + +CREATE INDEX "IX_Contents_Version" ON "Cms"."Contents" ("Version"); + +CREATE INDEX "IX_ContentTypes_CreatedBy" ON "Cms"."ContentTypes" ("CreatedBy"); + +CREATE INDEX "IX_ContentTypes_CreatedOn" ON "Cms"."ContentTypes" ("CreatedOn"); + +CREATE INDEX "IX_ContentTypes_DisplayName" ON "Cms"."ContentTypes" ("DisplayName"); + +CREATE INDEX "IX_ContentTypes_FieldCount" ON "Cms"."ContentTypes" ("FieldCount"); + +CREATE UNIQUE INDEX "IX_ContentTypes_Id" ON "Cms"."ContentTypes" ("Id"); + +CREATE INDEX "IX_ContentTypes_IsInvariant" ON "Cms"."ContentTypes" ("IsInvariant"); + +CREATE UNIQUE INDEX "IX_ContentTypes_StreamId" ON "Cms"."ContentTypes" ("StreamId"); + +CREATE INDEX "IX_ContentTypes_UniqueName" ON "Cms"."ContentTypes" ("UniqueName"); + +CREATE UNIQUE INDEX "IX_ContentTypes_UniqueNameNormalized" ON "Cms"."ContentTypes" ("UniqueNameNormalized"); + +CREATE INDEX "IX_ContentTypes_UpdatedBy" ON "Cms"."ContentTypes" ("UpdatedBy"); + +CREATE INDEX "IX_ContentTypes_UpdatedOn" ON "Cms"."ContentTypes" ("UpdatedOn"); + +CREATE INDEX "IX_ContentTypes_Version" ON "Cms"."ContentTypes" ("Version"); + +CREATE UNIQUE INDEX "IX_FieldDefinitions_ContentTypeId_Id" ON "Cms"."FieldDefinitions" ("ContentTypeId", "Id"); + +CREATE UNIQUE INDEX "IX_FieldDefinitions_ContentTypeId_Order" ON "Cms"."FieldDefinitions" ("ContentTypeId", "Order"); + +CREATE UNIQUE INDEX "IX_FieldDefinitions_ContentTypeId_UniqueNameNormalized" ON "Cms"."FieldDefinitions" ("ContentTypeId", "UniqueNameNormalized"); + +CREATE INDEX "IX_FieldDefinitions_FieldTypeId" ON "Cms"."FieldDefinitions" ("FieldTypeId"); + +CREATE INDEX "IX_FieldIndex_Boolean" ON "Cms"."FieldIndex" ("Boolean"); + +CREATE INDEX "IX_FieldIndex_ContentId" ON "Cms"."FieldIndex" ("ContentId"); + +CREATE INDEX "IX_FieldIndex_ContentLocaleId" ON "Cms"."FieldIndex" ("ContentLocaleId"); + +CREATE UNIQUE INDEX "IX_FieldIndex_ContentLocaleId_FieldDefinitionId_Status" ON "Cms"."FieldIndex" ("ContentLocaleId", "FieldDefinitionId", "Status"); + +CREATE INDEX "IX_FieldIndex_ContentLocaleName" ON "Cms"."FieldIndex" ("ContentLocaleName"); + +CREATE INDEX "IX_FieldIndex_ContentTypeId" ON "Cms"."FieldIndex" ("ContentTypeId"); + +CREATE INDEX "IX_FieldIndex_ContentTypeName" ON "Cms"."FieldIndex" ("ContentTypeName"); + +CREATE INDEX "IX_FieldIndex_ContentTypeUid" ON "Cms"."FieldIndex" ("ContentTypeUid"); + +CREATE INDEX "IX_FieldIndex_ContentUid" ON "Cms"."FieldIndex" ("ContentUid"); + +CREATE INDEX "IX_FieldIndex_DateTime" ON "Cms"."FieldIndex" ("DateTime"); + +CREATE INDEX "IX_FieldIndex_FieldDefinitionId" ON "Cms"."FieldIndex" ("FieldDefinitionId"); + +CREATE INDEX "IX_FieldIndex_FieldDefinitionName" ON "Cms"."FieldIndex" ("FieldDefinitionName"); + +CREATE INDEX "IX_FieldIndex_FieldDefinitionUid" ON "Cms"."FieldIndex" ("FieldDefinitionUid"); + +CREATE INDEX "IX_FieldIndex_FieldTypeId" ON "Cms"."FieldIndex" ("FieldTypeId"); + +CREATE INDEX "IX_FieldIndex_FieldTypeName" ON "Cms"."FieldIndex" ("FieldTypeName"); + +CREATE INDEX "IX_FieldIndex_FieldTypeUid" ON "Cms"."FieldIndex" ("FieldTypeUid"); + +CREATE INDEX "IX_FieldIndex_LanguageCode" ON "Cms"."FieldIndex" ("LanguageCode"); + +CREATE INDEX "IX_FieldIndex_LanguageId" ON "Cms"."FieldIndex" ("LanguageId"); + +CREATE INDEX "IX_FieldIndex_LanguageIsDefault" ON "Cms"."FieldIndex" ("LanguageIsDefault"); + +CREATE INDEX "IX_FieldIndex_LanguageUid" ON "Cms"."FieldIndex" ("LanguageUid"); + +CREATE INDEX "IX_FieldIndex_Number" ON "Cms"."FieldIndex" ("Number"); + +CREATE INDEX "IX_FieldIndex_Revision" ON "Cms"."FieldIndex" ("Revision"); + +CREATE INDEX "IX_FieldIndex_Status" ON "Cms"."FieldIndex" ("Status"); + +CREATE INDEX "IX_FieldIndex_String" ON "Cms"."FieldIndex" ("String"); + +CREATE INDEX "IX_FieldTypes_CreatedBy" ON "Cms"."FieldTypes" ("CreatedBy"); + +CREATE INDEX "IX_FieldTypes_CreatedOn" ON "Cms"."FieldTypes" ("CreatedOn"); + +CREATE INDEX "IX_FieldTypes_DataType" ON "Cms"."FieldTypes" ("DataType"); + +CREATE INDEX "IX_FieldTypes_DisplayName" ON "Cms"."FieldTypes" ("DisplayName"); + +CREATE UNIQUE INDEX "IX_FieldTypes_Id" ON "Cms"."FieldTypes" ("Id"); + +CREATE UNIQUE INDEX "IX_FieldTypes_StreamId" ON "Cms"."FieldTypes" ("StreamId"); + +CREATE INDEX "IX_FieldTypes_UniqueName" ON "Cms"."FieldTypes" ("UniqueName"); + +CREATE UNIQUE INDEX "IX_FieldTypes_UniqueNameNormalized" ON "Cms"."FieldTypes" ("UniqueNameNormalized"); + +CREATE INDEX "IX_FieldTypes_UpdatedBy" ON "Cms"."FieldTypes" ("UpdatedBy"); + +CREATE INDEX "IX_FieldTypes_UpdatedOn" ON "Cms"."FieldTypes" ("UpdatedOn"); + +CREATE INDEX "IX_FieldTypes_Version" ON "Cms"."FieldTypes" ("Version"); + +CREATE INDEX "IX_Languages_Code" ON "Cms"."Languages" ("Code"); + +CREATE UNIQUE INDEX "IX_Languages_CodeNormalized" ON "Cms"."Languages" ("CodeNormalized"); + +CREATE INDEX "IX_Languages_CreatedBy" ON "Cms"."Languages" ("CreatedBy"); + +CREATE INDEX "IX_Languages_CreatedOn" ON "Cms"."Languages" ("CreatedOn"); + +CREATE INDEX "IX_Languages_DisplayName" ON "Cms"."Languages" ("DisplayName"); + +CREATE INDEX "IX_Languages_EnglishName" ON "Cms"."Languages" ("EnglishName"); + +CREATE UNIQUE INDEX "IX_Languages_Id" ON "Cms"."Languages" ("Id"); + +CREATE INDEX "IX_Languages_IsDefault" ON "Cms"."Languages" ("IsDefault"); + +CREATE INDEX "IX_Languages_LCID" ON "Cms"."Languages" ("LCID"); + +CREATE INDEX "IX_Languages_NativeName" ON "Cms"."Languages" ("NativeName"); + +CREATE UNIQUE INDEX "IX_Languages_StreamId" ON "Cms"."Languages" ("StreamId"); + +CREATE INDEX "IX_Languages_UpdatedBy" ON "Cms"."Languages" ("UpdatedBy"); + +CREATE INDEX "IX_Languages_UpdatedOn" ON "Cms"."Languages" ("UpdatedOn"); + +CREATE INDEX "IX_Languages_Version" ON "Cms"."Languages" ("Version"); + +CREATE INDEX "IX_PublishedContents_ContentId" ON "Cms"."PublishedContents" ("ContentId"); + +CREATE INDEX "IX_PublishedContents_ContentTypeId" ON "Cms"."PublishedContents" ("ContentTypeId"); + +CREATE INDEX "IX_PublishedContents_ContentTypeName" ON "Cms"."PublishedContents" ("ContentTypeName"); + +CREATE INDEX "IX_PublishedContents_ContentTypeUid" ON "Cms"."PublishedContents" ("ContentTypeUid"); + +CREATE INDEX "IX_PublishedContents_ContentUid" ON "Cms"."PublishedContents" ("ContentUid"); + +CREATE INDEX "IX_PublishedContents_DisplayName" ON "Cms"."PublishedContents" ("DisplayName"); + +CREATE INDEX "IX_PublishedContents_LanguageCode" ON "Cms"."PublishedContents" ("LanguageCode"); + +CREATE INDEX "IX_PublishedContents_LanguageId" ON "Cms"."PublishedContents" ("LanguageId"); + +CREATE INDEX "IX_PublishedContents_LanguageIsDefault" ON "Cms"."PublishedContents" ("LanguageIsDefault"); + +CREATE INDEX "IX_PublishedContents_LanguageUid" ON "Cms"."PublishedContents" ("LanguageUid"); + +CREATE INDEX "IX_PublishedContents_PublishedBy" ON "Cms"."PublishedContents" ("PublishedBy"); + +CREATE INDEX "IX_PublishedContents_PublishedOn" ON "Cms"."PublishedContents" ("PublishedOn"); + +CREATE INDEX "IX_PublishedContents_Revision" ON "Cms"."PublishedContents" ("Revision"); + +CREATE INDEX "IX_PublishedContents_UniqueName" ON "Cms"."PublishedContents" ("UniqueName"); + +CREATE INDEX "IX_PublishedContents_UniqueNameNormalized" ON "Cms"."PublishedContents" ("UniqueNameNormalized"); + +CREATE INDEX "IX_UniqueIndex_ContentId" ON "Cms"."UniqueIndex" ("ContentId"); + +CREATE INDEX "IX_UniqueIndex_ContentLocaleId" ON "Cms"."UniqueIndex" ("ContentLocaleId"); + +CREATE INDEX "IX_UniqueIndex_ContentLocaleName" ON "Cms"."UniqueIndex" ("ContentLocaleName"); + +CREATE INDEX "IX_UniqueIndex_ContentTypeId" ON "Cms"."UniqueIndex" ("ContentTypeId"); + +CREATE INDEX "IX_UniqueIndex_ContentTypeName" ON "Cms"."UniqueIndex" ("ContentTypeName"); + +CREATE INDEX "IX_UniqueIndex_ContentTypeUid" ON "Cms"."UniqueIndex" ("ContentTypeUid"); + +CREATE INDEX "IX_UniqueIndex_ContentUid" ON "Cms"."UniqueIndex" ("ContentUid"); + +CREATE INDEX "IX_UniqueIndex_FieldDefinitionId" ON "Cms"."UniqueIndex" ("FieldDefinitionId"); + +CREATE UNIQUE INDEX "IX_UniqueIndex_FieldDefinitionId_LanguageId_Status_ValueNormal~" ON "Cms"."UniqueIndex" ("FieldDefinitionId", "LanguageId", "Status", "ValueNormalized"); + +CREATE INDEX "IX_UniqueIndex_FieldDefinitionName" ON "Cms"."UniqueIndex" ("FieldDefinitionName"); + +CREATE INDEX "IX_UniqueIndex_FieldDefinitionUid" ON "Cms"."UniqueIndex" ("FieldDefinitionUid"); + +CREATE INDEX "IX_UniqueIndex_FieldTypeId" ON "Cms"."UniqueIndex" ("FieldTypeId"); + +CREATE INDEX "IX_UniqueIndex_FieldTypeName" ON "Cms"."UniqueIndex" ("FieldTypeName"); + +CREATE INDEX "IX_UniqueIndex_FieldTypeUid" ON "Cms"."UniqueIndex" ("FieldTypeUid"); + +CREATE INDEX "IX_UniqueIndex_Key" ON "Cms"."UniqueIndex" ("Key"); + +CREATE INDEX "IX_UniqueIndex_LanguageCode" ON "Cms"."UniqueIndex" ("LanguageCode"); + +CREATE INDEX "IX_UniqueIndex_LanguageId" ON "Cms"."UniqueIndex" ("LanguageId"); + +CREATE INDEX "IX_UniqueIndex_LanguageIsDefault" ON "Cms"."UniqueIndex" ("LanguageIsDefault"); + +CREATE INDEX "IX_UniqueIndex_LanguageUid" ON "Cms"."UniqueIndex" ("LanguageUid"); + +CREATE INDEX "IX_UniqueIndex_Revision" ON "Cms"."UniqueIndex" ("Revision"); + +CREATE INDEX "IX_UniqueIndex_Status" ON "Cms"."UniqueIndex" ("Status"); + +CREATE INDEX "IX_UniqueIndex_Value" ON "Cms"."UniqueIndex" ("Value"); + +CREATE INDEX "IX_UniqueIndex_ValueNormalized" ON "Cms"."UniqueIndex" ("ValueNormalized"); + +INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion") +VALUES ('20250130063448_Cms_Release_1_0_0', '9.0.0'); + +COMMIT; diff --git a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Scripts/20250130063047_Cms_Release_1_0_0.sql b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Scripts/20250130063047_Cms_Release_1_0_0.sql new file mode 100644 index 00000000..3cb7241b --- /dev/null +++ b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Scripts/20250130063047_Cms_Release_1_0_0.sql @@ -0,0 +1,479 @@ +IF OBJECT_ID(N'[__EFMigrationsHistory]') IS NULL +BEGIN + CREATE TABLE [__EFMigrationsHistory] ( + [MigrationId] nvarchar(150) NOT NULL, + [ProductVersion] nvarchar(32) NOT NULL, + CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId]) + ); +END; +GO + +BEGIN TRANSACTION; +IF SCHEMA_ID(N'Cms') IS NULL EXEC(N'CREATE SCHEMA [Cms];'); + +CREATE TABLE [Cms].[ContentTypes] ( + [ContentTypeId] int NOT NULL IDENTITY, + [Id] uniqueidentifier NOT NULL, + [IsInvariant] bit NOT NULL, + [UniqueName] nvarchar(255) NOT NULL, + [UniqueNameNormalized] nvarchar(255) NOT NULL, + [DisplayName] nvarchar(255) NULL, + [Description] nvarchar(max) NULL, + [FieldCount] int NOT NULL, + [StreamId] nvarchar(255) NOT NULL, + [Version] bigint NOT NULL, + [CreatedBy] nvarchar(255) NULL, + [CreatedOn] datetime2 NOT NULL, + [UpdatedBy] nvarchar(255) NULL, + [UpdatedOn] datetime2 NOT NULL, + CONSTRAINT [PK_ContentTypes] PRIMARY KEY ([ContentTypeId]) +); + +CREATE TABLE [Cms].[FieldTypes] ( + [FieldTypeId] int NOT NULL IDENTITY, + [Id] uniqueidentifier NOT NULL, + [UniqueName] nvarchar(255) NOT NULL, + [UniqueNameNormalized] nvarchar(255) NOT NULL, + [DisplayName] nvarchar(255) NULL, + [Description] nvarchar(max) NULL, + [DataType] nvarchar(255) NOT NULL, + [Settings] nvarchar(max) NULL, + [StreamId] nvarchar(255) NOT NULL, + [Version] bigint NOT NULL, + [CreatedBy] nvarchar(255) NULL, + [CreatedOn] datetime2 NOT NULL, + [UpdatedBy] nvarchar(255) NULL, + [UpdatedOn] datetime2 NOT NULL, + CONSTRAINT [PK_FieldTypes] PRIMARY KEY ([FieldTypeId]) +); + +CREATE TABLE [Cms].[Languages] ( + [LanguageId] int NOT NULL IDENTITY, + [Id] uniqueidentifier NOT NULL, + [IsDefault] bit NOT NULL, + [LCID] int NOT NULL, + [Code] nvarchar(16) NOT NULL, + [CodeNormalized] nvarchar(16) NOT NULL, + [DisplayName] nvarchar(255) NOT NULL, + [EnglishName] nvarchar(255) NOT NULL, + [NativeName] nvarchar(255) NOT NULL, + [StreamId] nvarchar(255) NOT NULL, + [Version] bigint NOT NULL, + [CreatedBy] nvarchar(255) NULL, + [CreatedOn] datetime2 NOT NULL, + [UpdatedBy] nvarchar(255) NULL, + [UpdatedOn] datetime2 NOT NULL, + CONSTRAINT [PK_Languages] PRIMARY KEY ([LanguageId]) +); + +CREATE TABLE [Cms].[Contents] ( + [ContentId] int NOT NULL IDENTITY, + [Id] uniqueidentifier NOT NULL, + [ContentTypeId] int NOT NULL, + [StreamId] nvarchar(255) NOT NULL, + [Version] bigint NOT NULL, + [CreatedBy] nvarchar(255) NULL, + [CreatedOn] datetime2 NOT NULL, + [UpdatedBy] nvarchar(255) NULL, + [UpdatedOn] datetime2 NOT NULL, + CONSTRAINT [PK_Contents] PRIMARY KEY ([ContentId]), + CONSTRAINT [FK_Contents_ContentTypes_ContentTypeId] FOREIGN KEY ([ContentTypeId]) REFERENCES [Cms].[ContentTypes] ([ContentTypeId]) ON DELETE NO ACTION +); + +CREATE TABLE [Cms].[FieldDefinitions] ( + [FieldDefinitionId] int NOT NULL IDENTITY, + [ContentTypeId] int NOT NULL, + [Id] uniqueidentifier NOT NULL, + [Order] int NOT NULL, + [FieldTypeId] int NOT NULL, + [IsInvariant] bit NOT NULL, + [IsRequired] bit NOT NULL, + [IsIndexed] bit NOT NULL, + [IsUnique] bit NOT NULL, + [UniqueName] nvarchar(255) NOT NULL, + [UniqueNameNormalized] nvarchar(255) NOT NULL, + [DisplayName] nvarchar(255) NULL, + [Description] nvarchar(max) NULL, + [Placeholder] nvarchar(255) NULL, + CONSTRAINT [PK_FieldDefinitions] PRIMARY KEY ([FieldDefinitionId]), + CONSTRAINT [FK_FieldDefinitions_ContentTypes_ContentTypeId] FOREIGN KEY ([ContentTypeId]) REFERENCES [Cms].[ContentTypes] ([ContentTypeId]) ON DELETE CASCADE, + CONSTRAINT [FK_FieldDefinitions_FieldTypes_FieldTypeId] FOREIGN KEY ([FieldTypeId]) REFERENCES [Cms].[FieldTypes] ([FieldTypeId]) ON DELETE NO ACTION +); + +CREATE TABLE [Cms].[ContentLocales] ( + [ContentLocaleId] int NOT NULL IDENTITY, + [ContentTypeId] int NOT NULL, + [ContentId] int NOT NULL, + [LanguageId] int NULL, + [UniqueName] nvarchar(255) NOT NULL, + [UniqueNameNormalized] nvarchar(255) NOT NULL, + [DisplayName] nvarchar(255) NULL, + [Description] nvarchar(max) NULL, + [FieldValues] nvarchar(max) NULL, + [Revision] bigint NOT NULL, + [CreatedBy] nvarchar(255) NULL, + [CreatedOn] datetime2 NOT NULL, + [UpdatedBy] nvarchar(255) NULL, + [UpdatedOn] datetime2 NOT NULL, + [IsPublished] bit NOT NULL, + [PublishedRevision] bigint NULL, + [PublishedBy] nvarchar(255) NULL, + [PublishedOn] datetime2 NULL, + CONSTRAINT [PK_ContentLocales] PRIMARY KEY ([ContentLocaleId]), + CONSTRAINT [FK_ContentLocales_ContentTypes_ContentTypeId] FOREIGN KEY ([ContentTypeId]) REFERENCES [Cms].[ContentTypes] ([ContentTypeId]) ON DELETE NO ACTION, + CONSTRAINT [FK_ContentLocales_Contents_ContentId] FOREIGN KEY ([ContentId]) REFERENCES [Cms].[Contents] ([ContentId]) ON DELETE CASCADE, + CONSTRAINT [FK_ContentLocales_Languages_LanguageId] FOREIGN KEY ([LanguageId]) REFERENCES [Cms].[Languages] ([LanguageId]) ON DELETE NO ACTION +); + +CREATE TABLE [Cms].[FieldIndex] ( + [FieldIndexId] int NOT NULL IDENTITY, + [ContentTypeId] int NOT NULL, + [ContentTypeUid] uniqueidentifier NOT NULL, + [ContentTypeName] nvarchar(255) NOT NULL, + [LanguageId] int NULL, + [LanguageUid] uniqueidentifier NULL, + [LanguageCode] nvarchar(16) NULL, + [LanguageIsDefault] bit NOT NULL, + [FieldTypeId] int NOT NULL, + [FieldTypeUid] uniqueidentifier NOT NULL, + [FieldTypeName] nvarchar(255) NOT NULL, + [FieldDefinitionId] int NOT NULL, + [FieldDefinitionUid] uniqueidentifier NOT NULL, + [FieldDefinitionName] nvarchar(255) NOT NULL, + [ContentId] int NOT NULL, + [ContentUid] uniqueidentifier NOT NULL, + [ContentLocaleId] int NOT NULL, + [ContentLocaleName] nvarchar(255) NOT NULL, + [Revision] bigint NOT NULL, + [Status] nvarchar(10) NOT NULL, + [Boolean] bit NULL, + [DateTime] datetime2 NULL, + [Number] float NULL, + [RelatedContent] nvarchar(max) NULL, + [RichText] nvarchar(max) NULL, + [Select] nvarchar(max) NULL, + [String] nvarchar(255) NULL, + [Tags] nvarchar(max) NULL, + CONSTRAINT [PK_FieldIndex] PRIMARY KEY ([FieldIndexId]), + CONSTRAINT [FK_FieldIndex_ContentLocales_ContentLocaleId] FOREIGN KEY ([ContentLocaleId]) REFERENCES [Cms].[ContentLocales] ([ContentLocaleId]) ON DELETE CASCADE, + CONSTRAINT [FK_FieldIndex_ContentTypes_ContentTypeId] FOREIGN KEY ([ContentTypeId]) REFERENCES [Cms].[ContentTypes] ([ContentTypeId]) ON DELETE CASCADE, + CONSTRAINT [FK_FieldIndex_Contents_ContentId] FOREIGN KEY ([ContentId]) REFERENCES [Cms].[Contents] ([ContentId]), + CONSTRAINT [FK_FieldIndex_FieldDefinitions_FieldDefinitionId] FOREIGN KEY ([FieldDefinitionId]) REFERENCES [Cms].[FieldDefinitions] ([FieldDefinitionId]), + CONSTRAINT [FK_FieldIndex_FieldTypes_FieldTypeId] FOREIGN KEY ([FieldTypeId]) REFERENCES [Cms].[FieldTypes] ([FieldTypeId]) ON DELETE CASCADE, + CONSTRAINT [FK_FieldIndex_Languages_LanguageId] FOREIGN KEY ([LanguageId]) REFERENCES [Cms].[Languages] ([LanguageId]) ON DELETE CASCADE +); + +CREATE TABLE [Cms].[PublishedContents] ( + [ContentLocaleId] int NOT NULL, + [ContentId] int NOT NULL, + [ContentUid] uniqueidentifier NOT NULL, + [ContentTypeId] int NOT NULL, + [ContentTypeUid] uniqueidentifier NOT NULL, + [ContentTypeName] nvarchar(255) NOT NULL, + [LanguageId] int NULL, + [LanguageUid] uniqueidentifier NULL, + [LanguageCode] nvarchar(16) NULL, + [LanguageIsDefault] bit NOT NULL, + [UniqueName] nvarchar(255) NOT NULL, + [UniqueNameNormalized] nvarchar(255) NOT NULL, + [DisplayName] nvarchar(255) NULL, + [Description] nvarchar(max) NULL, + [FieldValues] nvarchar(max) NULL, + [Revision] bigint NOT NULL, + [PublishedBy] nvarchar(255) NULL, + [PublishedOn] datetime2 NOT NULL, + CONSTRAINT [PK_PublishedContents] PRIMARY KEY ([ContentLocaleId]), + CONSTRAINT [FK_PublishedContents_ContentLocales_ContentLocaleId] FOREIGN KEY ([ContentLocaleId]) REFERENCES [Cms].[ContentLocales] ([ContentLocaleId]) ON DELETE CASCADE, + CONSTRAINT [FK_PublishedContents_ContentTypes_ContentTypeId] FOREIGN KEY ([ContentTypeId]) REFERENCES [Cms].[ContentTypes] ([ContentTypeId]) ON DELETE NO ACTION, + CONSTRAINT [FK_PublishedContents_Contents_ContentId] FOREIGN KEY ([ContentId]) REFERENCES [Cms].[Contents] ([ContentId]) ON DELETE NO ACTION, + CONSTRAINT [FK_PublishedContents_Languages_LanguageId] FOREIGN KEY ([LanguageId]) REFERENCES [Cms].[Languages] ([LanguageId]) ON DELETE NO ACTION +); + +CREATE TABLE [Cms].[UniqueIndex] ( + [UniqueIndexId] int NOT NULL IDENTITY, + [ContentTypeId] int NOT NULL, + [ContentTypeUid] uniqueidentifier NOT NULL, + [ContentTypeName] nvarchar(255) NOT NULL, + [LanguageId] int NULL, + [LanguageUid] uniqueidentifier NULL, + [LanguageCode] nvarchar(16) NULL, + [LanguageIsDefault] bit NOT NULL, + [FieldTypeId] int NOT NULL, + [FieldTypeUid] uniqueidentifier NOT NULL, + [FieldTypeName] nvarchar(255) NOT NULL, + [FieldDefinitionId] int NOT NULL, + [FieldDefinitionUid] uniqueidentifier NOT NULL, + [FieldDefinitionName] nvarchar(255) NOT NULL, + [Revision] bigint NOT NULL, + [Status] nvarchar(10) NOT NULL, + [Value] nvarchar(255) NOT NULL, + [ValueNormalized] nvarchar(255) NOT NULL, + [Key] nvarchar(278) NOT NULL, + [ContentId] int NOT NULL, + [ContentUid] uniqueidentifier NOT NULL, + [ContentLocaleId] int NOT NULL, + [ContentLocaleName] nvarchar(255) NOT NULL, + CONSTRAINT [PK_UniqueIndex] PRIMARY KEY ([UniqueIndexId]), + CONSTRAINT [FK_UniqueIndex_ContentLocales_ContentLocaleId] FOREIGN KEY ([ContentLocaleId]) REFERENCES [Cms].[ContentLocales] ([ContentLocaleId]) ON DELETE CASCADE, + CONSTRAINT [FK_UniqueIndex_ContentTypes_ContentTypeId] FOREIGN KEY ([ContentTypeId]) REFERENCES [Cms].[ContentTypes] ([ContentTypeId]) ON DELETE CASCADE, + CONSTRAINT [FK_UniqueIndex_Contents_ContentId] FOREIGN KEY ([ContentId]) REFERENCES [Cms].[Contents] ([ContentId]), + CONSTRAINT [FK_UniqueIndex_FieldDefinitions_FieldDefinitionId] FOREIGN KEY ([FieldDefinitionId]) REFERENCES [Cms].[FieldDefinitions] ([FieldDefinitionId]), + CONSTRAINT [FK_UniqueIndex_FieldTypes_FieldTypeId] FOREIGN KEY ([FieldTypeId]) REFERENCES [Cms].[FieldTypes] ([FieldTypeId]) ON DELETE CASCADE, + CONSTRAINT [FK_UniqueIndex_Languages_LanguageId] FOREIGN KEY ([LanguageId]) REFERENCES [Cms].[Languages] ([LanguageId]) ON DELETE CASCADE +); + +CREATE UNIQUE INDEX [IX_ContentLocales_ContentId_LanguageId] ON [Cms].[ContentLocales] ([ContentId], [LanguageId]) WHERE [LanguageId] IS NOT NULL; + +CREATE UNIQUE INDEX [IX_ContentLocales_ContentTypeId_LanguageId_UniqueNameNormalized] ON [Cms].[ContentLocales] ([ContentTypeId], [LanguageId], [UniqueNameNormalized]) WHERE [LanguageId] IS NOT NULL; + +CREATE INDEX [IX_ContentLocales_CreatedBy] ON [Cms].[ContentLocales] ([CreatedBy]); + +CREATE INDEX [IX_ContentLocales_CreatedOn] ON [Cms].[ContentLocales] ([CreatedOn]); + +CREATE INDEX [IX_ContentLocales_DisplayName] ON [Cms].[ContentLocales] ([DisplayName]); + +CREATE INDEX [IX_ContentLocales_IsPublished] ON [Cms].[ContentLocales] ([IsPublished]); + +CREATE INDEX [IX_ContentLocales_LanguageId] ON [Cms].[ContentLocales] ([LanguageId]); + +CREATE INDEX [IX_ContentLocales_PublishedBy] ON [Cms].[ContentLocales] ([PublishedBy]); + +CREATE INDEX [IX_ContentLocales_PublishedOn] ON [Cms].[ContentLocales] ([PublishedOn]); + +CREATE INDEX [IX_ContentLocales_PublishedRevision] ON [Cms].[ContentLocales] ([PublishedRevision]); + +CREATE INDEX [IX_ContentLocales_Revision] ON [Cms].[ContentLocales] ([Revision]); + +CREATE INDEX [IX_ContentLocales_UniqueName] ON [Cms].[ContentLocales] ([UniqueName]); + +CREATE INDEX [IX_ContentLocales_UpdatedBy] ON [Cms].[ContentLocales] ([UpdatedBy]); + +CREATE INDEX [IX_ContentLocales_UpdatedOn] ON [Cms].[ContentLocales] ([UpdatedOn]); + +CREATE INDEX [IX_Contents_ContentTypeId] ON [Cms].[Contents] ([ContentTypeId]); + +CREATE INDEX [IX_Contents_CreatedBy] ON [Cms].[Contents] ([CreatedBy]); + +CREATE INDEX [IX_Contents_CreatedOn] ON [Cms].[Contents] ([CreatedOn]); + +CREATE UNIQUE INDEX [IX_Contents_Id] ON [Cms].[Contents] ([Id]); + +CREATE UNIQUE INDEX [IX_Contents_StreamId] ON [Cms].[Contents] ([StreamId]); + +CREATE INDEX [IX_Contents_UpdatedBy] ON [Cms].[Contents] ([UpdatedBy]); + +CREATE INDEX [IX_Contents_UpdatedOn] ON [Cms].[Contents] ([UpdatedOn]); + +CREATE INDEX [IX_Contents_Version] ON [Cms].[Contents] ([Version]); + +CREATE INDEX [IX_ContentTypes_CreatedBy] ON [Cms].[ContentTypes] ([CreatedBy]); + +CREATE INDEX [IX_ContentTypes_CreatedOn] ON [Cms].[ContentTypes] ([CreatedOn]); + +CREATE INDEX [IX_ContentTypes_DisplayName] ON [Cms].[ContentTypes] ([DisplayName]); + +CREATE INDEX [IX_ContentTypes_FieldCount] ON [Cms].[ContentTypes] ([FieldCount]); + +CREATE UNIQUE INDEX [IX_ContentTypes_Id] ON [Cms].[ContentTypes] ([Id]); + +CREATE INDEX [IX_ContentTypes_IsInvariant] ON [Cms].[ContentTypes] ([IsInvariant]); + +CREATE UNIQUE INDEX [IX_ContentTypes_StreamId] ON [Cms].[ContentTypes] ([StreamId]); + +CREATE INDEX [IX_ContentTypes_UniqueName] ON [Cms].[ContentTypes] ([UniqueName]); + +CREATE UNIQUE INDEX [IX_ContentTypes_UniqueNameNormalized] ON [Cms].[ContentTypes] ([UniqueNameNormalized]); + +CREATE INDEX [IX_ContentTypes_UpdatedBy] ON [Cms].[ContentTypes] ([UpdatedBy]); + +CREATE INDEX [IX_ContentTypes_UpdatedOn] ON [Cms].[ContentTypes] ([UpdatedOn]); + +CREATE INDEX [IX_ContentTypes_Version] ON [Cms].[ContentTypes] ([Version]); + +CREATE UNIQUE INDEX [IX_FieldDefinitions_ContentTypeId_Id] ON [Cms].[FieldDefinitions] ([ContentTypeId], [Id]); + +CREATE UNIQUE INDEX [IX_FieldDefinitions_ContentTypeId_Order] ON [Cms].[FieldDefinitions] ([ContentTypeId], [Order]); + +CREATE UNIQUE INDEX [IX_FieldDefinitions_ContentTypeId_UniqueNameNormalized] ON [Cms].[FieldDefinitions] ([ContentTypeId], [UniqueNameNormalized]); + +CREATE INDEX [IX_FieldDefinitions_FieldTypeId] ON [Cms].[FieldDefinitions] ([FieldTypeId]); + +CREATE INDEX [IX_FieldIndex_Boolean] ON [Cms].[FieldIndex] ([Boolean]); + +CREATE INDEX [IX_FieldIndex_ContentId] ON [Cms].[FieldIndex] ([ContentId]); + +CREATE INDEX [IX_FieldIndex_ContentLocaleId] ON [Cms].[FieldIndex] ([ContentLocaleId]); + +CREATE UNIQUE INDEX [IX_FieldIndex_ContentLocaleId_FieldDefinitionId_Status] ON [Cms].[FieldIndex] ([ContentLocaleId], [FieldDefinitionId], [Status]); + +CREATE INDEX [IX_FieldIndex_ContentLocaleName] ON [Cms].[FieldIndex] ([ContentLocaleName]); + +CREATE INDEX [IX_FieldIndex_ContentTypeId] ON [Cms].[FieldIndex] ([ContentTypeId]); + +CREATE INDEX [IX_FieldIndex_ContentTypeName] ON [Cms].[FieldIndex] ([ContentTypeName]); + +CREATE INDEX [IX_FieldIndex_ContentTypeUid] ON [Cms].[FieldIndex] ([ContentTypeUid]); + +CREATE INDEX [IX_FieldIndex_ContentUid] ON [Cms].[FieldIndex] ([ContentUid]); + +CREATE INDEX [IX_FieldIndex_DateTime] ON [Cms].[FieldIndex] ([DateTime]); + +CREATE INDEX [IX_FieldIndex_FieldDefinitionId] ON [Cms].[FieldIndex] ([FieldDefinitionId]); + +CREATE INDEX [IX_FieldIndex_FieldDefinitionName] ON [Cms].[FieldIndex] ([FieldDefinitionName]); + +CREATE INDEX [IX_FieldIndex_FieldDefinitionUid] ON [Cms].[FieldIndex] ([FieldDefinitionUid]); + +CREATE INDEX [IX_FieldIndex_FieldTypeId] ON [Cms].[FieldIndex] ([FieldTypeId]); + +CREATE INDEX [IX_FieldIndex_FieldTypeName] ON [Cms].[FieldIndex] ([FieldTypeName]); + +CREATE INDEX [IX_FieldIndex_FieldTypeUid] ON [Cms].[FieldIndex] ([FieldTypeUid]); + +CREATE INDEX [IX_FieldIndex_LanguageCode] ON [Cms].[FieldIndex] ([LanguageCode]); + +CREATE INDEX [IX_FieldIndex_LanguageId] ON [Cms].[FieldIndex] ([LanguageId]); + +CREATE INDEX [IX_FieldIndex_LanguageIsDefault] ON [Cms].[FieldIndex] ([LanguageIsDefault]); + +CREATE INDEX [IX_FieldIndex_LanguageUid] ON [Cms].[FieldIndex] ([LanguageUid]); + +CREATE INDEX [IX_FieldIndex_Number] ON [Cms].[FieldIndex] ([Number]); + +CREATE INDEX [IX_FieldIndex_Revision] ON [Cms].[FieldIndex] ([Revision]); + +CREATE INDEX [IX_FieldIndex_Status] ON [Cms].[FieldIndex] ([Status]); + +CREATE INDEX [IX_FieldIndex_String] ON [Cms].[FieldIndex] ([String]); + +CREATE INDEX [IX_FieldTypes_CreatedBy] ON [Cms].[FieldTypes] ([CreatedBy]); + +CREATE INDEX [IX_FieldTypes_CreatedOn] ON [Cms].[FieldTypes] ([CreatedOn]); + +CREATE INDEX [IX_FieldTypes_DataType] ON [Cms].[FieldTypes] ([DataType]); + +CREATE INDEX [IX_FieldTypes_DisplayName] ON [Cms].[FieldTypes] ([DisplayName]); + +CREATE UNIQUE INDEX [IX_FieldTypes_Id] ON [Cms].[FieldTypes] ([Id]); + +CREATE UNIQUE INDEX [IX_FieldTypes_StreamId] ON [Cms].[FieldTypes] ([StreamId]); + +CREATE INDEX [IX_FieldTypes_UniqueName] ON [Cms].[FieldTypes] ([UniqueName]); + +CREATE UNIQUE INDEX [IX_FieldTypes_UniqueNameNormalized] ON [Cms].[FieldTypes] ([UniqueNameNormalized]); + +CREATE INDEX [IX_FieldTypes_UpdatedBy] ON [Cms].[FieldTypes] ([UpdatedBy]); + +CREATE INDEX [IX_FieldTypes_UpdatedOn] ON [Cms].[FieldTypes] ([UpdatedOn]); + +CREATE INDEX [IX_FieldTypes_Version] ON [Cms].[FieldTypes] ([Version]); + +CREATE INDEX [IX_Languages_Code] ON [Cms].[Languages] ([Code]); + +CREATE UNIQUE INDEX [IX_Languages_CodeNormalized] ON [Cms].[Languages] ([CodeNormalized]); + +CREATE INDEX [IX_Languages_CreatedBy] ON [Cms].[Languages] ([CreatedBy]); + +CREATE INDEX [IX_Languages_CreatedOn] ON [Cms].[Languages] ([CreatedOn]); + +CREATE INDEX [IX_Languages_DisplayName] ON [Cms].[Languages] ([DisplayName]); + +CREATE INDEX [IX_Languages_EnglishName] ON [Cms].[Languages] ([EnglishName]); + +CREATE UNIQUE INDEX [IX_Languages_Id] ON [Cms].[Languages] ([Id]); + +CREATE INDEX [IX_Languages_IsDefault] ON [Cms].[Languages] ([IsDefault]); + +CREATE INDEX [IX_Languages_LCID] ON [Cms].[Languages] ([LCID]); + +CREATE INDEX [IX_Languages_NativeName] ON [Cms].[Languages] ([NativeName]); + +CREATE UNIQUE INDEX [IX_Languages_StreamId] ON [Cms].[Languages] ([StreamId]); + +CREATE INDEX [IX_Languages_UpdatedBy] ON [Cms].[Languages] ([UpdatedBy]); + +CREATE INDEX [IX_Languages_UpdatedOn] ON [Cms].[Languages] ([UpdatedOn]); + +CREATE INDEX [IX_Languages_Version] ON [Cms].[Languages] ([Version]); + +CREATE INDEX [IX_PublishedContents_ContentId] ON [Cms].[PublishedContents] ([ContentId]); + +CREATE INDEX [IX_PublishedContents_ContentTypeId] ON [Cms].[PublishedContents] ([ContentTypeId]); + +CREATE INDEX [IX_PublishedContents_ContentTypeName] ON [Cms].[PublishedContents] ([ContentTypeName]); + +CREATE INDEX [IX_PublishedContents_ContentTypeUid] ON [Cms].[PublishedContents] ([ContentTypeUid]); + +CREATE INDEX [IX_PublishedContents_ContentUid] ON [Cms].[PublishedContents] ([ContentUid]); + +CREATE INDEX [IX_PublishedContents_DisplayName] ON [Cms].[PublishedContents] ([DisplayName]); + +CREATE INDEX [IX_PublishedContents_LanguageCode] ON [Cms].[PublishedContents] ([LanguageCode]); + +CREATE INDEX [IX_PublishedContents_LanguageId] ON [Cms].[PublishedContents] ([LanguageId]); + +CREATE INDEX [IX_PublishedContents_LanguageIsDefault] ON [Cms].[PublishedContents] ([LanguageIsDefault]); + +CREATE INDEX [IX_PublishedContents_LanguageUid] ON [Cms].[PublishedContents] ([LanguageUid]); + +CREATE INDEX [IX_PublishedContents_PublishedBy] ON [Cms].[PublishedContents] ([PublishedBy]); + +CREATE INDEX [IX_PublishedContents_PublishedOn] ON [Cms].[PublishedContents] ([PublishedOn]); + +CREATE INDEX [IX_PublishedContents_Revision] ON [Cms].[PublishedContents] ([Revision]); + +CREATE INDEX [IX_PublishedContents_UniqueName] ON [Cms].[PublishedContents] ([UniqueName]); + +CREATE INDEX [IX_PublishedContents_UniqueNameNormalized] ON [Cms].[PublishedContents] ([UniqueNameNormalized]); + +CREATE INDEX [IX_UniqueIndex_ContentId] ON [Cms].[UniqueIndex] ([ContentId]); + +CREATE INDEX [IX_UniqueIndex_ContentLocaleId] ON [Cms].[UniqueIndex] ([ContentLocaleId]); + +CREATE INDEX [IX_UniqueIndex_ContentLocaleName] ON [Cms].[UniqueIndex] ([ContentLocaleName]); + +CREATE INDEX [IX_UniqueIndex_ContentTypeId] ON [Cms].[UniqueIndex] ([ContentTypeId]); + +CREATE INDEX [IX_UniqueIndex_ContentTypeName] ON [Cms].[UniqueIndex] ([ContentTypeName]); + +CREATE INDEX [IX_UniqueIndex_ContentTypeUid] ON [Cms].[UniqueIndex] ([ContentTypeUid]); + +CREATE INDEX [IX_UniqueIndex_ContentUid] ON [Cms].[UniqueIndex] ([ContentUid]); + +CREATE INDEX [IX_UniqueIndex_FieldDefinitionId] ON [Cms].[UniqueIndex] ([FieldDefinitionId]); + +CREATE UNIQUE INDEX [IX_UniqueIndex_FieldDefinitionId_LanguageId_Status_ValueNormalized] ON [Cms].[UniqueIndex] ([FieldDefinitionId], [LanguageId], [Status], [ValueNormalized]) WHERE [LanguageId] IS NOT NULL; + +CREATE INDEX [IX_UniqueIndex_FieldDefinitionName] ON [Cms].[UniqueIndex] ([FieldDefinitionName]); + +CREATE INDEX [IX_UniqueIndex_FieldDefinitionUid] ON [Cms].[UniqueIndex] ([FieldDefinitionUid]); + +CREATE INDEX [IX_UniqueIndex_FieldTypeId] ON [Cms].[UniqueIndex] ([FieldTypeId]); + +CREATE INDEX [IX_UniqueIndex_FieldTypeName] ON [Cms].[UniqueIndex] ([FieldTypeName]); + +CREATE INDEX [IX_UniqueIndex_FieldTypeUid] ON [Cms].[UniqueIndex] ([FieldTypeUid]); + +CREATE INDEX [IX_UniqueIndex_Key] ON [Cms].[UniqueIndex] ([Key]); + +CREATE INDEX [IX_UniqueIndex_LanguageCode] ON [Cms].[UniqueIndex] ([LanguageCode]); + +CREATE INDEX [IX_UniqueIndex_LanguageId] ON [Cms].[UniqueIndex] ([LanguageId]); + +CREATE INDEX [IX_UniqueIndex_LanguageIsDefault] ON [Cms].[UniqueIndex] ([LanguageIsDefault]); + +CREATE INDEX [IX_UniqueIndex_LanguageUid] ON [Cms].[UniqueIndex] ([LanguageUid]); + +CREATE INDEX [IX_UniqueIndex_Revision] ON [Cms].[UniqueIndex] ([Revision]); + +CREATE INDEX [IX_UniqueIndex_Status] ON [Cms].[UniqueIndex] ([Status]); + +CREATE INDEX [IX_UniqueIndex_Value] ON [Cms].[UniqueIndex] ([Value]); + +CREATE INDEX [IX_UniqueIndex_ValueNormalized] ON [Cms].[UniqueIndex] ([ValueNormalized]); + +INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion]) +VALUES (N'20250130063047_Cms_Release_1_0_0', N'9.0.0'); + +COMMIT; +GO From e0c6d6ff50d4108248503ba46b13278a2814afed Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Thu, 30 Jan 2025 01:38:07 -0500 Subject: [PATCH 4/4] nuget --- backend/src/Logitar.Cms/Logitar.Cms.csproj | 8 ++++---- .../Logitar.Cms.IntegrationTests.csproj | 6 +++--- backend/tests/Logitar.Cms.Tests/Logitar.Cms.Tests.csproj | 6 +++--- .../Logitar.Cms.UnitTests/Logitar.Cms.UnitTests.csproj | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/backend/src/Logitar.Cms/Logitar.Cms.csproj b/backend/src/Logitar.Cms/Logitar.Cms.csproj index 1c5e4d0e..e2b093bb 100644 --- a/backend/src/Logitar.Cms/Logitar.Cms.csproj +++ b/backend/src/Logitar.Cms/Logitar.Cms.csproj @@ -27,15 +27,15 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/backend/tests/Logitar.Cms.IntegrationTests/Logitar.Cms.IntegrationTests.csproj b/backend/tests/Logitar.Cms.IntegrationTests/Logitar.Cms.IntegrationTests.csproj index a0a1e55e..75f9d7aa 100644 --- a/backend/tests/Logitar.Cms.IntegrationTests/Logitar.Cms.IntegrationTests.csproj +++ b/backend/tests/Logitar.Cms.IntegrationTests/Logitar.Cms.IntegrationTests.csproj @@ -27,13 +27,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/tests/Logitar.Cms.Tests/Logitar.Cms.Tests.csproj b/backend/tests/Logitar.Cms.Tests/Logitar.Cms.Tests.csproj index aa4f5a43..b25688e8 100644 --- a/backend/tests/Logitar.Cms.Tests/Logitar.Cms.Tests.csproj +++ b/backend/tests/Logitar.Cms.Tests/Logitar.Cms.Tests.csproj @@ -18,14 +18,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/tests/Logitar.Cms.UnitTests/Logitar.Cms.UnitTests.csproj b/backend/tests/Logitar.Cms.UnitTests/Logitar.Cms.UnitTests.csproj index ca0ef4cd..7c2f52c8 100644 --- a/backend/tests/Logitar.Cms.UnitTests/Logitar.Cms.UnitTests.csproj +++ b/backend/tests/Logitar.Cms.UnitTests/Logitar.Cms.UnitTests.csproj @@ -17,13 +17,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive