diff --git a/src/cloudscribe.Core.SimpleContent/cloudscribe.Core.SimpleContent.csproj b/src/cloudscribe.Core.SimpleContent/cloudscribe.Core.SimpleContent.csproj index ba2c2053a..3a1b7a66a 100644 --- a/src/cloudscribe.Core.SimpleContent/cloudscribe.Core.SimpleContent.csproj +++ b/src/cloudscribe.Core.SimpleContent/cloudscribe.Core.SimpleContent.csproj @@ -2,7 +2,7 @@ integration library for integrating cloudscribe SimpleContent with cloudscribe Core multi-tenant web app foundation - 5.1.0 + 5.1.2 Joe Audette netcoreapp3.1 cloudscribe;blog diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/DisqusCommentsPartial.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/DisqusCommentsPartial.cshtml index 6b2fbe79a..9f103f464 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/DisqusCommentsPartial.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/DisqusCommentsPartial.cshtml @@ -7,7 +7,7 @@ var disqusScriptPath = "//" + Model.ProjectSettings.DisqusShortName + ".disqus.com/embed.js"; } -@if (allowDisqus && (Model.CurrentPost != null) && (!string.IsNullOrEmpty(Model.CurrentPost.Id))) +@if (allowDisqus && (Model.CurrentPost != null) && (!string.IsNullOrEmpty(Model.CurrentPost.Id)) && (Model.ShowComments)) { @sr["Comments"]
diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/Edit.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/Edit.cshtml index 736228da6..c29c0816e 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/Edit.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/Edit.cshtml @@ -64,6 +64,12 @@ +
+
+ + +
+
@if (Model.TeasersEnabled) { @@ -106,7 +112,7 @@ } - + @if (!string.IsNullOrEmpty(Model.Id)) diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/EditWithTemplate.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/EditWithTemplate.cshtml index 97b2969a1..c77dd83e9 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/EditWithTemplate.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/EditWithTemplate.cshtml @@ -63,6 +63,12 @@ +
+
+ + +
+
@if (Model.TeasersEnabled) { @@ -70,7 +76,7 @@ } else { - + }
diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostDetailPartial.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostDetailPartial.cshtml index c5808f94d..996bf3a16 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostDetailPartial.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostDetailPartial.cshtml @@ -34,7 +34,10 @@ if (!pubDate.HasValue) { pubDate = DateTime.UtcNow; } } - + @if (Model.ShowComments) + { + + } @if (Model.CurrentPost.Categories.Count > 0) {
    @@ -47,7 +50,7 @@ }
} -
+ diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostPartial.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostPartial.cshtml index 306a4d9de..7f835df18 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostPartial.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/Views/Blog/PostPartial.cshtml @@ -37,7 +37,10 @@
- + @if (Model.TmpPost.ShowComments) + { + + } @if (Model.TmpPost.Categories.Count > 0) {
    @@ -48,7 +51,7 @@ }
} -
+
@if (!Model.TmpPost.IsPublished) diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/cloudscribe.SimpleContent.CompiledViews.Bootstrap4.csproj b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/cloudscribe.SimpleContent.CompiledViews.Bootstrap4.csproj index 64a380b79..6f5804fe3 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/cloudscribe.SimpleContent.CompiledViews.Bootstrap4.csproj +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap4/cloudscribe.SimpleContent.CompiledViews.Bootstrap4.csproj @@ -2,7 +2,7 @@ Bootstrap 4 pre-compiled views for cloudscribe.SimpleContent.Web - 5.1.0 + 5.1.2 Joe Audette netcoreapp3.1 3.0 diff --git a/src/cloudscribe.SimpleContent.Models/Blog/IPost.cs b/src/cloudscribe.SimpleContent.Models/Blog/IPost.cs index c6cedc779..dfb510833 100644 --- a/src/cloudscribe.SimpleContent.Models/Blog/IPost.cs +++ b/src/cloudscribe.SimpleContent.Models/Blog/IPost.cs @@ -36,6 +36,7 @@ public interface IPost : IContentItem bool IsFeatured { get; set; } string ImageUrl { get; set; } string ThumbnailUrl { get; set; } + bool ShowComments { get; set; } /// /// If not null or whitespace, displays this teaser on blog index/listing views regardless of settings. diff --git a/src/cloudscribe.SimpleContent.Models/Blog/Post.cs b/src/cloudscribe.SimpleContent.Models/Blog/Post.cs index bb7facfdf..f79bfca05 100644 --- a/src/cloudscribe.SimpleContent.Models/Blog/Post.cs +++ b/src/cloudscribe.SimpleContent.Models/Blog/Post.cs @@ -57,6 +57,7 @@ public Post() public string ThumbnailUrl { get; set; } public string ContentType { get; set; } = "html"; + public bool ShowComments { get; set; } = true; /// /// If not null or whitespace, displays this teaser on blog index/listing views regardless of settings. diff --git a/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs b/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs index c4c1a8bb6..ef4c851ae 100644 --- a/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs +++ b/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs @@ -193,6 +193,7 @@ public static void CopyTo(this IPost input, IPost target) target.CorrelationKey = input.CorrelationKey; target.ImageUrl = input.ImageUrl; target.ThumbnailUrl = input.ThumbnailUrl; + target.ShowComments = input.ShowComments; target.IsFeatured = input.IsFeatured; target.TeaserOverride = input.TeaserOverride; target.SuppressTeaser = input.SuppressTeaser; diff --git a/src/cloudscribe.SimpleContent.Models/cloudscribe.SimpleContent.Models.csproj b/src/cloudscribe.SimpleContent.Models/cloudscribe.SimpleContent.Models.csproj index 31a84a1a0..c061fdd89 100644 --- a/src/cloudscribe.SimpleContent.Models/cloudscribe.SimpleContent.Models.csproj +++ b/src/cloudscribe.SimpleContent.Models/cloudscribe.SimpleContent.Models.csproj @@ -2,7 +2,7 @@ cloudscribe.SimpleContent.Models Class Library - 5.1.0 + 5.1.2 Joe Audette netstandard2.0 cloudscribe;blog;cms @@ -14,10 +14,14 @@ - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs index c271c9f70..7e4bfbcab 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs @@ -52,6 +52,9 @@ public PostEntity() public string ImageUrl { get; set; } public string ThumbnailUrl { get; set; } + //added to support TalkAbout Comments switch + public bool ShowComments { get; set; } = false; + private List categories; public List Categories { diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/cloudscribe.SimpleContent.Storage.EFCore.Common.csproj b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/cloudscribe.SimpleContent.Storage.EFCore.Common.csproj index 541e312db..f2f86040b 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/cloudscribe.SimpleContent.Storage.EFCore.Common.csproj +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/cloudscribe.SimpleContent.Storage.EFCore.Common.csproj @@ -2,7 +2,7 @@ base package - Entity Framework Core implementation of cloudscribe SimpleContent commands and queries - 5.1.0 + 5.1.2 Joe Audette netstandard2.1 cloudscribe;commands;queries;ef diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20200723185114_AddPostShowCommentsSwitch.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20200723185114_AddPostShowCommentsSwitch.Designer.cs new file mode 100644 index 000000000..958486d74 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20200723185114_AddPostShowCommentsSwitch.Designer.cs @@ -0,0 +1,895 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using cloudscribe.SimpleContent.Storage.EFCore.MSSQL; + +namespace cloudscribe.SimpleContent.Storage.EFCore.MSSQL.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20200723185114_AddPostShowCommentsSwitch")] + partial class AddPostShowCommentsSwitch + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasMaxLength(36); + + b.Property("ArchivedBy") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ArchivedUtc") + .HasColumnType("datetime2"); + + b.Property("Author") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("nvarchar(max)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentId") + .IsRequired() + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("ContentSource") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DraftAuthor") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DraftPubDate") + .HasColumnType("datetime2"); + + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDraftHx") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("LastModifiedByUser") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ParentSlug") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ProjectId") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("Slug") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("nvarchar(max)"); + + b.Property("WasDeleted") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentSource"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("CreatedByUser"); + + b.HasIndex("LastModifiedByUser"); + + b.HasIndex("Title"); + + b.ToTable("cs_ContentHistory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("AboutContent") + .HasColumnType("nvarchar(max)"); + + b.Property("AboutHeading") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("AddBlogToPagesTree") + .HasColumnType("bit"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("bit"); + + b.Property("BlogPageNavComponentVisibility") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("BlogPagePosition") + .HasColumnType("int"); + + b.Property("BlogPageText") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("CdnUrl") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ChannelCategoriesCsv") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ChannelRating") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("ChannelTimeToLive") + .HasColumnType("int"); + + b.Property("CommentNotificationEmail") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("CopyrightNotice") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("DaysToComment") + .HasColumnType("int"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisqusShortName") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("FacebookAppId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("Image") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("bit"); + + b.Property("LanguageCode") + .HasColumnType("nvarchar(10)") + .HasMaxLength(10); + + b.Property("LocalMediaVirtualPath") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ManagingEditorEmail") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("bit"); + + b.Property("PostsPerPage") + .HasColumnType("int"); + + b.Property("PubDateFormat") + .HasColumnType("nvarchar(75)") + .HasMaxLength(75); + + b.Property("Publisher") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("PublisherEntityType") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("PublisherLogoHeight") + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("PublisherLogoUrl") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("PublisherLogoWidth") + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("RecaptchaPrivateKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("RecaptchaPublicKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("RemoteFeedUrl") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ShowAboutBox") + .HasColumnType("bit"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("bit"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("bit"); + + b.Property("ShowRelatedPosts") + .HasColumnType("bit"); + + b.Property("ShowTitle") + .HasColumnType("bit"); + + b.Property("SiteName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("TeaserMode") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)0); + + b.Property("TeaserTruncationLength") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("TeaserTruncationMode") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)0); + + b.Property("TimeZoneId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("Title") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("TwitterCreator") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("TwitterPublisher") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("bit"); + + b.Property("WebmasterEmail") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("PageEntityId") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("bit"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("PageEntityId") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("UserAgent") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("nvarchar(500)") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DisableEditor") + .HasColumnType("bit"); + + b.Property("DraftAuthor") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DraftPubDate") + .HasColumnType("datetime2"); + + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalUrl") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("LastModifiedByUser") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("MenuFilters") + .HasColumnType("nvarchar(500)") + .HasMaxLength(500); + + b.Property("MenuOnly") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(500)") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("ParentSlug") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("ShowCategories") + .HasColumnType("bit"); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("ShowHeading") + .HasColumnType("bit"); + + b.Property("ShowLastModified") + .HasColumnType("bit"); + + b.Property("ShowMenu") + .HasColumnType("bit"); + + b.Property("ShowPubDate") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("TemplateKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("Environment") + .IsRequired() + .HasColumnType("nvarchar(15)") + .HasMaxLength(15); + + b.Property("PageEntityId") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("Sort") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(10)") + .HasMaxLength(10); + + b.Property("Url") + .IsRequired() + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("PostEntityId") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("bit"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("PostEntityId") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("UserAgent") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasColumnType("nvarchar(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("AutoTeaser") + .HasColumnType("nvarchar(max)"); + + b.Property("BlogId") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("CategoriesCsv") + .HasColumnType("nvarchar(500)") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DraftAuthor") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DraftPubDate") + .HasColumnType("datetime2"); + + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("ImageUrl") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("IsFeatured") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("LastModifiedByUser") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(500)") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("SuppressTeaser") + .HasColumnType("bit"); + + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateKey") + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.Property("ThumbnailUrl") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageComments") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageResources") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) + .WithMany("PostComments") + .HasForeignKey("PostEntityId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20200723185114_AddPostShowCommentsSwitch.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20200723185114_AddPostShowCommentsSwitch.cs new file mode 100644 index 000000000..bcee786f9 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20200723185114_AddPostShowCommentsSwitch.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace cloudscribe.SimpleContent.Storage.EFCore.MSSQL.Migrations +{ + public partial class AddPostShowCommentsSwitch : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ShowComments", + table: "cs_Post", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ShowComments", + table: "cs_Post"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs index 4102f4ba7..39dbfba31 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using cloudscribe.SimpleContent.Models; using cloudscribe.SimpleContent.Storage.EFCore.MSSQL; namespace cloudscribe.SimpleContent.Storage.EFCore.MSSQL.Migrations @@ -16,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085") + .HasAnnotation("ProductVersion", "3.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -24,99 +23,134 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") .HasMaxLength(36); b.Property("ArchivedBy") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("ArchivedUtc"); + b.Property("ArchivedUtc") + .HasColumnType("datetime2"); b.Property("Author") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("CategoriesCsv"); + b.Property("CategoriesCsv") + .HasColumnType("nvarchar(max)"); - b.Property("Content"); + b.Property("Content") + .HasColumnType("nvarchar(max)"); b.Property("ContentId") .IsRequired() + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("ContentSource") .IsRequired() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("datetime2"); b.Property("DraftAuthor") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("datetime2"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); - b.Property("IsDraftHx"); + b.Property("IsDraftHx") + .HasColumnType("bit"); b.Property("IsPublished") .HasColumnType("bit"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("datetime2"); b.Property("LastModifiedByUser") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); - b.Property("MetaDescription"); + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("int"); b.Property("ParentId") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("ParentSlug") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("ProjectId") + .HasColumnType("nvarchar(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime2"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); b.Property("Serializer") + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property("Slug") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); b.Property("TemplateKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("nvarchar(max)"); - b.Property("WasDeleted"); + b.Property("WasDeleted") + .HasColumnType("bit"); b.HasKey("Id"); @@ -138,12 +172,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); - b.Property("AboutContent"); + b.Property("AboutContent") + .HasColumnType("nvarchar(max)"); b.Property("AboutHeading") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("AddBlogToPagesTree") @@ -153,107 +189,140 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("bit"); b.Property("BlogPageNavComponentVisibility") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("BlogPagePosition"); + b.Property("BlogPagePosition") + .HasColumnType("int"); b.Property("BlogPageText") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("CdnUrl") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("ChannelCategoriesCsv") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("ChannelRating") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); - b.Property("ChannelTimeToLive"); + b.Property("ChannelTimeToLive") + .HasColumnType("int"); b.Property("CommentNotificationEmail") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("CopyrightNotice") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("DaysToComment"); + b.Property("DaysToComment") + .HasColumnType("int"); b.Property("DefaultContentType") .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("DefaultFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("int") .HasDefaultValue(20); b.Property("DefaultPageSlug") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("Description"); + b.Property("Description") + .HasColumnType("nvarchar(max)"); b.Property("DisqusShortName") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("FacebookAppId") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("Image") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("IncludePubDateInPostUrls") .HasColumnType("bit"); b.Property("LanguageCode") + .HasColumnType("nvarchar(10)") .HasMaxLength(10); b.Property("LocalMediaVirtualPath") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("ManagingEditorEmail") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("MaxFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("int") .HasDefaultValue(1000); b.Property("ModerateComments") .HasColumnType("bit"); - b.Property("PostsPerPage"); + b.Property("PostsPerPage") + .HasColumnType("int"); b.Property("PubDateFormat") + .HasColumnType("nvarchar(75)") .HasMaxLength(75); b.Property("Publisher") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("PublisherEntityType") + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property("PublisherLogoHeight") + .HasColumnType("nvarchar(20)") .HasMaxLength(20); b.Property("PublisherLogoUrl") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("PublisherLogoWidth") + .HasColumnType("nvarchar(20)") .HasMaxLength(20); b.Property("RecaptchaPrivateKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("RecaptchaPublicKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("RemoteFeedUrl") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("ShowAboutBox"); + b.Property("ShowAboutBox") + .HasColumnType("bit"); b.Property("ShowFeaturedPostsOnDefaultPage") .HasColumnType("bit"); @@ -261,42 +330,52 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ShowRecentPostsOnDefaultPage") .HasColumnType("bit"); - b.Property("ShowRelatedPosts"); + b.Property("ShowRelatedPosts") + .HasColumnType("bit"); b.Property("ShowTitle") .HasColumnType("bit"); b.Property("SiteName") + .HasColumnType("nvarchar(200)") .HasMaxLength(200); b.Property("TeaserMode") .ValueGeneratedOnAdd() + .HasColumnType("tinyint") .HasDefaultValue((byte)0); b.Property("TeaserTruncationLength") .ValueGeneratedOnAdd() + .HasColumnType("int") .HasDefaultValue(20); b.Property("TeaserTruncationMode") .ValueGeneratedOnAdd() + .HasColumnType("tinyint") .HasDefaultValue((byte)0); b.Property("TimeZoneId") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("Title") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("TwitterCreator") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("TwitterPublisher") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("UseDefaultPageAsRootNode") .HasColumnType("bit"); b.Property("WebmasterEmail") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.HasKey("Id"); @@ -307,13 +386,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => { b.Property("Value") + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property("PageEntityId") + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.HasKey("Value", "PageEntityId"); @@ -330,37 +412,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("nvarchar(max)"); b.Property("Email") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("bit"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("bit"); b.Property("PageEntityId") + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime2"); b.Property("UserAgent") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("Website") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -375,82 +468,108 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("CategoriesCsv") + .HasColumnType("nvarchar(500)") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("nvarchar(max)"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("datetime2"); - b.Property("DisableEditor"); + b.Property("DisableEditor") + .HasColumnType("bit"); b.Property("DraftAuthor") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("datetime2"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); b.Property("ExternalUrl") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("IsPublished") .HasColumnType("bit"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("datetime2"); b.Property("LastModifiedByUser") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("MenuFilters") + .HasColumnType("nvarchar(500)") .HasMaxLength(500); b.Property("MenuOnly") .HasColumnType("bit"); b.Property("MetaDescription") + .HasColumnType("nvarchar(500)") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("int"); b.Property("ParentId") + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("ParentSlug") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("ProjectId") .IsRequired() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime2"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); b.Property("Serializer") + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property("ShowCategories") @@ -473,16 +592,20 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Slug") .IsRequired() + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("TemplateKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); @@ -498,24 +621,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("Environment") .IsRequired() + .HasColumnType("nvarchar(15)") .HasMaxLength(15); b.Property("PageEntityId") + .HasColumnType("nvarchar(36)") .HasMaxLength(36); - b.Property("Sort"); + b.Property("Sort") + .HasColumnType("int"); b.Property("Type") .IsRequired() + .HasColumnType("nvarchar(10)") .HasMaxLength(10); b.Property("Url") .IsRequired() + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -528,13 +656,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => { b.Property("Value") + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property("PostEntityId") + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.HasKey("Value", "PostEntityId"); @@ -551,37 +682,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("nvarchar(max)"); b.Property("Email") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("bit"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("bit"); b.Property("PostEntityId") + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime2"); b.Property("UserAgent") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("Website") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -596,88 +738,120 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("AutoTeaser"); + b.Property("AutoTeaser") + .HasColumnType("nvarchar(max)"); b.Property("BlogId") .IsRequired() + .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property("CategoriesCsv") + .HasColumnType("nvarchar(500)") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("nvarchar(max)"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("datetime2"); b.Property("DraftAuthor") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("datetime2"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); b.Property("ImageUrl") + .HasColumnType("nvarchar(250)") .HasMaxLength(250); - b.Property("IsFeatured"); + b.Property("IsFeatured") + .HasColumnType("bit"); b.Property("IsPublished") .HasColumnType("bit"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("datetime2"); b.Property("LastModifiedByUser") + .HasColumnType("nvarchar(100)") .HasMaxLength(100); b.Property("MetaDescription") + .HasColumnType("nvarchar(500)") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime2"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); b.Property("Serializer") + .HasColumnType("nvarchar(50)") .HasMaxLength(50); + b.Property("ShowComments") + .HasColumnType("bit"); + b.Property("Slug") .IsRequired() + .HasColumnType("nvarchar(255)") .HasMaxLength(255); - b.Property("SuppressTeaser"); + b.Property("SuppressTeaser") + .HasColumnType("bit"); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); b.Property("TemplateKey") + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.Property("ThumbnailUrl") + .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property("Title") .IsRequired() + .HasColumnType("nvarchar(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -693,7 +867,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageComments") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -701,7 +875,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageResources") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -709,7 +883,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) .WithMany("PostComments") .HasForeignKey("PostEntityId"); }); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/SimpleContentDbContext.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/SimpleContentDbContext.cs index 1e27c9ac3..478ed862d 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/SimpleContentDbContext.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/SimpleContentDbContext.cs @@ -227,6 +227,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(p => p.ThumbnailUrl) .HasMaxLength(250); + entity.Property(p => p.ShowComments) + .IsRequired() + .HasColumnType("bit"); + entity.Property(p => p.IsFeatured) .IsRequired(); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/cloudscribe.SimpleContent.Storage.EFCore.MSSQL.csproj b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/cloudscribe.SimpleContent.Storage.EFCore.MSSQL.csproj index 578e8e969..b17f52b1b 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/cloudscribe.SimpleContent.Storage.EFCore.MSSQL.csproj +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/cloudscribe.SimpleContent.Storage.EFCore.MSSQL.csproj @@ -2,7 +2,7 @@ MSSQL Entity Framework Core implementation of cloudscribe SimpleContent commands and queries - 5.1.0 + 5.1.2 Joe Audette netstandard2.1 cloudscribe;commands;queries;ef diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20200723185158_AddPostShowCommentsSwitch.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20200723185158_AddPostShowCommentsSwitch.Designer.cs new file mode 100644 index 000000000..5a5afe8fb --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20200723185158_AddPostShowCommentsSwitch.Designer.cs @@ -0,0 +1,893 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using cloudscribe.SimpleContent.Storage.EFCore.MySQL; + +namespace cloudscribe.SimpleContent.Storage.EFCore.MySQL.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20200723185158_AddPostShowCommentsSwitch")] + partial class AddPostShowCommentsSwitch + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasMaxLength(36); + + b.Property("ArchivedBy") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ArchivedUtc") + .HasColumnType("datetime(6)"); + + b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ContentId") + .IsRequired() + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("ContentSource") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DraftAuthor") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsDraftHx") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("MetaHtml") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("MetaJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ParentSlug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ProjectId") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("SerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Serializer") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("Slug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("TeaserOverride") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("TemplateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("WasDeleted") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentSource"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("CreatedByUser"); + + b.HasIndex("LastModifiedByUser"); + + b.HasIndex("Title"); + + b.ToTable("cs_ContentHistory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("AboutContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("AboutHeading") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("AddBlogToPagesTree") + .HasColumnType("tinyint(1)"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("tinyint(1)"); + + b.Property("BlogPageNavComponentVisibility") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("BlogPagePosition") + .HasColumnType("int"); + + b.Property("BlogPageText") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("CdnUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ChannelCategoriesCsv") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ChannelRating") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("ChannelTimeToLive") + .HasColumnType("int"); + + b.Property("CommentNotificationEmail") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CopyrightNotice") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("DaysToComment") + .HasColumnType("int"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("DisqusShortName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("FacebookAppId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Image") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("tinyint(1)"); + + b.Property("LanguageCode") + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") + .HasMaxLength(10); + + b.Property("LocalMediaVirtualPath") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ManagingEditorEmail") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("tinyint(1)"); + + b.Property("PostsPerPage") + .HasColumnType("int"); + + b.Property("PubDateFormat") + .HasColumnType("varchar(75) CHARACTER SET utf8mb4") + .HasMaxLength(75); + + b.Property("Publisher") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("PublisherEntityType") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PublisherLogoHeight") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("PublisherLogoUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("PublisherLogoWidth") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("RecaptchaPrivateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("RecaptchaPublicKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("RemoteFeedUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ShowAboutBox") + .HasColumnType("tinyint(1)"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); + + b.Property("ShowRelatedPosts") + .HasColumnType("tinyint(1)"); + + b.Property("ShowTitle") + .HasColumnType("tinyint(1)"); + + b.Property("SiteName") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("TeaserMode") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)0); + + b.Property("TeaserTruncationLength") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("TeaserTruncationMode") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") + .HasDefaultValue((byte)0); + + b.Property("TimeZoneId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Title") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("TwitterCreator") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("TwitterPublisher") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("tinyint(1)"); + + b.Property("WebmasterEmail") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PageEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Email") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); + + b.Property("PageEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("UserAgent") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DisableEditor") + .HasColumnType("tinyint(1)"); + + b.Property("DraftAuthor") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ExternalUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("MenuFilters") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("MenuOnly") + .HasColumnType("tinyint(1)"); + + b.Property("MetaDescription") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("MetaJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("ParentSlug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("SerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Serializer") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("ShowCategories") + .HasColumnType("tinyint(1)"); + + b.Property("ShowComments") + .HasColumnType("tinyint(1)"); + + b.Property("ShowHeading") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModified") + .HasColumnType("tinyint(1)"); + + b.Property("ShowMenu") + .HasColumnType("tinyint(1)"); + + b.Property("ShowPubDate") + .HasColumnType("tinyint(1)"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("TemplateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("Environment") + .IsRequired() + .HasColumnType("varchar(15) CHARACTER SET utf8mb4") + .HasMaxLength(15); + + b.Property("PageEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("Sort") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") + .HasMaxLength(10); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PostEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Email") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); + + b.Property("PostEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("UserAgent") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("AutoTeaser") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("BlogId") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("CategoriesCsv") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DraftAuthor") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ImageUrl") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("IsFeatured") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("MetaJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("SerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Serializer") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("ShowComments") + .HasColumnType("tinyint(1)"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("SuppressTeaser") + .HasColumnType("tinyint(1)"); + + b.Property("TeaserOverride") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("TemplateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.Property("ThumbnailUrl") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Title") + .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageComments") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageResources") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) + .WithMany("PostComments") + .HasForeignKey("PostEntityId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20200723185158_AddPostShowCommentsSwitch.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20200723185158_AddPostShowCommentsSwitch.cs new file mode 100644 index 000000000..a86db2f0b --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20200723185158_AddPostShowCommentsSwitch.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace cloudscribe.SimpleContent.Storage.EFCore.MySQL.Migrations +{ + public partial class AddPostShowCommentsSwitch : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ShowComments", + table: "cs_Post", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ShowComments", + table: "cs_Post"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs index 8ac37bda9..2f0ffd4a5 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using cloudscribe.SimpleContent.Models; using cloudscribe.SimpleContent.Storage.EFCore.MySQL; namespace cloudscribe.SimpleContent.Storage.EFCore.MySQL.Migrations @@ -15,105 +14,141 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085") + .HasAnnotation("ProductVersion", "3.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() + .HasColumnType("char(36)") .HasMaxLength(36); b.Property("ArchivedBy") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("ArchivedUtc"); + b.Property("ArchivedUtc") + .HasColumnType("datetime(6)"); b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("CategoriesCsv"); + b.Property("CategoriesCsv") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("Content"); + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ContentId") .IsRequired() + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("ContentSource") .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); b.Property("DraftAuthor") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("IsDraftHx"); + b.Property("IsDraftHx") + .HasColumnType("tinyint(1)"); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("datetime(6)"); b.Property("LastModifiedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("MetaDescription"); + b.Property("MetaDescription") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("int"); b.Property("ParentId") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("ParentSlug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("ProjectId") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime(6)"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Serializer") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.Property("Slug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("TemplateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("WasDeleted"); + b.Property("WasDeleted") + .HasColumnType("tinyint(1)"); b.HasKey("Id"); @@ -135,157 +170,210 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("AboutContent"); + b.Property("AboutContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("AboutHeading") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("AddBlogToPagesTree"); + b.Property("AddBlogToPagesTree") + .HasColumnType("tinyint(1)"); - b.Property("BlogMenuLinksToNewestPost"); + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("tinyint(1)"); b.Property("BlogPageNavComponentVisibility") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("BlogPagePosition"); + b.Property("BlogPagePosition") + .HasColumnType("int"); b.Property("BlogPageText") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("CdnUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("ChannelCategoriesCsv") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("ChannelRating") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("ChannelTimeToLive"); + b.Property("ChannelTimeToLive") + .HasColumnType("int"); b.Property("CommentNotificationEmail") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("CopyrightNotice") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("DaysToComment"); + b.Property("DaysToComment") + .HasColumnType("int"); b.Property("DefaultContentType") .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("DefaultFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("int") .HasDefaultValue(20); b.Property("DefaultPageSlug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("Description"); + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("DisqusShortName") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("FacebookAppId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("Image") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("IncludePubDateInPostUrls"); + b.Property("IncludePubDateInPostUrls") + .HasColumnType("tinyint(1)"); b.Property("LanguageCode") + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") .HasMaxLength(10); b.Property("LocalMediaVirtualPath") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("ManagingEditorEmail") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("MaxFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("int") .HasDefaultValue(1000); - b.Property("ModerateComments"); + b.Property("ModerateComments") + .HasColumnType("tinyint(1)"); - b.Property("PostsPerPage"); + b.Property("PostsPerPage") + .HasColumnType("int"); b.Property("PubDateFormat") + .HasColumnType("varchar(75) CHARACTER SET utf8mb4") .HasMaxLength(75); b.Property("Publisher") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("PublisherEntityType") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.Property("PublisherLogoHeight") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") .HasMaxLength(20); b.Property("PublisherLogoUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("PublisherLogoWidth") + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") .HasMaxLength(20); b.Property("RecaptchaPrivateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("RecaptchaPublicKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("RemoteFeedUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("ShowAboutBox"); + b.Property("ShowAboutBox") + .HasColumnType("tinyint(1)"); - b.Property("ShowFeaturedPostsOnDefaultPage"); + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); - b.Property("ShowRecentPostsOnDefaultPage"); + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); - b.Property("ShowRelatedPosts"); + b.Property("ShowRelatedPosts") + .HasColumnType("tinyint(1)"); - b.Property("ShowTitle"); + b.Property("ShowTitle") + .HasColumnType("tinyint(1)"); b.Property("SiteName") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); b.Property("TeaserMode") .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") .HasDefaultValue((byte)0); b.Property("TeaserTruncationLength") .ValueGeneratedOnAdd() + .HasColumnType("int") .HasDefaultValue(20); b.Property("TeaserTruncationMode") .ValueGeneratedOnAdd() + .HasColumnType("tinyint unsigned") .HasDefaultValue((byte)0); b.Property("TimeZoneId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("Title") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("TwitterCreator") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("TwitterPublisher") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("UseDefaultPageAsRootNode"); + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("tinyint(1)"); b.Property("WebmasterEmail") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.HasKey("Id"); @@ -296,13 +384,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => { b.Property("Value") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.Property("PageEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.HasKey("Value", "PageEntityId"); @@ -319,37 +410,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Email") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); b.Property("PageEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime(6)"); b.Property("UserAgent") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("Website") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.HasKey("Id"); @@ -364,106 +466,144 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("CategoriesCsv") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); - b.Property("DisableEditor"); + b.Property("DisableEditor") + .HasColumnType("tinyint(1)"); b.Property("DraftAuthor") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ExternalUrl") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("datetime(6)"); b.Property("LastModifiedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("MenuFilters") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") .HasMaxLength(500); - b.Property("MenuOnly"); + b.Property("MenuOnly") + .HasColumnType("tinyint(1)"); b.Property("MetaDescription") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("int"); b.Property("ParentId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("ParentSlug") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("ProjectId") .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime(6)"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Serializer") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("ShowCategories"); + b.Property("ShowCategories") + .HasColumnType("tinyint(1)"); - b.Property("ShowComments"); + b.Property("ShowComments") + .HasColumnType("tinyint(1)"); - b.Property("ShowHeading"); + b.Property("ShowHeading") + .HasColumnType("tinyint(1)"); - b.Property("ShowLastModified"); + b.Property("ShowLastModified") + .HasColumnType("tinyint(1)"); - b.Property("ShowMenu"); + b.Property("ShowMenu") + .HasColumnType("tinyint(1)"); - b.Property("ShowPubDate"); + b.Property("ShowPubDate") + .HasColumnType("tinyint(1)"); b.Property("Slug") .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("TemplateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); @@ -479,24 +619,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("Environment") .IsRequired() + .HasColumnType("varchar(15) CHARACTER SET utf8mb4") .HasMaxLength(15); b.Property("PageEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); - b.Property("Sort"); + b.Property("Sort") + .HasColumnType("int"); b.Property("Type") .IsRequired() + .HasColumnType("varchar(10) CHARACTER SET utf8mb4") .HasMaxLength(10); b.Property("Url") .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.HasKey("Id"); @@ -509,13 +654,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => { b.Property("Value") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.Property("PostEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.HasKey("Value", "PostEntityId"); @@ -532,37 +680,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Email") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); b.Property("PostEntityId") + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime(6)"); b.Property("UserAgent") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("Website") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.HasKey("Id"); @@ -577,87 +736,120 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("varchar(36) CHARACTER SET utf8mb4") .HasMaxLength(36); b.Property("Author") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("AutoTeaser"); + b.Property("AutoTeaser") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("BlogId") .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); b.Property("CategoriesCsv") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); b.Property("DraftAuthor") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("ImageUrl") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); - b.Property("IsFeatured"); + b.Property("IsFeatured") + .HasColumnType("tinyint(1)"); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("datetime(6)"); b.Property("LastModifiedByUser") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") .HasMaxLength(100); b.Property("MetaDescription") + .HasColumnType("varchar(500) CHARACTER SET utf8mb4") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("datetime(6)"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Serializer") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") .HasMaxLength(50); + b.Property("ShowComments") + .HasColumnType("tinyint(1)"); + b.Property("Slug") .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); - b.Property("SuppressTeaser"); + b.Property("SuppressTeaser") + .HasColumnType("tinyint(1)"); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("TemplateKey") + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.Property("ThumbnailUrl") + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); b.Property("Title") .IsRequired() + .HasColumnType("varchar(255) CHARACTER SET utf8mb4") .HasMaxLength(255); b.HasKey("Id"); @@ -673,7 +865,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageComments") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -681,7 +873,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageResources") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -689,7 +881,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) .WithMany("PostComments") .HasForeignKey("PostEntityId"); }); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/SimpleContentDbContext.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/SimpleContentDbContext.cs index 1f89dad78..ef211fde2 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/SimpleContentDbContext.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/SimpleContentDbContext.cs @@ -297,6 +297,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(p => p.ThumbnailUrl) .HasMaxLength(250); + entity.Property(p => p.ShowComments) + .IsRequired() + .HasColumnType("bit"); + entity.Property(p => p.IsFeatured) .IsRequired(); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/cloudscribe.SimpleContent.Storage.EFCore.MySQL.csproj b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/cloudscribe.SimpleContent.Storage.EFCore.MySQL.csproj index 6bed1a0c5..cfcd37ee7 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/cloudscribe.SimpleContent.Storage.EFCore.MySQL.csproj +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/cloudscribe.SimpleContent.Storage.EFCore.MySQL.csproj @@ -2,7 +2,7 @@ MySQL Entity Framework Core implementation of cloudscribe SimpleContent commands and queries - 5.1.0 + 5.1.2 Joe Audette netstandard2.1 cloudscribe;commands;queries;ef diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20200723185336_AddPostShowCommentsSwitch.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20200723185336_AddPostShowCommentsSwitch.Designer.cs new file mode 100644 index 000000000..87401547c --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20200723185336_AddPostShowCommentsSwitch.Designer.cs @@ -0,0 +1,1127 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using cloudscribe.SimpleContent.Storage.EFCore.PostgreSql; + +namespace cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20200723185336_AddPostShowCommentsSwitch")] + partial class AddPostShowCommentsSwitch + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnName("id") + .HasColumnType("uuid") + .HasMaxLength(36); + + b.Property("ArchivedBy") + .HasColumnName("archived_by") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ArchivedUtc") + .HasColumnName("archived_utc") + .HasColumnType("timestamp without time zone"); + + b.Property("Author") + .HasColumnName("author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnName("categories_csv") + .HasColumnType("text"); + + b.Property("Content") + .HasColumnName("content") + .HasColumnType("text"); + + b.Property("ContentId") + .IsRequired() + .HasColumnName("content_id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ContentSource") + .IsRequired() + .HasColumnName("content_source") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnName("content_type") + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnName("correlation_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnName("created_by_user") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnName("created_utc") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftAuthor") + .HasColumnName("draft_author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnName("draft_content") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnName("draft_pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftSerializedModel") + .HasColumnName("draft_serialized_model") + .HasColumnType("text"); + + b.Property("IsDraftHx") + .HasColumnName("is_draft_hx") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnName("is_published") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnName("last_modified") + .HasColumnType("timestamp without time zone"); + + b.Property("LastModifiedByUser") + .HasColumnName("last_modified_by_user") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnName("meta_description") + .HasColumnType("text"); + + b.Property("MetaHtml") + .HasColumnName("meta_html") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnName("meta_json") + .HasColumnType("text"); + + b.Property("PageOrder") + .HasColumnName("page_order") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasColumnName("parent_id") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ParentSlug") + .HasColumnName("parent_slug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ProjectId") + .HasColumnName("project_id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("SerializedModel") + .HasColumnName("serialized_model") + .HasColumnType("text"); + + b.Property("Serializer") + .HasColumnName("serializer") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("Slug") + .HasColumnName("slug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("TeaserOverride") + .HasColumnName("teaser_override") + .HasColumnType("text"); + + b.Property("TemplateKey") + .HasColumnName("template_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnName("title") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnName("view_roles") + .HasColumnType("text"); + + b.Property("WasDeleted") + .HasColumnName("was_deleted") + .HasColumnType("boolean"); + + b.HasKey("Id") + .HasName("pk_cs_content_history"); + + b.HasIndex("ContentId") + .HasName("ix_cs_content_history_content_id"); + + b.HasIndex("ContentSource") + .HasName("ix_cs_content_history_content_source"); + + b.HasIndex("CorrelationKey") + .HasName("ix_cs_content_history_correlation_key"); + + b.HasIndex("CreatedByUser") + .HasName("ix_cs_content_history_created_by_user"); + + b.HasIndex("LastModifiedByUser") + .HasName("ix_cs_content_history_last_modified_by_user"); + + b.HasIndex("Title") + .HasName("ix_cs_content_history_title"); + + b.ToTable("cs_content_history"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasColumnName("id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("AboutContent") + .HasColumnName("about_content") + .HasColumnType("text"); + + b.Property("AboutHeading") + .HasColumnName("about_heading") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("AddBlogToPagesTree") + .HasColumnName("add_blog_to_pages_tree") + .HasColumnType("boolean"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnName("blog_menu_links_to_newest_post") + .HasColumnType("boolean"); + + b.Property("BlogPageNavComponentVisibility") + .HasColumnName("blog_page_nav_component_visibility") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("BlogPagePosition") + .HasColumnName("blog_page_position") + .HasColumnType("integer"); + + b.Property("BlogPageText") + .HasColumnName("blog_page_text") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CdnUrl") + .HasColumnName("cdn_url") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ChannelCategoriesCsv") + .HasColumnName("channel_categories_csv") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ChannelRating") + .HasColumnName("channel_rating") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("ChannelTimeToLive") + .HasColumnName("channel_time_to_live") + .HasColumnType("integer"); + + b.Property("CommentNotificationEmail") + .HasColumnName("comment_notification_email") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CopyrightNotice") + .HasColumnName("copyright_notice") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DaysToComment") + .HasColumnName("days_to_comment") + .HasColumnType("integer"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasColumnName("default_content_type") + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnName("default_feed_items") + .HasColumnType("integer") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasColumnName("default_page_slug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Description") + .HasColumnName("description") + .HasColumnType("text"); + + b.Property("DisqusShortName") + .HasColumnName("disqus_short_name") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("FacebookAppId") + .HasColumnName("facebook_app_id") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Image") + .HasColumnName("image") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("IncludePubDateInPostUrls") + .HasColumnName("include_pub_date_in_post_urls") + .HasColumnType("boolean"); + + b.Property("LanguageCode") + .HasColumnName("language_code") + .HasColumnType("character varying(10)") + .HasMaxLength(10); + + b.Property("LocalMediaVirtualPath") + .HasColumnName("local_media_virtual_path") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ManagingEditorEmail") + .HasColumnName("managing_editor_email") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnName("max_feed_items") + .HasColumnType("integer") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnName("moderate_comments") + .HasColumnType("boolean"); + + b.Property("PostsPerPage") + .HasColumnName("posts_per_page") + .HasColumnType("integer"); + + b.Property("PubDateFormat") + .HasColumnName("pub_date_format") + .HasColumnType("character varying(75)") + .HasMaxLength(75); + + b.Property("Publisher") + .HasColumnName("publisher") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("PublisherEntityType") + .HasColumnName("publisher_entity_type") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PublisherLogoHeight") + .HasColumnName("publisher_logo_height") + .HasColumnType("character varying(20)") + .HasMaxLength(20); + + b.Property("PublisherLogoUrl") + .HasColumnName("publisher_logo_url") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("PublisherLogoWidth") + .HasColumnName("publisher_logo_width") + .HasColumnType("character varying(20)") + .HasMaxLength(20); + + b.Property("RecaptchaPrivateKey") + .HasColumnName("recaptcha_private_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("RecaptchaPublicKey") + .HasColumnName("recaptcha_public_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnName("remote_feed_processor_use_agent_fragment") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("RemoteFeedUrl") + .HasColumnName("remote_feed_url") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ShowAboutBox") + .HasColumnName("show_about_box") + .HasColumnType("boolean"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnName("show_featured_posts_on_default_page") + .HasColumnType("boolean"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnName("show_recent_posts_on_default_page") + .HasColumnType("boolean"); + + b.Property("ShowRelatedPosts") + .HasColumnName("show_related_posts") + .HasColumnType("boolean"); + + b.Property("ShowTitle") + .HasColumnName("show_title") + .HasColumnType("boolean"); + + b.Property("SiteName") + .HasColumnName("site_name") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("TeaserMode") + .ValueGeneratedOnAdd() + .HasColumnName("teaser_mode") + .HasColumnType("smallint") + .HasDefaultValue((byte)0); + + b.Property("TeaserTruncationLength") + .ValueGeneratedOnAdd() + .HasColumnName("teaser_truncation_length") + .HasColumnType("integer") + .HasDefaultValue(20); + + b.Property("TeaserTruncationMode") + .ValueGeneratedOnAdd() + .HasColumnName("teaser_truncation_mode") + .HasColumnType("smallint") + .HasDefaultValue((byte)0); + + b.Property("TimeZoneId") + .HasColumnName("time_zone_id") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Title") + .HasColumnName("title") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("TwitterCreator") + .HasColumnName("twitter_creator") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("TwitterPublisher") + .HasColumnName("twitter_publisher") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnName("use_default_page_as_root_node") + .HasColumnType("boolean"); + + b.Property("WebmasterEmail") + .HasColumnName("webmaster_email") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.HasKey("Id") + .HasName("pk_cs_content_project"); + + b.ToTable("cs_content_project"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasColumnName("value") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PageEntityId") + .HasColumnName("page_entity_id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnName("project_id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.HasKey("Value", "PageEntityId") + .HasName("pk_cs_page_category"); + + b.HasIndex("PageEntityId") + .HasName("ix_cs_page_category_page_entity_id"); + + b.HasIndex("ProjectId") + .HasName("ix_cs_page_category_project_id"); + + b.HasIndex("Value") + .HasName("ix_cs_page_category_value"); + + b.ToTable("cs_page_category"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasColumnName("id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnName("author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnName("content") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnName("email") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnName("ip") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnName("is_admin") + .HasColumnType("boolean"); + + b.Property("IsApproved") + .HasColumnName("is_approved") + .HasColumnType("boolean"); + + b.Property("PageEntityId") + .HasColumnName("page_entity_id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnName("project_id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("UserAgent") + .HasColumnName("user_agent") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnName("website") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id") + .HasName("pk_cs_page_comment"); + + b.HasIndex("PageEntityId") + .HasName("ix_cs_page_comment_page_entity_id"); + + b.HasIndex("ProjectId") + .HasName("ix_cs_page_comment_project_id"); + + b.ToTable("cs_page_comment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasColumnName("id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnName("author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnName("categories_csv") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnName("content") + .HasColumnType("text"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnName("content_type") + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnName("correlation_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnName("created_by_user") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnName("created_utc") + .HasColumnType("timestamp without time zone"); + + b.Property("DisableEditor") + .HasColumnName("disable_editor") + .HasColumnType("boolean"); + + b.Property("DraftAuthor") + .HasColumnName("draft_author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnName("draft_content") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnName("draft_pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftSerializedModel") + .HasColumnName("draft_serialized_model") + .HasColumnType("text"); + + b.Property("ExternalUrl") + .HasColumnName("external_url") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("IsPublished") + .HasColumnName("is_published") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnName("last_modified") + .HasColumnType("timestamp without time zone"); + + b.Property("LastModifiedByUser") + .HasColumnName("last_modified_by_user") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MenuFilters") + .HasColumnName("menu_filters") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("MenuOnly") + .HasColumnName("menu_only") + .HasColumnType("boolean"); + + b.Property("MetaDescription") + .HasColumnName("meta_description") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnName("meta_html") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnName("meta_json") + .HasColumnType("text"); + + b.Property("PageOrder") + .HasColumnName("page_order") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasColumnName("parent_id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ParentSlug") + .HasColumnName("parent_slug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ProjectId") + .IsRequired() + .HasColumnName("project_id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("SerializedModel") + .HasColumnName("serialized_model") + .HasColumnType("text"); + + b.Property("Serializer") + .HasColumnName("serializer") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("ShowCategories") + .HasColumnName("show_categories") + .HasColumnType("boolean"); + + b.Property("ShowComments") + .HasColumnName("show_comments") + .HasColumnType("boolean"); + + b.Property("ShowHeading") + .HasColumnName("show_heading") + .HasColumnType("boolean"); + + b.Property("ShowLastModified") + .HasColumnName("show_last_modified") + .HasColumnType("boolean"); + + b.Property("ShowMenu") + .HasColumnName("show_menu") + .HasColumnType("boolean"); + + b.Property("ShowPubDate") + .HasColumnName("show_pub_date") + .HasColumnType("boolean"); + + b.Property("Slug") + .IsRequired() + .HasColumnName("slug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("TemplateKey") + .HasColumnName("template_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnName("title") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnName("view_roles") + .HasColumnType("text"); + + b.HasKey("Id") + .HasName("pk_cs_page"); + + b.HasIndex("CorrelationKey") + .HasName("ix_cs_page_correlation_key"); + + b.HasIndex("ParentId") + .HasName("ix_cs_page_parent_id"); + + b.HasIndex("ProjectId") + .HasName("ix_cs_page_project_id"); + + b.ToTable("cs_page"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasColumnName("id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Environment") + .IsRequired() + .HasColumnName("environment") + .HasColumnType("character varying(15)") + .HasMaxLength(15); + + b.Property("PageEntityId") + .HasColumnName("page_entity_id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Sort") + .HasColumnName("sort") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnName("type") + .HasColumnType("character varying(10)") + .HasMaxLength(10); + + b.Property("Url") + .IsRequired() + .HasColumnName("url") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id") + .HasName("pk_cs_page_resource"); + + b.HasIndex("PageEntityId") + .HasName("ix_cs_page_resource_page_entity_id"); + + b.ToTable("cs_page_resource"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasColumnName("value") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PostEntityId") + .HasColumnName("post_entity_id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnName("project_id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.HasKey("Value", "PostEntityId") + .HasName("pk_cs_post_category"); + + b.HasIndex("PostEntityId") + .HasName("ix_cs_post_category_post_entity_id"); + + b.HasIndex("ProjectId") + .HasName("ix_cs_post_category_project_id"); + + b.HasIndex("Value") + .HasName("ix_cs_post_category_value"); + + b.ToTable("cs_post_category"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasColumnName("id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnName("author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnName("content") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnName("email") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnName("ip") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnName("is_admin") + .HasColumnType("boolean"); + + b.Property("IsApproved") + .HasColumnName("is_approved") + .HasColumnType("boolean"); + + b.Property("PostEntityId") + .HasColumnName("post_entity_id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnName("project_id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("UserAgent") + .HasColumnName("user_agent") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnName("website") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id") + .HasName("pk_cs_post_comment"); + + b.HasIndex("PostEntityId") + .HasName("ix_cs_post_comment_post_entity_id"); + + b.HasIndex("ProjectId") + .HasName("ix_cs_post_comment_project_id"); + + b.ToTable("cs_post_comment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasColumnName("id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnName("author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("AutoTeaser") + .HasColumnName("auto_teaser") + .HasColumnType("text"); + + b.Property("BlogId") + .IsRequired() + .HasColumnName("blog_id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("CategoriesCsv") + .HasColumnName("categories_csv") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnName("content") + .HasColumnType("text"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnName("content_type") + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnName("correlation_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnName("created_by_user") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnName("created_utc") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftAuthor") + .HasColumnName("draft_author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnName("draft_content") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnName("draft_pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftSerializedModel") + .HasColumnName("draft_serialized_model") + .HasColumnType("text"); + + b.Property("ImageUrl") + .HasColumnName("image_url") + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("IsFeatured") + .HasColumnName("is_featured") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnName("is_published") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnName("last_modified") + .HasColumnType("timestamp without time zone"); + + b.Property("LastModifiedByUser") + .HasColumnName("last_modified_by_user") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnName("meta_description") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnName("meta_html") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnName("meta_json") + .HasColumnType("text"); + + b.Property("PubDate") + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); + + b.Property("SerializedModel") + .HasColumnName("serialized_model") + .HasColumnType("text"); + + b.Property("Serializer") + .HasColumnName("serializer") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("ShowComments") + .HasColumnName("show_comments") + .HasColumnType("boolean"); + + b.Property("Slug") + .IsRequired() + .HasColumnName("slug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("SuppressTeaser") + .HasColumnName("suppress_teaser") + .HasColumnType("boolean"); + + b.Property("TeaserOverride") + .HasColumnName("teaser_override") + .HasColumnType("text"); + + b.Property("TemplateKey") + .HasColumnName("template_key") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ThumbnailUrl") + .HasColumnName("thumbnail_url") + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Title") + .IsRequired() + .HasColumnName("title") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id") + .HasName("pk_cs_post"); + + b.HasIndex("BlogId") + .HasName("ix_cs_post_blog_id"); + + b.HasIndex("CorrelationKey") + .HasName("ix_cs_post_correlation_key"); + + b.HasIndex("Slug") + .HasName("ix_cs_post_slug"); + + b.ToTable("cs_post"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageComments") + .HasForeignKey("PageEntityId") + .HasConstraintName("fk_cs_page_comment_cs__page_page_entity_id") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageResources") + .HasForeignKey("PageEntityId") + .HasConstraintName("fk_cs_page_resource_cs_page_page_entity_id") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) + .WithMany("PostComments") + .HasForeignKey("PostEntityId") + .HasConstraintName("fk_cs_post_comment_cs__post_post_entity_id"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20200723185336_AddPostShowCommentsSwitch.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20200723185336_AddPostShowCommentsSwitch.cs new file mode 100644 index 000000000..67493602e --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20200723185336_AddPostShowCommentsSwitch.cs @@ -0,0 +1,71 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.Migrations +{ + public partial class AddPostShowCommentsSwitch : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "fk_cs_page_comment_cs_page_page_entity_id", + table: "cs_page_comment"); + + migrationBuilder.DropForeignKey( + name: "fk_cs_post_comment_cs_post_post_entity_id", + table: "cs_post_comment"); + + migrationBuilder.AddColumn( + name: "show_comments", + table: "cs_post", + nullable: false, + defaultValue: false); + + migrationBuilder.AddForeignKey( + name: "fk_cs_page_comment_cs__page_page_entity_id", + table: "cs_page_comment", + column: "page_entity_id", + principalTable: "cs_page", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_cs_post_comment_cs__post_post_entity_id", + table: "cs_post_comment", + column: "post_entity_id", + principalTable: "cs_post", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "fk_cs_page_comment_cs__page_page_entity_id", + table: "cs_page_comment"); + + migrationBuilder.DropForeignKey( + name: "fk_cs_post_comment_cs__post_post_entity_id", + table: "cs_post_comment"); + + migrationBuilder.DropColumn( + name: "show_comments", + table: "cs_post"); + + migrationBuilder.AddForeignKey( + name: "fk_cs_page_comment_cs_page_page_entity_id", + table: "cs_page_comment", + column: "page_entity_id", + principalTable: "cs_page", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_cs_post_comment_cs_post_post_entity_id", + table: "cs_post_comment", + column: "post_entity_id", + principalTable: "cs_post", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs index b93bcbb23..91e493409 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using cloudscribe.SimpleContent.Models; using cloudscribe.SimpleContent.Storage.EFCore.PostgreSql; namespace cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.Migrations @@ -16,8 +15,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => @@ -25,133 +24,169 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Id") .ValueGeneratedOnAdd() .HasColumnName("id") + .HasColumnType("uuid") .HasMaxLength(36); b.Property("ArchivedBy") .HasColumnName("archived_by") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ArchivedUtc") - .HasColumnName("archived_utc"); + .HasColumnName("archived_utc") + .HasColumnType("timestamp without time zone"); b.Property("Author") .HasColumnName("author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CategoriesCsv") - .HasColumnName("categories_csv"); + .HasColumnName("categories_csv") + .HasColumnType("text"); b.Property("Content") - .HasColumnName("content"); + .HasColumnName("content") + .HasColumnType("text"); b.Property("ContentId") .IsRequired() .HasColumnName("content_id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ContentSource") .IsRequired() .HasColumnName("content_source") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("ContentType") .ValueGeneratedOnAdd() .HasColumnName("content_type") + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") .HasColumnName("correlation_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CreatedByUser") .HasColumnName("created_by_user") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("CreatedUtc") - .HasColumnName("created_utc"); + .HasColumnName("created_utc") + .HasColumnType("timestamp without time zone"); b.Property("DraftAuthor") .HasColumnName("draft_author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("DraftContent") - .HasColumnName("draft_content"); + .HasColumnName("draft_content") + .HasColumnType("text"); b.Property("DraftPubDate") - .HasColumnName("draft_pub_date"); + .HasColumnName("draft_pub_date") + .HasColumnType("timestamp without time zone"); b.Property("DraftSerializedModel") - .HasColumnName("draft_serialized_model"); + .HasColumnName("draft_serialized_model") + .HasColumnType("text"); b.Property("IsDraftHx") - .HasColumnName("is_draft_hx"); + .HasColumnName("is_draft_hx") + .HasColumnType("boolean"); b.Property("IsPublished") - .HasColumnName("is_published"); + .HasColumnName("is_published") + .HasColumnType("boolean"); b.Property("LastModified") - .HasColumnName("last_modified"); + .HasColumnName("last_modified") + .HasColumnType("timestamp without time zone"); b.Property("LastModifiedByUser") .HasColumnName("last_modified_by_user") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("MetaDescription") - .HasColumnName("meta_description"); + .HasColumnName("meta_description") + .HasColumnType("text"); b.Property("MetaHtml") - .HasColumnName("meta_html"); + .HasColumnName("meta_html") + .HasColumnType("text"); b.Property("MetaJson") - .HasColumnName("meta_json"); + .HasColumnName("meta_json") + .HasColumnType("text"); b.Property("PageOrder") - .HasColumnName("page_order"); + .HasColumnName("page_order") + .HasColumnType("integer"); b.Property("ParentId") .HasColumnName("parent_id") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ParentSlug") .HasColumnName("parent_slug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ProjectId") .HasColumnName("project_id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PubDate") - .HasColumnName("pub_date"); + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); b.Property("SerializedModel") - .HasColumnName("serialized_model"); + .HasColumnName("serialized_model") + .HasColumnType("text"); b.Property("Serializer") .HasColumnName("serializer") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("Slug") .HasColumnName("slug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("TeaserOverride") - .HasColumnName("teaser_override"); + .HasColumnName("teaser_override") + .HasColumnType("text"); b.Property("TemplateKey") .HasColumnName("template_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Title") .IsRequired() .HasColumnName("title") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ViewRoles") - .HasColumnName("view_roles"); + .HasColumnName("view_roles") + .HasColumnType("text"); b.Property("WasDeleted") - .HasColumnName("was_deleted"); + .HasColumnName("was_deleted") + .HasColumnType("boolean"); b.HasKey("Id") .HasName("pk_cs_content_history"); @@ -180,211 +215,264 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnName("id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("AboutContent") - .HasColumnName("about_content"); + .HasColumnName("about_content") + .HasColumnType("text"); b.Property("AboutHeading") .HasColumnName("about_heading") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("AddBlogToPagesTree") - .HasColumnName("add_blog_to_pages_tree"); + .HasColumnName("add_blog_to_pages_tree") + .HasColumnType("boolean"); b.Property("BlogMenuLinksToNewestPost") - .HasColumnName("blog_menu_links_to_newest_post"); + .HasColumnName("blog_menu_links_to_newest_post") + .HasColumnType("boolean"); b.Property("BlogPageNavComponentVisibility") .HasColumnName("blog_page_nav_component_visibility") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("BlogPagePosition") - .HasColumnName("blog_page_position"); + .HasColumnName("blog_page_position") + .HasColumnType("integer"); b.Property("BlogPageText") .HasColumnName("blog_page_text") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CdnUrl") .HasColumnName("cdn_url") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ChannelCategoriesCsv") .HasColumnName("channel_categories_csv") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ChannelRating") .HasColumnName("channel_rating") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("ChannelTimeToLive") - .HasColumnName("channel_time_to_live"); + .HasColumnName("channel_time_to_live") + .HasColumnType("integer"); b.Property("CommentNotificationEmail") .HasColumnName("comment_notification_email") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("CopyrightNotice") .HasColumnName("copyright_notice") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("DaysToComment") - .HasColumnName("days_to_comment"); + .HasColumnName("days_to_comment") + .HasColumnType("integer"); b.Property("DefaultContentType") .ValueGeneratedOnAdd() .HasColumnName("default_content_type") + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("DefaultFeedItems") .ValueGeneratedOnAdd() .HasColumnName("default_feed_items") + .HasColumnType("integer") .HasDefaultValue(20); b.Property("DefaultPageSlug") .HasColumnName("default_page_slug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Description") - .HasColumnName("description"); + .HasColumnName("description") + .HasColumnType("text"); b.Property("DisqusShortName") .HasColumnName("disqus_short_name") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("FacebookAppId") .HasColumnName("facebook_app_id") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Image") .HasColumnName("image") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("IncludePubDateInPostUrls") - .HasColumnName("include_pub_date_in_post_urls"); + .HasColumnName("include_pub_date_in_post_urls") + .HasColumnType("boolean"); b.Property("LanguageCode") .HasColumnName("language_code") + .HasColumnType("character varying(10)") .HasMaxLength(10); b.Property("LocalMediaVirtualPath") .HasColumnName("local_media_virtual_path") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ManagingEditorEmail") .HasColumnName("managing_editor_email") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("MaxFeedItems") .ValueGeneratedOnAdd() .HasColumnName("max_feed_items") + .HasColumnType("integer") .HasDefaultValue(1000); b.Property("ModerateComments") - .HasColumnName("moderate_comments"); + .HasColumnName("moderate_comments") + .HasColumnType("boolean"); b.Property("PostsPerPage") - .HasColumnName("posts_per_page"); + .HasColumnName("posts_per_page") + .HasColumnType("integer"); b.Property("PubDateFormat") .HasColumnName("pub_date_format") + .HasColumnType("character varying(75)") .HasMaxLength(75); b.Property("Publisher") .HasColumnName("publisher") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("PublisherEntityType") .HasColumnName("publisher_entity_type") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PublisherLogoHeight") .HasColumnName("publisher_logo_height") + .HasColumnType("character varying(20)") .HasMaxLength(20); b.Property("PublisherLogoUrl") .HasColumnName("publisher_logo_url") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("PublisherLogoWidth") .HasColumnName("publisher_logo_width") + .HasColumnType("character varying(20)") .HasMaxLength(20); b.Property("RecaptchaPrivateKey") .HasColumnName("recaptcha_private_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("RecaptchaPublicKey") .HasColumnName("recaptcha_public_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("RemoteFeedProcessorUseAgentFragment") .HasColumnName("remote_feed_processor_use_agent_fragment") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("RemoteFeedUrl") .HasColumnName("remote_feed_url") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ShowAboutBox") - .HasColumnName("show_about_box"); + .HasColumnName("show_about_box") + .HasColumnType("boolean"); b.Property("ShowFeaturedPostsOnDefaultPage") - .HasColumnName("show_featured_posts_on_default_page"); + .HasColumnName("show_featured_posts_on_default_page") + .HasColumnType("boolean"); b.Property("ShowRecentPostsOnDefaultPage") - .HasColumnName("show_recent_posts_on_default_page"); + .HasColumnName("show_recent_posts_on_default_page") + .HasColumnType("boolean"); b.Property("ShowRelatedPosts") - .HasColumnName("show_related_posts"); + .HasColumnName("show_related_posts") + .HasColumnType("boolean"); b.Property("ShowTitle") - .HasColumnName("show_title"); + .HasColumnName("show_title") + .HasColumnType("boolean"); b.Property("SiteName") .HasColumnName("site_name") + .HasColumnType("character varying(200)") .HasMaxLength(200); b.Property("TeaserMode") .ValueGeneratedOnAdd() .HasColumnName("teaser_mode") + .HasColumnType("smallint") .HasDefaultValue((byte)0); b.Property("TeaserTruncationLength") .ValueGeneratedOnAdd() .HasColumnName("teaser_truncation_length") + .HasColumnType("integer") .HasDefaultValue(20); b.Property("TeaserTruncationMode") .ValueGeneratedOnAdd() .HasColumnName("teaser_truncation_mode") + .HasColumnType("smallint") .HasDefaultValue((byte)0); b.Property("TimeZoneId") .HasColumnName("time_zone_id") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Title") .HasColumnName("title") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("TwitterCreator") .HasColumnName("twitter_creator") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("TwitterPublisher") .HasColumnName("twitter_publisher") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("UseDefaultPageAsRootNode") - .HasColumnName("use_default_page_as_root_node"); + .HasColumnName("use_default_page_as_root_node") + .HasColumnType("boolean"); b.Property("WebmasterEmail") .HasColumnName("webmaster_email") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.HasKey("Id") @@ -397,15 +485,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Value") .HasColumnName("value") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PageEntityId") .HasColumnName("page_entity_id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() .HasColumnName("project_id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.HasKey("Value", "PageEntityId") @@ -426,49 +517,60 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnName("id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") .HasColumnName("author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Content") - .HasColumnName("content"); + .HasColumnName("content") + .HasColumnType("text"); b.Property("Email") .HasColumnName("email") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Ip") .HasColumnName("ip") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("IsAdmin") - .HasColumnName("is_admin"); + .HasColumnName("is_admin") + .HasColumnType("boolean"); b.Property("IsApproved") - .HasColumnName("is_approved"); + .HasColumnName("is_approved") + .HasColumnType("boolean"); b.Property("PageEntityId") .HasColumnName("page_entity_id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() .HasColumnName("project_id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PubDate") - .HasColumnName("pub_date"); + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); b.Property("UserAgent") .HasColumnName("user_agent") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Website") .HasColumnName("website") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id") @@ -486,145 +588,183 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnName("id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") .HasColumnName("author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CategoriesCsv") .HasColumnName("categories_csv") + .HasColumnType("character varying(500)") .HasMaxLength(500); b.Property("Content") - .HasColumnName("content"); + .HasColumnName("content") + .HasColumnType("text"); b.Property("ContentType") .ValueGeneratedOnAdd() .HasColumnName("content_type") + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") .HasColumnName("correlation_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CreatedByUser") .HasColumnName("created_by_user") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("CreatedUtc") - .HasColumnName("created_utc"); + .HasColumnName("created_utc") + .HasColumnType("timestamp without time zone"); b.Property("DisableEditor") - .HasColumnName("disable_editor"); + .HasColumnName("disable_editor") + .HasColumnType("boolean"); b.Property("DraftAuthor") .HasColumnName("draft_author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("DraftContent") - .HasColumnName("draft_content"); + .HasColumnName("draft_content") + .HasColumnType("text"); b.Property("DraftPubDate") - .HasColumnName("draft_pub_date"); + .HasColumnName("draft_pub_date") + .HasColumnType("timestamp without time zone"); b.Property("DraftSerializedModel") - .HasColumnName("draft_serialized_model"); + .HasColumnName("draft_serialized_model") + .HasColumnType("text"); b.Property("ExternalUrl") .HasColumnName("external_url") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("IsPublished") - .HasColumnName("is_published"); + .HasColumnName("is_published") + .HasColumnType("boolean"); b.Property("LastModified") - .HasColumnName("last_modified"); + .HasColumnName("last_modified") + .HasColumnType("timestamp without time zone"); b.Property("LastModifiedByUser") .HasColumnName("last_modified_by_user") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("MenuFilters") .HasColumnName("menu_filters") + .HasColumnType("character varying(500)") .HasMaxLength(500); b.Property("MenuOnly") - .HasColumnName("menu_only"); + .HasColumnName("menu_only") + .HasColumnType("boolean"); b.Property("MetaDescription") .HasColumnName("meta_description") + .HasColumnType("character varying(500)") .HasMaxLength(500); b.Property("MetaHtml") - .HasColumnName("meta_html"); + .HasColumnName("meta_html") + .HasColumnType("text"); b.Property("MetaJson") - .HasColumnName("meta_json"); + .HasColumnName("meta_json") + .HasColumnType("text"); b.Property("PageOrder") - .HasColumnName("page_order"); + .HasColumnName("page_order") + .HasColumnType("integer"); b.Property("ParentId") .HasColumnName("parent_id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ParentSlug") .HasColumnName("parent_slug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ProjectId") .IsRequired() .HasColumnName("project_id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PubDate") - .HasColumnName("pub_date"); + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); b.Property("SerializedModel") - .HasColumnName("serialized_model"); + .HasColumnName("serialized_model") + .HasColumnType("text"); b.Property("Serializer") .HasColumnName("serializer") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("ShowCategories") - .HasColumnName("show_categories"); + .HasColumnName("show_categories") + .HasColumnType("boolean"); b.Property("ShowComments") - .HasColumnName("show_comments"); + .HasColumnName("show_comments") + .HasColumnType("boolean"); b.Property("ShowHeading") - .HasColumnName("show_heading"); + .HasColumnName("show_heading") + .HasColumnType("boolean"); b.Property("ShowLastModified") - .HasColumnName("show_last_modified"); + .HasColumnName("show_last_modified") + .HasColumnType("boolean"); b.Property("ShowMenu") - .HasColumnName("show_menu"); + .HasColumnName("show_menu") + .HasColumnType("boolean"); b.Property("ShowPubDate") - .HasColumnName("show_pub_date"); + .HasColumnName("show_pub_date") + .HasColumnType("boolean"); b.Property("Slug") .IsRequired() .HasColumnName("slug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("TemplateKey") .HasColumnName("template_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Title") .IsRequired() .HasColumnName("title") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ViewRoles") - .HasColumnName("view_roles"); + .HasColumnName("view_roles") + .HasColumnType("text"); b.HasKey("Id") .HasName("pk_cs_page"); @@ -644,30 +784,35 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnName("id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Environment") .IsRequired() .HasColumnName("environment") + .HasColumnType("character varying(15)") .HasMaxLength(15); b.Property("PageEntityId") .HasColumnName("page_entity_id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Sort") - .HasColumnName("sort"); + .HasColumnName("sort") + .HasColumnType("integer"); b.Property("Type") .IsRequired() .HasColumnName("type") + .HasColumnType("character varying(10)") .HasMaxLength(10); b.Property("Url") .IsRequired() .HasColumnName("url") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id") @@ -683,15 +828,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Value") .HasColumnName("value") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PostEntityId") .HasColumnName("post_entity_id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() .HasColumnName("project_id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.HasKey("Value", "PostEntityId") @@ -712,49 +860,60 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnName("id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") .HasColumnName("author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Content") - .HasColumnName("content"); + .HasColumnName("content") + .HasColumnType("text"); b.Property("Email") .HasColumnName("email") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Ip") .HasColumnName("ip") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("IsAdmin") - .HasColumnName("is_admin"); + .HasColumnName("is_admin") + .HasColumnType("boolean"); b.Property("IsApproved") - .HasColumnName("is_approved"); + .HasColumnName("is_approved") + .HasColumnType("boolean"); b.Property("PostEntityId") .HasColumnName("post_entity_id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() .HasColumnName("project_id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PubDate") - .HasColumnName("pub_date"); + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); b.Property("UserAgent") .HasColumnName("user_agent") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Website") .HasColumnName("website") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id") @@ -772,118 +931,152 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnName("id") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") .HasColumnName("author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("AutoTeaser") - .HasColumnName("auto_teaser"); + .HasColumnName("auto_teaser") + .HasColumnType("text"); b.Property("BlogId") .IsRequired() .HasColumnName("blog_id") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("CategoriesCsv") .HasColumnName("categories_csv") + .HasColumnType("character varying(500)") .HasMaxLength(500); b.Property("Content") - .HasColumnName("content"); + .HasColumnName("content") + .HasColumnType("text"); b.Property("ContentType") .ValueGeneratedOnAdd() .HasColumnName("content_type") + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") .HasColumnName("correlation_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CreatedByUser") .HasColumnName("created_by_user") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("CreatedUtc") - .HasColumnName("created_utc"); + .HasColumnName("created_utc") + .HasColumnType("timestamp without time zone"); b.Property("DraftAuthor") .HasColumnName("draft_author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("DraftContent") - .HasColumnName("draft_content"); + .HasColumnName("draft_content") + .HasColumnType("text"); b.Property("DraftPubDate") - .HasColumnName("draft_pub_date"); + .HasColumnName("draft_pub_date") + .HasColumnType("timestamp without time zone"); b.Property("DraftSerializedModel") - .HasColumnName("draft_serialized_model"); + .HasColumnName("draft_serialized_model") + .HasColumnType("text"); b.Property("ImageUrl") .HasColumnName("image_url") + .HasColumnType("character varying(250)") .HasMaxLength(250); b.Property("IsFeatured") - .HasColumnName("is_featured"); + .HasColumnName("is_featured") + .HasColumnType("boolean"); b.Property("IsPublished") - .HasColumnName("is_published"); + .HasColumnName("is_published") + .HasColumnType("boolean"); b.Property("LastModified") - .HasColumnName("last_modified"); + .HasColumnName("last_modified") + .HasColumnType("timestamp without time zone"); b.Property("LastModifiedByUser") .HasColumnName("last_modified_by_user") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("MetaDescription") .HasColumnName("meta_description") + .HasColumnType("character varying(500)") .HasMaxLength(500); b.Property("MetaHtml") - .HasColumnName("meta_html"); + .HasColumnName("meta_html") + .HasColumnType("text"); b.Property("MetaJson") - .HasColumnName("meta_json"); + .HasColumnName("meta_json") + .HasColumnType("text"); b.Property("PubDate") - .HasColumnName("pub_date"); + .HasColumnName("pub_date") + .HasColumnType("timestamp without time zone"); b.Property("SerializedModel") - .HasColumnName("serialized_model"); + .HasColumnName("serialized_model") + .HasColumnType("text"); b.Property("Serializer") .HasColumnName("serializer") + .HasColumnType("character varying(50)") .HasMaxLength(50); + b.Property("ShowComments") + .HasColumnName("show_comments") + .HasColumnType("boolean"); + b.Property("Slug") .IsRequired() .HasColumnName("slug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("SuppressTeaser") - .HasColumnName("suppress_teaser"); + .HasColumnName("suppress_teaser") + .HasColumnType("boolean"); b.Property("TeaserOverride") - .HasColumnName("teaser_override"); + .HasColumnName("teaser_override") + .HasColumnType("text"); b.Property("TemplateKey") .HasColumnName("template_key") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ThumbnailUrl") .HasColumnName("thumbnail_url") + .HasColumnType("character varying(250)") .HasMaxLength(250); b.Property("Title") .IsRequired() .HasColumnName("title") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id") @@ -903,16 +1096,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageComments") .HasForeignKey("PageEntityId") - .HasConstraintName("fk_cs_page_comment_cs_page_page_entity_id") + .HasConstraintName("fk_cs_page_comment_cs__page_page_entity_id") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageResources") .HasForeignKey("PageEntityId") .HasConstraintName("fk_cs_page_resource_cs_page_page_entity_id") @@ -921,10 +1114,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) .WithMany("PostComments") .HasForeignKey("PostEntityId") - .HasConstraintName("fk_cs_post_comment_cs_post_post_entity_id"); + .HasConstraintName("fk_cs_post_comment_cs__post_post_entity_id"); }); #pragma warning restore 612, 618 } diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/SimpleContentDbContext.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/SimpleContentDbContext.cs index 3056b8a96..9ebbe6566 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/SimpleContentDbContext.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/SimpleContentDbContext.cs @@ -188,6 +188,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasMany(p => p.PostComments) .WithOne(); + entity.Property(p => p.ShowComments).IsRequired(); + entity.Property(p => p.ImageUrl).HasMaxLength(250); entity.Property(p => p.ThumbnailUrl).HasMaxLength(250); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.csproj b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.csproj index ac54f909e..99bd7d9df 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.csproj +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.csproj @@ -2,7 +2,7 @@ PostgreSql Entity Framework Core implementation of cloudscribe SimpleContent commands and queries - 5.1.0 + 5.1.2 Joe Audette netstandard2.1 cloudscribe;commands;queries;ef diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20200723185404_AddPostShowCommentsSwitch.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20200723185404_AddPostShowCommentsSwitch.Designer.cs new file mode 100644 index 000000000..ac10edbe3 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20200723185404_AddPostShowCommentsSwitch.Designer.cs @@ -0,0 +1,892 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using cloudscribe.SimpleContent.Storage.EFCore.SQLite; + +namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20200723185404_AddPostShowCommentsSwitch")] + partial class AddPostShowCommentsSwitch + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.0.0"); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("ArchivedBy") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ArchivedUtc") + .HasColumnType("TEXT"); + + b.Property("Author") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentId") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("ContentSource") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DraftAuthor") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("TEXT"); + + b.Property("DraftPubDate") + .HasColumnType("TEXT"); + + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); + + b.Property("IsDraftHx") + .HasColumnType("INTEGER"); + + b.Property("IsPublished") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("LastModifiedByUser") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("TEXT"); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PageOrder") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ParentSlug") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ProjectId") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("Slug") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("TeaserOverride") + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("TEXT"); + + b.Property("WasDeleted") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentSource"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("CreatedByUser"); + + b.HasIndex("LastModifiedByUser"); + + b.HasIndex("Title"); + + b.ToTable("cs_ContentHistory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("AboutContent") + .HasColumnType("TEXT"); + + b.Property("AboutHeading") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("AddBlogToPagesTree") + .HasColumnType("INTEGER"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("INTEGER"); + + b.Property("BlogPageNavComponentVisibility") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("BlogPagePosition") + .HasColumnType("INTEGER"); + + b.Property("BlogPageText") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("CdnUrl") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ChannelCategoriesCsv") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ChannelRating") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("ChannelTimeToLive") + .HasColumnType("INTEGER"); + + b.Property("CommentNotificationEmail") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("CopyrightNotice") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("DaysToComment") + .HasColumnType("INTEGER"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("DisqusShortName") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("FacebookAppId") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("Image") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("INTEGER"); + + b.Property("LanguageCode") + .HasColumnType("TEXT") + .HasMaxLength(10); + + b.Property("LocalMediaVirtualPath") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ManagingEditorEmail") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("INTEGER"); + + b.Property("PostsPerPage") + .HasColumnType("INTEGER"); + + b.Property("PubDateFormat") + .HasColumnType("TEXT") + .HasMaxLength(75); + + b.Property("Publisher") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("PublisherEntityType") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("PublisherLogoHeight") + .HasColumnType("TEXT") + .HasMaxLength(20); + + b.Property("PublisherLogoUrl") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("PublisherLogoWidth") + .HasColumnType("TEXT") + .HasMaxLength(20); + + b.Property("RecaptchaPrivateKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("RecaptchaPublicKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("RemoteFeedUrl") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ShowAboutBox") + .HasColumnType("INTEGER"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("INTEGER"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("INTEGER"); + + b.Property("ShowRelatedPosts") + .HasColumnType("INTEGER"); + + b.Property("ShowTitle") + .HasColumnType("INTEGER"); + + b.Property("SiteName") + .HasColumnType("TEXT") + .HasMaxLength(200); + + b.Property("TeaserMode") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue((byte)0); + + b.Property("TeaserTruncationLength") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(20); + + b.Property("TeaserTruncationMode") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue((byte)0); + + b.Property("TimeZoneId") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("Title") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("TwitterCreator") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("TwitterPublisher") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("INTEGER"); + + b.Property("WebmasterEmail") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("PageEntityId") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("PageEntityId") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("UserAgent") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("TEXT") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DisableEditor") + .HasColumnType("INTEGER"); + + b.Property("DraftAuthor") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("TEXT"); + + b.Property("DraftPubDate") + .HasColumnType("TEXT"); + + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); + + b.Property("ExternalUrl") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("IsPublished") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("LastModifiedByUser") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("MenuFilters") + .HasColumnType("TEXT") + .HasMaxLength(500); + + b.Property("MenuOnly") + .HasColumnType("INTEGER"); + + b.Property("MetaDescription") + .HasColumnType("TEXT") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PageOrder") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("ParentSlug") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("ShowCategories") + .HasColumnType("INTEGER"); + + b.Property("ShowComments") + .HasColumnType("INTEGER"); + + b.Property("ShowHeading") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModified") + .HasColumnType("INTEGER"); + + b.Property("ShowMenu") + .HasColumnType("INTEGER"); + + b.Property("ShowPubDate") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("TemplateKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("Environment") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(15); + + b.Property("PageEntityId") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("Sort") + .HasColumnType("INTEGER"); + + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(10); + + b.Property("Url") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("PostEntityId") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("PostEntityId") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("UserAgent") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("AutoTeaser") + .HasColumnType("TEXT"); + + b.Property("BlogId") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("CategoriesCsv") + .HasColumnType("TEXT") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DraftAuthor") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("TEXT"); + + b.Property("DraftPubDate") + .HasColumnType("TEXT"); + + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); + + b.Property("ImageUrl") + .HasColumnType("TEXT") + .HasMaxLength(250); + + b.Property("IsFeatured") + .HasColumnType("INTEGER"); + + b.Property("IsPublished") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("LastModifiedByUser") + .HasColumnType("TEXT") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("TEXT") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasColumnType("TEXT") + .HasMaxLength(50); + + b.Property("ShowComments") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("SuppressTeaser") + .HasColumnType("INTEGER"); + + b.Property("TeaserOverride") + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.Property("ThumbnailUrl") + .HasColumnType("TEXT") + .HasMaxLength(250); + + b.Property("Title") + .IsRequired() + .HasColumnType("TEXT") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageComments") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageResources") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) + .WithMany("PostComments") + .HasForeignKey("PostEntityId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20200723185404_AddPostShowCommentsSwitch.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20200723185404_AddPostShowCommentsSwitch.cs new file mode 100644 index 000000000..610ef66fa --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20200723185404_AddPostShowCommentsSwitch.cs @@ -0,0 +1,59 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations +{ + public partial class AddPostShowCommentsSwitch : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ShowComments", + table: "cs_Post", + nullable: false, + defaultValue: false); + + migrationBuilder.AlterColumn( + name: "TeaserTruncationMode", + table: "cs_ContentProject", + nullable: false, + defaultValue: (byte)0, + oldClrType: typeof(byte), + oldDefaultValue: (byte)0) + .OldAnnotation("Sqlite:Autoincrement", true); + + migrationBuilder.AlterColumn( + name: "TeaserMode", + table: "cs_ContentProject", + nullable: false, + defaultValue: (byte)0, + oldClrType: typeof(byte), + oldDefaultValue: (byte)0) + .OldAnnotation("Sqlite:Autoincrement", true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ShowComments", + table: "cs_Post"); + + migrationBuilder.AlterColumn( + name: "TeaserTruncationMode", + table: "cs_ContentProject", + nullable: false, + defaultValue: (byte)0, + oldClrType: typeof(byte), + oldDefaultValue: (byte)0) + .Annotation("Sqlite:Autoincrement", true); + + migrationBuilder.AlterColumn( + name: "TeaserMode", + table: "cs_ContentProject", + nullable: false, + defaultValue: (byte)0, + oldClrType: typeof(byte), + oldDefaultValue: (byte)0) + .Annotation("Sqlite:Autoincrement", true); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs index d394832d7..c5f7e5115 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using cloudscribe.SimpleContent.Models; using cloudscribe.SimpleContent.Storage.EFCore.SQLite; namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations @@ -15,104 +14,140 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085"); + .HasAnnotation("ProductVersion", "3.0.0"); modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("ArchivedBy") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("ArchivedUtc"); + b.Property("ArchivedUtc") + .HasColumnType("TEXT"); b.Property("Author") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("CategoriesCsv"); + b.Property("CategoriesCsv") + .HasColumnType("TEXT"); - b.Property("Content"); + b.Property("Content") + .HasColumnType("TEXT"); b.Property("ContentId") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("ContentSource") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(50); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("TEXT"); b.Property("DraftAuthor") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("TEXT"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("TEXT"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); - b.Property("IsDraftHx"); + b.Property("IsDraftHx") + .HasColumnType("INTEGER"); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("INTEGER"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("TEXT"); b.Property("LastModifiedByUser") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("MetaDescription"); + b.Property("MetaDescription") + .HasColumnType("TEXT"); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("TEXT"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("TEXT"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("INTEGER"); b.Property("ParentId") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("ParentSlug") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("ProjectId") + .HasColumnType("TEXT") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("TEXT"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("TEXT"); b.Property("Serializer") + .HasColumnType("TEXT") .HasMaxLength(50); b.Property("Slug") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("TEXT"); b.Property("TemplateKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("TEXT"); - b.Property("WasDeleted"); + b.Property("WasDeleted") + .HasColumnType("INTEGER"); b.HasKey("Id"); @@ -134,157 +169,210 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(50); - b.Property("AboutContent"); + b.Property("AboutContent") + .HasColumnType("TEXT"); b.Property("AboutHeading") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("AddBlogToPagesTree"); + b.Property("AddBlogToPagesTree") + .HasColumnType("INTEGER"); - b.Property("BlogMenuLinksToNewestPost"); + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("INTEGER"); b.Property("BlogPageNavComponentVisibility") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("BlogPagePosition"); + b.Property("BlogPagePosition") + .HasColumnType("INTEGER"); b.Property("BlogPageText") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("CdnUrl") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("ChannelCategoriesCsv") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("ChannelRating") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("ChannelTimeToLive"); + b.Property("ChannelTimeToLive") + .HasColumnType("INTEGER"); b.Property("CommentNotificationEmail") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("CopyrightNotice") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("DaysToComment"); + b.Property("DaysToComment") + .HasColumnType("INTEGER"); b.Property("DefaultContentType") .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("DefaultFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") .HasDefaultValue(20); b.Property("DefaultPageSlug") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("Description"); + b.Property("Description") + .HasColumnType("TEXT"); b.Property("DisqusShortName") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("FacebookAppId") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("Image") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("IncludePubDateInPostUrls"); + b.Property("IncludePubDateInPostUrls") + .HasColumnType("INTEGER"); b.Property("LanguageCode") + .HasColumnType("TEXT") .HasMaxLength(10); b.Property("LocalMediaVirtualPath") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("ManagingEditorEmail") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("MaxFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") .HasDefaultValue(1000); - b.Property("ModerateComments"); + b.Property("ModerateComments") + .HasColumnType("INTEGER"); - b.Property("PostsPerPage"); + b.Property("PostsPerPage") + .HasColumnType("INTEGER"); b.Property("PubDateFormat") + .HasColumnType("TEXT") .HasMaxLength(75); b.Property("Publisher") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("PublisherEntityType") + .HasColumnType("TEXT") .HasMaxLength(50); b.Property("PublisherLogoHeight") + .HasColumnType("TEXT") .HasMaxLength(20); b.Property("PublisherLogoUrl") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("PublisherLogoWidth") + .HasColumnType("TEXT") .HasMaxLength(20); b.Property("RecaptchaPrivateKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("RecaptchaPublicKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("RemoteFeedUrl") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("ShowAboutBox"); + b.Property("ShowAboutBox") + .HasColumnType("INTEGER"); - b.Property("ShowFeaturedPostsOnDefaultPage"); + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("INTEGER"); - b.Property("ShowRecentPostsOnDefaultPage"); + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("INTEGER"); - b.Property("ShowRelatedPosts"); + b.Property("ShowRelatedPosts") + .HasColumnType("INTEGER"); - b.Property("ShowTitle"); + b.Property("ShowTitle") + .HasColumnType("INTEGER"); b.Property("SiteName") + .HasColumnType("TEXT") .HasMaxLength(200); b.Property("TeaserMode") .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") .HasDefaultValue((byte)0); b.Property("TeaserTruncationLength") .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") .HasDefaultValue(20); b.Property("TeaserTruncationMode") .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") .HasDefaultValue((byte)0); b.Property("TimeZoneId") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("Title") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("TwitterCreator") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("TwitterPublisher") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("UseDefaultPageAsRootNode"); + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("INTEGER"); b.Property("WebmasterEmail") + .HasColumnType("TEXT") .HasMaxLength(100); b.HasKey("Id"); @@ -295,13 +383,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => { b.Property("Value") + .HasColumnType("TEXT") .HasMaxLength(50); b.Property("PageEntityId") + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(50); b.HasKey("Value", "PageEntityId"); @@ -318,37 +409,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("Author") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("TEXT"); b.Property("Email") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("INTEGER"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("INTEGER"); b.Property("PageEntityId") + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("TEXT"); b.Property("UserAgent") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("Website") + .HasColumnType("TEXT") .HasMaxLength(255); b.HasKey("Id"); @@ -363,106 +465,144 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("Author") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("CategoriesCsv") + .HasColumnType("TEXT") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("TEXT"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("TEXT"); - b.Property("DisableEditor"); + b.Property("DisableEditor") + .HasColumnType("INTEGER"); b.Property("DraftAuthor") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("TEXT"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("TEXT"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); b.Property("ExternalUrl") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("INTEGER"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("TEXT"); b.Property("LastModifiedByUser") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("MenuFilters") + .HasColumnType("TEXT") .HasMaxLength(500); - b.Property("MenuOnly"); + b.Property("MenuOnly") + .HasColumnType("INTEGER"); b.Property("MetaDescription") + .HasColumnType("TEXT") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("TEXT"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("TEXT"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("INTEGER"); b.Property("ParentId") + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("ParentSlug") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("ProjectId") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("TEXT"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("TEXT"); b.Property("Serializer") + .HasColumnType("TEXT") .HasMaxLength(50); - b.Property("ShowCategories"); + b.Property("ShowCategories") + .HasColumnType("INTEGER"); - b.Property("ShowComments"); + b.Property("ShowComments") + .HasColumnType("INTEGER"); - b.Property("ShowHeading"); + b.Property("ShowHeading") + .HasColumnType("INTEGER"); - b.Property("ShowLastModified"); + b.Property("ShowLastModified") + .HasColumnType("INTEGER"); - b.Property("ShowMenu"); + b.Property("ShowMenu") + .HasColumnType("INTEGER"); - b.Property("ShowPubDate"); + b.Property("ShowPubDate") + .HasColumnType("INTEGER"); b.Property("Slug") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("TemplateKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("TEXT"); b.HasKey("Id"); @@ -478,24 +618,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("Environment") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(15); b.Property("PageEntityId") + .HasColumnType("TEXT") .HasMaxLength(36); - b.Property("Sort"); + b.Property("Sort") + .HasColumnType("INTEGER"); b.Property("Type") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(10); b.Property("Url") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(255); b.HasKey("Id"); @@ -508,13 +653,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => { b.Property("Value") + .HasColumnType("TEXT") .HasMaxLength(50); b.Property("PostEntityId") + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(50); b.HasKey("Value", "PostEntityId"); @@ -531,37 +679,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("Author") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("TEXT"); b.Property("Email") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("INTEGER"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("INTEGER"); b.Property("PostEntityId") + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("TEXT"); b.Property("UserAgent") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("Website") + .HasColumnType("TEXT") .HasMaxLength(255); b.HasKey("Id"); @@ -576,87 +735,120 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(36); b.Property("Author") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("AutoTeaser"); + b.Property("AutoTeaser") + .HasColumnType("TEXT"); b.Property("BlogId") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(50); b.Property("CategoriesCsv") + .HasColumnType("TEXT") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("TEXT"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("TEXT") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("TEXT") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("TEXT"); b.Property("DraftAuthor") + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("TEXT"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("TEXT"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); b.Property("ImageUrl") + .HasColumnType("TEXT") .HasMaxLength(250); - b.Property("IsFeatured"); + b.Property("IsFeatured") + .HasColumnType("INTEGER"); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("INTEGER"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("TEXT"); b.Property("LastModifiedByUser") + .HasColumnType("TEXT") .HasMaxLength(100); b.Property("MetaDescription") + .HasColumnType("TEXT") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("TEXT"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("TEXT"); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("TEXT"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("TEXT"); b.Property("Serializer") + .HasColumnType("TEXT") .HasMaxLength(50); + b.Property("ShowComments") + .HasColumnType("INTEGER"); + b.Property("Slug") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(255); - b.Property("SuppressTeaser"); + b.Property("SuppressTeaser") + .HasColumnType("INTEGER"); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("TEXT"); b.Property("TemplateKey") + .HasColumnType("TEXT") .HasMaxLength(255); b.Property("ThumbnailUrl") + .HasColumnType("TEXT") .HasMaxLength(250); b.Property("Title") .IsRequired() + .HasColumnType("TEXT") .HasMaxLength(255); b.HasKey("Id"); @@ -672,7 +864,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageComments") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -680,7 +872,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageResources") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -688,7 +880,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) .WithMany("PostComments") .HasForeignKey("PostEntityId"); }); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/SimpleContentDbContext.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/SimpleContentDbContext.cs index dfac39008..32960fedd 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/SimpleContentDbContext.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/SimpleContentDbContext.cs @@ -180,6 +180,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasMany(p => p.PostComments) .WithOne(); + entity.Property(p => p.ShowComments).IsRequired(); + entity.Property(p => p.ImageUrl).HasMaxLength(250); entity.Property(p => p.ThumbnailUrl).HasMaxLength(250); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/cloudscribe.SimpleContent.Storage.EFCore.SQLite.csproj b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/cloudscribe.SimpleContent.Storage.EFCore.SQLite.csproj index da3e5cb9a..e11e6f1a9 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/cloudscribe.SimpleContent.Storage.EFCore.SQLite.csproj +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/cloudscribe.SimpleContent.Storage.EFCore.SQLite.csproj @@ -2,7 +2,7 @@ SQLite Entity Framework Core implementation of cloudscribe SimpleContent commands and queries - 5.1.0 + 5.1.2 Joe Audette netstandard2.1 cloudscribe;commands;queries;ef diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20200723185255_AddPostShowCommentsSwitch.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20200723185255_AddPostShowCommentsSwitch.Designer.cs new file mode 100644 index 000000000..e317cae71 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20200723185255_AddPostShowCommentsSwitch.Designer.cs @@ -0,0 +1,895 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using cloudscribe.SimpleContent.Storage.EFCore.pgsql; + +namespace cloudscribe.SimpleContent.Storage.EFCore.pgsql.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20200723185255_AddPostShowCommentsSwitch")] + partial class AddPostShowCommentsSwitch + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasMaxLength(36); + + b.Property("ArchivedBy") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ArchivedUtc") + .HasColumnType("timestamp without time zone"); + + b.Property("Author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("text"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("ContentId") + .IsRequired() + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ContentSource") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftAuthor") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftSerializedModel") + .HasColumnType("text"); + + b.Property("IsDraftHx") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp without time zone"); + + b.Property("LastModifiedByUser") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaHtml") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnType("text"); + + b.Property("PageOrder") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ParentSlug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ProjectId") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("SerializedModel") + .HasColumnType("text"); + + b.Property("Serializer") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("Slug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("TeaserOverride") + .HasColumnType("text"); + + b.Property("TemplateKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("text"); + + b.Property("WasDeleted") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex("ContentSource"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("CreatedByUser"); + + b.HasIndex("LastModifiedByUser"); + + b.HasIndex("Title"); + + b.ToTable("cs_ContentHistory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("AboutContent") + .HasColumnType("text"); + + b.Property("AboutHeading") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("AddBlogToPagesTree") + .HasColumnType("boolean"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("boolean"); + + b.Property("BlogPageNavComponentVisibility") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("BlogPagePosition") + .HasColumnType("integer"); + + b.Property("BlogPageText") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CdnUrl") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ChannelCategoriesCsv") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ChannelRating") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("ChannelTimeToLive") + .HasColumnType("integer"); + + b.Property("CommentNotificationEmail") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CopyrightNotice") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DaysToComment") + .HasColumnType("integer"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisqusShortName") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("FacebookAppId") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Image") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("boolean"); + + b.Property("LanguageCode") + .HasColumnType("character varying(10)") + .HasMaxLength(10); + + b.Property("LocalMediaVirtualPath") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ManagingEditorEmail") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("boolean"); + + b.Property("PostsPerPage") + .HasColumnType("integer"); + + b.Property("PubDateFormat") + .HasColumnType("character varying(75)") + .HasMaxLength(75); + + b.Property("Publisher") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("PublisherEntityType") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PublisherLogoHeight") + .HasColumnType("character varying(20)") + .HasMaxLength(20); + + b.Property("PublisherLogoUrl") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("PublisherLogoWidth") + .HasColumnType("character varying(20)") + .HasMaxLength(20); + + b.Property("RecaptchaPrivateKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("RecaptchaPublicKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("RemoteFeedUrl") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ShowAboutBox") + .HasColumnType("boolean"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("boolean"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("boolean"); + + b.Property("ShowRelatedPosts") + .HasColumnType("boolean"); + + b.Property("ShowTitle") + .HasColumnType("boolean"); + + b.Property("SiteName") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("TeaserMode") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)0); + + b.Property("TeaserTruncationLength") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(20); + + b.Property("TeaserTruncationMode") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)0); + + b.Property("TimeZoneId") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Title") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("TwitterCreator") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("TwitterPublisher") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("boolean"); + + b.Property("WebmasterEmail") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PageEntityId") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("boolean"); + + b.Property("IsApproved") + .HasColumnType("boolean"); + + b.Property("PageEntityId") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("UserAgent") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CategoriesCsv") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("timestamp without time zone"); + + b.Property("DisableEditor") + .HasColumnType("boolean"); + + b.Property("DraftAuthor") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftSerializedModel") + .HasColumnType("text"); + + b.Property("ExternalUrl") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp without time zone"); + + b.Property("LastModifiedByUser") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MenuFilters") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("MenuOnly") + .HasColumnType("boolean"); + + b.Property("MetaDescription") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnType("text"); + + b.Property("PageOrder") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ParentSlug") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("SerializedModel") + .HasColumnType("text"); + + b.Property("Serializer") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("ShowCategories") + .HasColumnType("boolean"); + + b.Property("ShowComments") + .HasColumnType("boolean"); + + b.Property("ShowHeading") + .HasColumnType("boolean"); + + b.Property("ShowLastModified") + .HasColumnType("boolean"); + + b.Property("ShowMenu") + .HasColumnType("boolean"); + + b.Property("ShowPubDate") + .HasColumnType("boolean"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("TemplateKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Title") + .IsRequired() + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ViewRoles") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Environment") + .IsRequired() + .HasColumnType("character varying(15)") + .HasMaxLength(15); + + b.Property("PageEntityId") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Sort") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(10)") + .HasMaxLength(10); + + b.Property("Url") + .IsRequired() + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PostEntityId") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Ip") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("IsAdmin") + .HasColumnType("boolean"); + + b.Property("IsApproved") + .HasColumnType("boolean"); + + b.Property("PostEntityId") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("ProjectId") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("UserAgent") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("Website") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasColumnType("character varying(36)") + .HasMaxLength(36); + + b.Property("Author") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("AutoTeaser") + .HasColumnType("text"); + + b.Property("BlogId") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("CategoriesCsv") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") + .HasMaxLength(50) + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("CreatedByUser") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("CreatedUtc") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftAuthor") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("DraftContent") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("DraftSerializedModel") + .HasColumnType("text"); + + b.Property("ImageUrl") + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("IsFeatured") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp without time zone"); + + b.Property("LastModifiedByUser") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("MetaDescription") + .HasColumnType("character varying(500)") + .HasMaxLength(500); + + b.Property("MetaHtml") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnType("text"); + + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); + + b.Property("SerializedModel") + .HasColumnType("text"); + + b.Property("Serializer") + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.Property("ShowComments") + .HasColumnType("boolean"); + + b.Property("Slug") + .IsRequired() + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("SuppressTeaser") + .HasColumnType("boolean"); + + b.Property("TeaserOverride") + .HasColumnType("text"); + + b.Property("TemplateKey") + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.Property("ThumbnailUrl") + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Title") + .IsRequired() + .HasColumnType("character varying(255)") + .HasMaxLength(255); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageComments") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) + .WithMany("PageResources") + .HasForeignKey("PageEntityId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) + .WithMany("PostComments") + .HasForeignKey("PostEntityId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20200723185255_AddPostShowCommentsSwitch.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20200723185255_AddPostShowCommentsSwitch.cs new file mode 100644 index 000000000..42bc14706 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20200723185255_AddPostShowCommentsSwitch.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace cloudscribe.SimpleContent.Storage.EFCore.pgsql.Migrations +{ + public partial class AddPostShowCommentsSwitch : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ShowComments", + table: "cs_Post", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ShowComments", + table: "cs_Post"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/SimpleContentDbContextModelSnapshot.cs index 65d13728c..8a70b766a 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using cloudscribe.SimpleContent.Models; using cloudscribe.SimpleContent.Storage.EFCore.pgsql; namespace cloudscribe.SimpleContent.Storage.EFCore.pgsql.Migrations @@ -16,106 +15,142 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() + .HasColumnType("uuid") .HasMaxLength(36); b.Property("ArchivedBy") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("ArchivedUtc"); + b.Property("ArchivedUtc") + .HasColumnType("timestamp without time zone"); b.Property("Author") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("CategoriesCsv"); + b.Property("CategoriesCsv") + .HasColumnType("text"); - b.Property("Content"); + b.Property("Content") + .HasColumnType("text"); b.Property("ContentId") .IsRequired() + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ContentSource") .IsRequired() + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("timestamp without time zone"); b.Property("DraftAuthor") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("text"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("timestamp without time zone"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("text"); - b.Property("IsDraftHx"); + b.Property("IsDraftHx") + .HasColumnType("boolean"); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("boolean"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("timestamp without time zone"); b.Property("LastModifiedByUser") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("MetaDescription"); + b.Property("MetaDescription") + .HasColumnType("text"); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("text"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("text"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("integer"); b.Property("ParentId") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ParentSlug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ProjectId") + .HasColumnType("character varying(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("text"); b.Property("Serializer") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("Slug") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("text"); b.Property("TemplateKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("text"); - b.Property("WasDeleted"); + b.Property("WasDeleted") + .HasColumnType("boolean"); b.HasKey("Id"); @@ -137,157 +172,210 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") .HasMaxLength(50); - b.Property("AboutContent"); + b.Property("AboutContent") + .HasColumnType("text"); b.Property("AboutHeading") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("AddBlogToPagesTree"); + b.Property("AddBlogToPagesTree") + .HasColumnType("boolean"); - b.Property("BlogMenuLinksToNewestPost"); + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("boolean"); b.Property("BlogPageNavComponentVisibility") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("BlogPagePosition"); + b.Property("BlogPagePosition") + .HasColumnType("integer"); b.Property("BlogPageText") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CdnUrl") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ChannelCategoriesCsv") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ChannelRating") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("ChannelTimeToLive"); + b.Property("ChannelTimeToLive") + .HasColumnType("integer"); b.Property("CommentNotificationEmail") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("CopyrightNotice") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("DaysToComment"); + b.Property("DaysToComment") + .HasColumnType("integer"); b.Property("DefaultContentType") .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("DefaultFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("integer") .HasDefaultValue(20); b.Property("DefaultPageSlug") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("Description"); + b.Property("Description") + .HasColumnType("text"); b.Property("DisqusShortName") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("FacebookAppId") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Image") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("IncludePubDateInPostUrls"); + b.Property("IncludePubDateInPostUrls") + .HasColumnType("boolean"); b.Property("LanguageCode") + .HasColumnType("character varying(10)") .HasMaxLength(10); b.Property("LocalMediaVirtualPath") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ManagingEditorEmail") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("MaxFeedItems") .ValueGeneratedOnAdd() + .HasColumnType("integer") .HasDefaultValue(1000); - b.Property("ModerateComments"); + b.Property("ModerateComments") + .HasColumnType("boolean"); - b.Property("PostsPerPage"); + b.Property("PostsPerPage") + .HasColumnType("integer"); b.Property("PubDateFormat") + .HasColumnType("character varying(75)") .HasMaxLength(75); b.Property("Publisher") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("PublisherEntityType") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PublisherLogoHeight") + .HasColumnType("character varying(20)") .HasMaxLength(20); b.Property("PublisherLogoUrl") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("PublisherLogoWidth") + .HasColumnType("character varying(20)") .HasMaxLength(20); b.Property("RecaptchaPrivateKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("RecaptchaPublicKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("RemoteFeedProcessorUseAgentFragment") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("RemoteFeedUrl") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("ShowAboutBox"); + b.Property("ShowAboutBox") + .HasColumnType("boolean"); - b.Property("ShowFeaturedPostsOnDefaultPage"); + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("boolean"); - b.Property("ShowRecentPostsOnDefaultPage"); + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("boolean"); - b.Property("ShowRelatedPosts"); + b.Property("ShowRelatedPosts") + .HasColumnType("boolean"); - b.Property("ShowTitle"); + b.Property("ShowTitle") + .HasColumnType("boolean"); b.Property("SiteName") + .HasColumnType("character varying(200)") .HasMaxLength(200); b.Property("TeaserMode") .ValueGeneratedOnAdd() + .HasColumnType("smallint") .HasDefaultValue((byte)0); b.Property("TeaserTruncationLength") .ValueGeneratedOnAdd() + .HasColumnType("integer") .HasDefaultValue(20); b.Property("TeaserTruncationMode") .ValueGeneratedOnAdd() + .HasColumnType("smallint") .HasDefaultValue((byte)0); b.Property("TimeZoneId") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Title") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("TwitterCreator") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("TwitterPublisher") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("UseDefaultPageAsRootNode"); + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("boolean"); b.Property("WebmasterEmail") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.HasKey("Id"); @@ -298,13 +386,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => { b.Property("Value") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PageEntityId") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("character varying(50)") .HasMaxLength(50); b.HasKey("Value", "PageEntityId"); @@ -321,37 +412,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("text"); b.Property("Email") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("boolean"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("boolean"); b.Property("PageEntityId") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("character varying(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); b.Property("UserAgent") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Website") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -366,106 +468,144 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CategoriesCsv") + .HasColumnType("character varying(500)") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("text"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("timestamp without time zone"); - b.Property("DisableEditor"); + b.Property("DisableEditor") + .HasColumnType("boolean"); b.Property("DraftAuthor") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("text"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("timestamp without time zone"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("text"); b.Property("ExternalUrl") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("boolean"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("timestamp without time zone"); b.Property("LastModifiedByUser") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("MenuFilters") + .HasColumnType("character varying(500)") .HasMaxLength(500); - b.Property("MenuOnly"); + b.Property("MenuOnly") + .HasColumnType("boolean"); b.Property("MetaDescription") + .HasColumnType("character varying(500)") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("text"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("text"); - b.Property("PageOrder"); + b.Property("PageOrder") + .HasColumnType("integer"); b.Property("ParentId") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ParentSlug") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ProjectId") .IsRequired() + .HasColumnType("character varying(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("text"); b.Property("Serializer") + .HasColumnType("character varying(50)") .HasMaxLength(50); - b.Property("ShowCategories"); + b.Property("ShowCategories") + .HasColumnType("boolean"); - b.Property("ShowComments"); + b.Property("ShowComments") + .HasColumnType("boolean"); - b.Property("ShowHeading"); + b.Property("ShowHeading") + .HasColumnType("boolean"); - b.Property("ShowLastModified"); + b.Property("ShowLastModified") + .HasColumnType("boolean"); - b.Property("ShowMenu"); + b.Property("ShowMenu") + .HasColumnType("boolean"); - b.Property("ShowPubDate"); + b.Property("ShowPubDate") + .HasColumnType("boolean"); b.Property("Slug") .IsRequired() + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("TemplateKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Title") .IsRequired() + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("ViewRoles"); + b.Property("ViewRoles") + .HasColumnType("text"); b.HasKey("Id"); @@ -481,24 +621,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Environment") .IsRequired() + .HasColumnType("character varying(15)") .HasMaxLength(15); b.Property("PageEntityId") + .HasColumnType("character varying(36)") .HasMaxLength(36); - b.Property("Sort"); + b.Property("Sort") + .HasColumnType("integer"); b.Property("Type") .IsRequired() + .HasColumnType("character varying(10)") .HasMaxLength(10); b.Property("Url") .IsRequired() + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -511,13 +656,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => { b.Property("Value") + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("PostEntityId") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("character varying(50)") .HasMaxLength(50); b.HasKey("Value", "PostEntityId"); @@ -534,37 +682,48 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("Content"); + b.Property("Content") + .HasColumnType("text"); b.Property("Email") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("Ip") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("IsAdmin"); + b.Property("IsAdmin") + .HasColumnType("boolean"); - b.Property("IsApproved"); + b.Property("IsApproved") + .HasColumnType("boolean"); b.Property("PostEntityId") + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("ProjectId") .IsRequired() + .HasColumnType("character varying(50)") .HasMaxLength(50); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); b.Property("UserAgent") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("Website") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -579,87 +738,120 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => { b.Property("Id") - .ValueGeneratedOnAdd() + .HasColumnType("character varying(36)") .HasMaxLength(36); b.Property("Author") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("AutoTeaser"); + b.Property("AutoTeaser") + .HasColumnType("text"); b.Property("BlogId") .IsRequired() + .HasColumnType("character varying(50)") .HasMaxLength(50); b.Property("CategoriesCsv") + .HasColumnType("character varying(500)") .HasMaxLength(500); - b.Property("Content"); + b.Property("Content") + .HasColumnType("text"); b.Property("ContentType") .ValueGeneratedOnAdd() + .HasColumnType("character varying(50)") .HasMaxLength(50) .HasDefaultValue("html"); b.Property("CorrelationKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("CreatedByUser") + .HasColumnType("character varying(100)") .HasMaxLength(100); - b.Property("CreatedUtc"); + b.Property("CreatedUtc") + .HasColumnType("timestamp without time zone"); b.Property("DraftAuthor") + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("DraftContent"); + b.Property("DraftContent") + .HasColumnType("text"); - b.Property("DraftPubDate"); + b.Property("DraftPubDate") + .HasColumnType("timestamp without time zone"); - b.Property("DraftSerializedModel"); + b.Property("DraftSerializedModel") + .HasColumnType("text"); b.Property("ImageUrl") + .HasColumnType("character varying(250)") .HasMaxLength(250); - b.Property("IsFeatured"); + b.Property("IsFeatured") + .HasColumnType("boolean"); - b.Property("IsPublished"); + b.Property("IsPublished") + .HasColumnType("boolean"); - b.Property("LastModified"); + b.Property("LastModified") + .HasColumnType("timestamp without time zone"); b.Property("LastModifiedByUser") + .HasColumnType("character varying(100)") .HasMaxLength(100); b.Property("MetaDescription") + .HasColumnType("character varying(500)") .HasMaxLength(500); - b.Property("MetaHtml"); + b.Property("MetaHtml") + .HasColumnType("text"); - b.Property("MetaJson"); + b.Property("MetaJson") + .HasColumnType("text"); - b.Property("PubDate"); + b.Property("PubDate") + .HasColumnType("timestamp without time zone"); - b.Property("SerializedModel"); + b.Property("SerializedModel") + .HasColumnType("text"); b.Property("Serializer") + .HasColumnType("character varying(50)") .HasMaxLength(50); + b.Property("ShowComments") + .HasColumnType("boolean"); + b.Property("Slug") .IsRequired() + .HasColumnType("character varying(255)") .HasMaxLength(255); - b.Property("SuppressTeaser"); + b.Property("SuppressTeaser") + .HasColumnType("boolean"); - b.Property("TeaserOverride"); + b.Property("TeaserOverride") + .HasColumnType("text"); b.Property("TemplateKey") + .HasColumnType("character varying(255)") .HasMaxLength(255); b.Property("ThumbnailUrl") + .HasColumnType("character varying(250)") .HasMaxLength(250); b.Property("Title") .IsRequired() + .HasColumnType("character varying(255)") .HasMaxLength(255); b.HasKey("Id"); @@ -675,7 +867,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageComments") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -683,7 +875,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", null) .WithMany("PageResources") .HasForeignKey("PageEntityId") .OnDelete(DeleteBehavior.Cascade); @@ -691,7 +883,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => { - b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity") + b.HasOne("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", null) .WithMany("PostComments") .HasForeignKey("PostEntityId"); }); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/SimpleContentDbContext.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/SimpleContentDbContext.cs index 0ded182b1..d8d148113 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/SimpleContentDbContext.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/SimpleContentDbContext.cs @@ -187,6 +187,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasMany(p => p.PostComments) .WithOne(); + entity.Property(p => p.ShowComments).IsRequired(); + entity.Property(p => p.ImageUrl).HasMaxLength(250); entity.Property(p => p.ThumbnailUrl).HasMaxLength(250); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/cloudscribe.SimpleContent.Storage.EFCore.pgsql.csproj b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/cloudscribe.SimpleContent.Storage.EFCore.pgsql.csproj index 0bade1fcd..36ec3b873 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/cloudscribe.SimpleContent.Storage.EFCore.pgsql.csproj +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/cloudscribe.SimpleContent.Storage.EFCore.pgsql.csproj @@ -2,7 +2,7 @@ PostgreSql Entity Framework Core implementation of cloudscribe SimpleContent commands and queries - 5.1.0 + 5.1.2 Joe Audette netstandard2.1 cloudscribe;commands;queries;ef diff --git a/src/cloudscribe.SimpleContent.Storage.NoDb/PostXmlSerializer.cs b/src/cloudscribe.SimpleContent.Storage.NoDb/PostXmlSerializer.cs index e9a787f34..1a42ad27d 100644 --- a/src/cloudscribe.SimpleContent.Storage.NoDb/PostXmlSerializer.cs +++ b/src/cloudscribe.SimpleContent.Storage.NoDb/PostXmlSerializer.cs @@ -65,7 +65,8 @@ public string Serialize(Post post) new XElement("teaserOverride", post.TeaserOverride), new XElement("suppressTeaser", post.SuppressTeaser), new XElement("categories", string.Empty), - new XElement("comments", string.Empty) + new XElement("comments", string.Empty), + new XElement("showcomments", post.ShowComments) )); //XElement categories = doc.XPathSelectElement("post/categories"); @@ -154,6 +155,7 @@ public Post Deserialize(string xmlString, string key) SerializedModel = ReadValue(doc.Root, "serializedModel"), DraftSerializedModel = ReadValue(doc.Root, "draftSerializedModel"), Serializer = ReadValue(doc.Root, "serializer"), + ShowComments = bool.Parse(ReadValue(doc.Root, "showcomments", "true")) }; diff --git a/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs b/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs index e23524a5b..4875b828b 100644 --- a/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs +++ b/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs @@ -100,6 +100,10 @@ public YamlPost() [YamlMember(Order = 29)] public string AutoTeaser { get; set; } + [YamlMember(Order = 30)] + public bool ShowComments { get; set; } = true; + + [YamlIgnore] diff --git a/src/cloudscribe.SimpleContent.Storage.NoDb/cloudscribe.SimpleContent.Storage.NoDb.csproj b/src/cloudscribe.SimpleContent.Storage.NoDb/cloudscribe.SimpleContent.Storage.NoDb.csproj index 40e5ce624..f9df6182c 100644 --- a/src/cloudscribe.SimpleContent.Storage.NoDb/cloudscribe.SimpleContent.Storage.NoDb.csproj +++ b/src/cloudscribe.SimpleContent.Storage.NoDb/cloudscribe.SimpleContent.Storage.NoDb.csproj @@ -2,7 +2,7 @@ cloudscribe.SimpleContent.Storage implemented with NoDb file system storage - 5.1.0 + 5.1.3 Joe Audette netcoreapp3.1 cloudscribe;blog;json diff --git a/src/cloudscribe.SimpleContent.Web/Controllers/BlogController.cs b/src/cloudscribe.SimpleContent.Web/Controllers/BlogController.cs index 24305e3e5..254e2fe20 100644 --- a/src/cloudscribe.SimpleContent.Web/Controllers/BlogController.cs +++ b/src/cloudscribe.SimpleContent.Web/Controllers/BlogController.cs @@ -436,7 +436,7 @@ public virtual async Task Post( model.BlogRoutes = BlogRoutes; model.Categories = await BlogService.GetCategories(model.CanEdit, cancellationToken); model.Archives = await BlogService.GetArchives(model.CanEdit, cancellationToken); - model.ShowComments = true; //mode.Length == 0; // do we need this for a global disable + model.ShowComments = result.Post.ShowComments; //mode.Length == 0; // do we need this for a global disable model.CommentsAreOpen = await BlogService.CommentsAreOpen(result.Post, canEdit); model.TimeZoneHelper = TimeZoneHelper; model.TimeZoneId = await TimeZoneIdResolver.GetUserTimeZoneId(cancellationToken); @@ -670,6 +670,7 @@ public virtual async Task EditWithTemplate( ThumbnailUrl = postResult.Post.ThumbnailUrl, IsFeatured = postResult.Post.IsFeatured, IsPublished = postResult.Post.IsPublished, + ShowComments = postResult.Post.ShowComments, MetaDescription = postResult.Post.MetaDescription, Slug = postResult.Post.Slug, Title = postResult.Post.Title, @@ -900,6 +901,7 @@ public virtual async Task Edit( { model.ContentType = "html"; } + model.ShowComments = true; } else { @@ -922,6 +924,7 @@ public virtual async Task Edit( model.Id = postResult.Post.Id; model.CorrelationKey = postResult.Post.CorrelationKey; model.IsPublished = postResult.Post.IsPublished; + model.ShowComments = postResult.Post.ShowComments; model.MetaDescription = postResult.Post.MetaDescription; model.Slug = postResult.Post.Slug; model.Title = postResult.Post.Title; diff --git a/src/cloudscribe.SimpleContent.Web/Services/Blog/CreateOrUpdatePostHandler.cs b/src/cloudscribe.SimpleContent.Web/Services/Blog/CreateOrUpdatePostHandler.cs index 124591999..febe4f0b1 100644 --- a/src/cloudscribe.SimpleContent.Web/Services/Blog/CreateOrUpdatePostHandler.cs +++ b/src/cloudscribe.SimpleContent.Web/Services/Blog/CreateOrUpdatePostHandler.cs @@ -117,6 +117,7 @@ ILogger logger post.ContentType = request.ViewModel.ContentType; post.TeaserOverride = request.ViewModel.TeaserOverride; post.SuppressTeaser = request.ViewModel.SuppressTeaser; + post.ShowComments = request.ViewModel.ShowComments; post.LastModified = DateTime.UtcNow; post.LastModifiedByUser = request.UserName; diff --git a/src/cloudscribe.SimpleContent.Web/Services/Blog/UpdateTemplatedPostHandler.cs b/src/cloudscribe.SimpleContent.Web/Services/Blog/UpdateTemplatedPostHandler.cs index e9e00d129..4467b010f 100644 --- a/src/cloudscribe.SimpleContent.Web/Services/Blog/UpdateTemplatedPostHandler.cs +++ b/src/cloudscribe.SimpleContent.Web/Services/Blog/UpdateTemplatedPostHandler.cs @@ -190,6 +190,7 @@ private IValidateTemplateModel GetValidator(string name) post.IsFeatured = request.ViewModel.IsFeatured; post.TeaserOverride = request.ViewModel.TeaserOverride; post.SuppressTeaser = request.ViewModel.SuppressTeaser; + post.ShowComments = request.ViewModel.ShowComments; post.LastModified = DateTime.UtcNow; post.LastModifiedByUser = request.UserName; post.MetaDescription = request.ViewModel.MetaDescription; diff --git a/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditViewModel.cs b/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditViewModel.cs index 3ee90160a..2b8a2dcef 100644 --- a/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditViewModel.cs +++ b/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditViewModel.cs @@ -47,7 +47,7 @@ public class PostEditViewModel public string CurrentPostUrl { get; set; } public string DeletePostRouteName { get; set; } - + public bool ShowComments { get; set; } = false; public bool IsFeatured { get; set; } = false; public string ImageUrl { get; set; } diff --git a/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditWithTemplateViewModel.cs b/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditWithTemplateViewModel.cs index b3068bc5f..a703d26f5 100644 --- a/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditWithTemplateViewModel.cs +++ b/src/cloudscribe.SimpleContent.Web/ViewModels/PostEditWithTemplateViewModel.cs @@ -44,7 +44,7 @@ public class PostEditWithTemplateViewModel public string CurrentPostUrl { get; set; } public string DeletePostRouteName { get; set; } - + public bool ShowComments { get; set; } = false; public bool IsFeatured { get; set; } = false; public string ImageUrl { get; set; } diff --git a/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj b/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj index f8856bd61..59459b728 100644 --- a/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj +++ b/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj @@ -2,7 +2,7 @@ A simple, yet flexible content and blog engine for ASP.NET Core that can work with or without a database - 5.1.1 + 5.1.3 Joe Audette netcoreapp3.1 cloudscribe;blog,content diff --git a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/post/2020/07/mike-test.xml b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/post/2020/07/mike-test.xml new file mode 100644 index 000000000..d6715aec9 --- /dev/null +++ b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/post/2020/07/mike-test.xml @@ -0,0 +1,34 @@ + + + mike-test + Mike Test + mike-test + + Admin + 2020-07-21T22:55:01.5259933Z + 2020-07-21T22:55:01 + + <p>This is a Mike Test</p> + + html + + + 2020-07-21T22:55:01 + admin + admin + + + + + + + + f83067b4-919d-4910-acd1-4b3b1c210ecf + true + false + + + false + + + \ No newline at end of file diff --git a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/siteuser/17595de8-d27a-4304-bded-76b61a16ad19.json b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/siteuser/17595de8-d27a-4304-bded-76b61a16ad19.json index 52aaecbd7..d1f2b66b7 100644 --- a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/siteuser/17595de8-d27a-4304-bded-76b61a16ad19.json +++ b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/siteuser/17595de8-d27a-4304-bded-76b61a16ad19.json @@ -1 +1 @@ -{"AuthorBio":"","Comment":"","NormalizedEmail":"ADMIN@ADMIN.COM","NormalizedUserName":"ADMIN","EmailConfirmed":true,"EmailConfirmSentUtc":null,"AgreementAcceptedUtc":null,"LockoutEndDateUtc":null,"NewEmail":"","NewEmailApproved":false,"LastPasswordChangeUtc":"2016-08-04T12:49:48.375127Z","MustChangePwd":false,"PasswordHash":"AQAAAAEAACcQAAAAEDjfkVQ1S7wRv8QUPAVqnqHKWzXJlN1cOMi/AKF9Dunh2+VqbrFR6Spd/8ZcaZxx/w==","CanAutoLockout":true,"AccessFailedCount":0,"RolesChanged":false,"SecurityStamp":"323c83f3-a064-4348-9a7d-093e0d52490b","Signature":"","TwoFactorEnabled":false,"BrowserKey":"01b79fac-ec68-447c-ae1d-959349d53b27","Id":"17595de8-d27a-4304-bded-76b61a16ad19","SiteId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","Email":"admin@admin.com","UserName":"admin","DisplayName":"Admin","FirstName":"","LastName":"","AvatarUrl":"","DateOfBirth":null,"CreatedUtc":"2016-08-04T12:03:50.2175089Z","LastModifiedUtc":"2016-08-04T12:03:50.2175089Z","DisplayInMemberList":true,"Gender":"","IsLockedOut":false,"LastLoginUtc":"2019-11-05T10:26:58.3534573Z","PhoneNumber":"","PhoneNumberConfirmed":false,"AccountApproved":true,"TimeZoneId":"","WebSiteUrl":""} \ No newline at end of file +{"AuthorBio":"","Comment":"","NormalizedEmail":"ADMIN@ADMIN.COM","NormalizedUserName":"ADMIN","EmailConfirmed":true,"EmailConfirmSentUtc":null,"AgreementAcceptedUtc":null,"LockoutEndDateUtc":null,"NewEmail":"","NewEmailApproved":false,"LastPasswordChangeUtc":"2016-08-04T12:49:48.375127Z","MustChangePwd":false,"PasswordHash":"AQAAAAEAACcQAAAAEDjfkVQ1S7wRv8QUPAVqnqHKWzXJlN1cOMi/AKF9Dunh2+VqbrFR6Spd/8ZcaZxx/w==","CanAutoLockout":true,"AccessFailedCount":0,"RolesChanged":false,"SecurityStamp":"323c83f3-a064-4348-9a7d-093e0d52490b","Signature":"","TwoFactorEnabled":false,"BrowserKey":"11cd7b0f-eda7-4b53-ba89-8e90d2be1d16","Id":"17595de8-d27a-4304-bded-76b61a16ad19","SiteId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","Email":"admin@admin.com","UserName":"admin","DisplayName":"Admin","FirstName":"","LastName":"","AvatarUrl":"","DateOfBirth":null,"CreatedUtc":"2016-08-04T12:03:50.2175089Z","LastModifiedUtc":"2016-08-04T12:03:50.2175089Z","DisplayInMemberList":true,"Gender":"","IsLockedOut":false,"LastLoginUtc":"2020-07-23T19:03:28.6847189Z","PhoneNumber":"","PhoneNumberConfirmed":false,"AccountApproved":true,"TimeZoneId":"","WebSiteUrl":""} \ No newline at end of file