diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/AddJsPartial.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/AddJsPartial.cshtml index 4ae9632a..4fbf11b8 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/AddJsPartial.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/AddJsPartial.cshtml @@ -22,5 +22,5 @@ - + diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/Development.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/Development.cshtml index 73dffbe0..3d11b0c9 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/Development.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/Development.cshtml @@ -1,9 +1,33 @@ @model cloudscribe.SimpleContent.Web.ViewModels.PageDevelopmentViewModel @inject IPageRoutes pageRoutes @inject IStringLocalizer sr -

@ViewBag.Title @sr["Cancel"]

-

@sr["With great power comes great responsibility. This page is intended for use by developers, for adding javscript and css into the page. Use this page only if you understand what you are doing."]

-
+
+

@ViewBag.Title

+ @sr["Return to Page Editing"] +
+
+ @sr["With great power comes great responsibility. This page is intended for use by developers, for adding javscript and css into the page. Use this page only if you understand what you are doing."] +
+ +

@sr["Raw JavaScript"]

+
+
+
+
diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditScriptsPartial.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditScriptsPartial.cshtml index b7ba6d74..7d9003f7 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditScriptsPartial.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditScriptsPartial.cshtml @@ -27,4 +27,5 @@ else } } + \ No newline at end of file diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplate.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplate.cshtml index d197bf4c..16dbe6fb 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplate.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplate.cshtml @@ -156,7 +156,7 @@ } @if (showDev) { - @sr["Developer Tools"] + @sr["Developer Tools"] }
diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplateScriptsPartial.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplateScriptsPartial.cshtml index 820168fe..d69fd206 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplateScriptsPartial.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/EditWithTemplateScriptsPartial.cshtml @@ -33,4 +33,5 @@ } + \ No newline at end of file diff --git a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/PageScriptsPartial.cshtml b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/PageScriptsPartial.cshtml index a348ffae..fe751921 100644 --- a/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/PageScriptsPartial.cshtml +++ b/src/cloudscribe.SimpleContent.CompiledViews.Bootstrap5/Views/Page/PageScriptsPartial.cshtml @@ -1,3 +1,8 @@ @model cloudscribe.SimpleContent.Web.ViewModels.PageViewModel + +@if (Model.CurrentPage?.Script != null && !string.IsNullOrWhiteSpace(Model.CurrentPage.Script)) +{ + +} \ No newline at end of file diff --git a/src/cloudscribe.SimpleContent.Models/Blog/Post.cs b/src/cloudscribe.SimpleContent.Models/Blog/Post.cs index f79bfca0..5374bd3f 100644 --- a/src/cloudscribe.SimpleContent.Models/Blog/Post.cs +++ b/src/cloudscribe.SimpleContent.Models/Blog/Post.cs @@ -96,6 +96,6 @@ public static Post FromIPost(IPost post) post.CopyTo(p); return p; } - + public string Script { get; set; } } } diff --git a/src/cloudscribe.SimpleContent.Models/IContentItem.cs b/src/cloudscribe.SimpleContent.Models/IContentItem.cs index 1119f5f4..3a3c31e7 100644 --- a/src/cloudscribe.SimpleContent.Models/IContentItem.cs +++ b/src/cloudscribe.SimpleContent.Models/IContentItem.cs @@ -11,6 +11,6 @@ public interface IContentItem string Content { get; set; } DateTime? PubDate { get; set; } string MetaDescription { get; set; } - + string Script { get; set; } } } diff --git a/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs b/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs index 0962ab93..7e753269 100644 --- a/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs +++ b/src/cloudscribe.SimpleContent.Models/ModelExtensions.cs @@ -310,6 +310,7 @@ public static void CopyTo(this IPage input, IPage target) target.ShowCreatedDate = input.ShowCreatedDate; target.ShowLastModifiedBy = input.ShowLastModifiedBy; target.ShowLastModifiedDate = input.ShowLastModifiedDate; + target.Script = input.Script; } /// diff --git a/src/cloudscribe.SimpleContent.Models/Page/IPage.cs b/src/cloudscribe.SimpleContent.Models/Page/IPage.cs index 78ce9c2c..72a7f8a7 100644 --- a/src/cloudscribe.SimpleContent.Models/Page/IPage.cs +++ b/src/cloudscribe.SimpleContent.Models/Page/IPage.cs @@ -68,5 +68,6 @@ public interface IPage : IContentItem public bool? ShowCreatedDate { get; set; } public bool? ShowLastModifiedBy { get; set; } public bool? ShowLastModifiedDate { get; set; } + public string? Script { get; set; } } } \ No newline at end of file diff --git a/src/cloudscribe.SimpleContent.Models/Page/Page.cs b/src/cloudscribe.SimpleContent.Models/Page/Page.cs index e0635151..7e252eee 100644 --- a/src/cloudscribe.SimpleContent.Models/Page/Page.cs +++ b/src/cloudscribe.SimpleContent.Models/Page/Page.cs @@ -101,5 +101,6 @@ public static Page FromIPage(IPage page) public bool? ShowCreatedDate { get; set; } public bool? ShowLastModifiedBy { get; set; } public bool? ShowLastModifiedDate { get; set; } + public string? Script { get; set; } } } diff --git a/src/cloudscribe.SimpleContent.Models/Page/PageResource.cs b/src/cloudscribe.SimpleContent.Models/Page/PageResource.cs index 84f26443..f862b1af 100644 --- a/src/cloudscribe.SimpleContent.Models/Page/PageResource.cs +++ b/src/cloudscribe.SimpleContent.Models/Page/PageResource.cs @@ -31,7 +31,6 @@ public PageResource() public string Id { get; set; } public string ContentId { get; set; } public int Sort { get; set; } = 1; - public string Type { get; set; } public string Environment { get; set; } public string Url { get; set; } diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageEntity.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageEntity.cs index bdc732b1..02cc3bb3 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageEntity.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageEntity.cs @@ -233,5 +233,6 @@ public static PageEntity FromIPage(IPage page) public bool? ShowCreatedDate { get; set; } public bool? ShowLastModifiedBy { get; set; } public bool? ShowLastModifiedDate { get; set; } + public string Script { get; set; } } } diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageResourceEntity.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageResourceEntity.cs index 6de77246..bf7b4907 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageResourceEntity.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PageResourceEntity.cs @@ -24,9 +24,7 @@ public string PageEntityId get { return pageEntityId; } set { pageEntityId = value; } } - public int Sort { get; set; } = 1; - public string Type { get; set; } public string Environment { get; set; } public string Url { get; set; } diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs index 7e4bfbca..3feae1ad 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.Common/Models/PostEntity.cs @@ -136,6 +136,6 @@ public static PostEntity FromIPost(IPost post) post.CopyTo(p); return p; } - + public string Script { get; set; } } } diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250423093650_user-script-20250423.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250423093650_user-script-20250423.Designer.cs new file mode 100644 index 00000000..2376b7a8 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250423093650_user-script-20250423.Designer.cs @@ -0,0 +1,1015 @@ +// +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; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MSSQL.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250423093650_user-script-20250423")] + partial class userscript20250423 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ArchivedUtc") + .HasColumnType("datetime2"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CategoriesCsv") + .HasColumnType("nvarchar(max)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("nvarchar(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") + .HasMaxLength(100) + .HasColumnType("nvarchar(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") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShowCreatedBy") + .HasColumnType("bit"); + + b.Property("ShowCreatedDate") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("bit"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(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", null, t => + { + t.HasTrigger("cs_ContentHistory_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AboutContent") + .HasColumnType("nvarchar(max)"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("bit"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("bit"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("BlogPagePosition") + .HasColumnType("int"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ChannelTimeToLive") + .HasColumnType("int"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DaysToComment") + .HasColumnType("int"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("bit"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("bit"); + + b.Property("PostsPerPage") + .HasColumnType("int"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("nvarchar(75)"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowCreatedBy") + .HasColumnType("bit"); + + b.Property("ShowCreatedDate") + .HasColumnType("bit"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("bit"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("bit"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowTitle") + .HasColumnType("bit"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("nvarchar(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") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("bit"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject", null, t => + { + t.HasTrigger("cs_ContentProject_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory", null, t => + { + t.HasTrigger("cs_PageCategory_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("bit"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment", null, t => + { + t.HasTrigger("cs_PageComment_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DisableEditor") + .HasColumnType("bit"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DraftPubDate") + .HasColumnType("datetime2"); + + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("MenuOnly") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("Script") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShowCategories") + .HasColumnType("bit"); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("ShowCreatedBy") + .HasColumnType("bit"); + + b.Property("ShowCreatedDate") + .HasColumnType("bit"); + + b.Property("ShowHeading") + .HasColumnType("bit"); + + b.Property("ShowLastModified") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("bit"); + + b.Property("ShowMenu") + .HasColumnType("bit"); + + b.Property("ShowPubDate") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ViewRoles") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page", null, t => + { + t.HasTrigger("cs_Page_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Script") + .HasColumnType("nvarchar(max)"); + + b.Property("Sort") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource", null, t => + { + t.HasTrigger("cs_PageResource_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory", null, t => + { + t.HasTrigger("cs_PostCategory_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("bit"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment", null, t => + { + t.HasTrigger("cs_PostComment_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("AutoTeaser") + .HasColumnType("nvarchar(max)"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DraftPubDate") + .HasColumnType("datetime2"); + + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("IsFeatured") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("Script") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("SuppressTeaser") + .HasColumnType("bit"); + + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post", null, t => + { + t.HasTrigger("cs_Post_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250423093650_user-script-20250423.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250423093650_user-script-20250423.cs new file mode 100644 index 00000000..30e4de2c --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250423093650_user-script-20250423.cs @@ -0,0 +1,48 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MSSQL.Migrations +{ + /// + public partial class userscript20250423 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Post", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_PageResource", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Page", + type: "nvarchar(max)", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Post"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_PageResource"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Page"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250818152838_remove-pageresource-script.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250818152838_remove-pageresource-script.Designer.cs new file mode 100644 index 00000000..397b9d9b --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250818152838_remove-pageresource-script.Designer.cs @@ -0,0 +1,1012 @@ +// +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; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MSSQL.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250818152838_remove-pageresource-script")] + partial class removepageresourcescript + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("uniqueidentifier"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ArchivedUtc") + .HasColumnType("datetime2"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CategoriesCsv") + .HasColumnType("nvarchar(max)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("nvarchar(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") + .HasMaxLength(100) + .HasColumnType("nvarchar(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") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShowCreatedBy") + .HasColumnType("bit"); + + b.Property("ShowCreatedDate") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("bit"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(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", null, t => + { + t.HasTrigger("cs_ContentHistory_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AboutContent") + .HasColumnType("nvarchar(max)"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("bit"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("bit"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("BlogPagePosition") + .HasColumnType("int"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ChannelTimeToLive") + .HasColumnType("int"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DaysToComment") + .HasColumnType("int"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("bit"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("bit"); + + b.Property("PostsPerPage") + .HasColumnType("int"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("nvarchar(75)"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowCreatedBy") + .HasColumnType("bit"); + + b.Property("ShowCreatedDate") + .HasColumnType("bit"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("bit"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("bit"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); + + b.Property("ShowTitle") + .HasColumnType("bit"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("nvarchar(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") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("bit"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject", null, t => + { + t.HasTrigger("cs_ContentProject_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory", null, t => + { + t.HasTrigger("cs_PageCategory_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("bit"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment", null, t => + { + t.HasTrigger("cs_PageComment_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DisableEditor") + .HasColumnType("bit"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DraftPubDate") + .HasColumnType("datetime2"); + + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("MenuOnly") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("Script") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShowCategories") + .HasColumnType("bit"); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("ShowCreatedBy") + .HasColumnType("bit"); + + b.Property("ShowCreatedDate") + .HasColumnType("bit"); + + b.Property("ShowHeading") + .HasColumnType("bit"); + + b.Property("ShowLastModified") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("bit"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("bit"); + + b.Property("ShowMenu") + .HasColumnType("bit"); + + b.Property("ShowPubDate") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ViewRoles") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page", null, t => + { + t.HasTrigger("cs_Page_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Sort") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource", null, t => + { + t.HasTrigger("cs_PageResource_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory", null, t => + { + t.HasTrigger("cs_PostCategory_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("bit"); + + b.Property("IsApproved") + .HasColumnType("bit"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment", null, t => + { + t.HasTrigger("cs_PostComment_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("AutoTeaser") + .HasColumnType("nvarchar(max)"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime2"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DraftContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DraftPubDate") + .HasColumnType("datetime2"); + + b.Property("DraftSerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("IsFeatured") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PubDate") + .HasColumnType("datetime2"); + + b.Property("Script") + .HasColumnType("nvarchar(max)"); + + b.Property("SerializedModel") + .HasColumnType("nvarchar(max)"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("SuppressTeaser") + .HasColumnType("bit"); + + b.Property("TeaserOverride") + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post", null, t => + { + t.HasTrigger("cs_Post_Trigger"); + }); + + b.HasAnnotation("SqlServer:UseSqlOutputClause", false); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250818152838_remove-pageresource-script.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250818152838_remove-pageresource-script.cs new file mode 100644 index 00000000..084117ba --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/20250818152838_remove-pageresource-script.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MSSQL.Migrations +{ + /// + public partial class removepageresourcescript : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Script", + table: "cs_PageResource"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Script", + table: "cs_PageResource", + type: "nvarchar(max)", + nullable: true); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs index 4aaecf54..d9449d8d 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MSSQL/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -626,6 +626,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PubDate") .HasColumnType("datetime2"); + b.Property("Script") + .HasColumnType("nvarchar(max)"); + b.Property("SerializedModel") .HasColumnType("nvarchar(max)"); @@ -913,6 +916,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PubDate") .HasColumnType("datetime2"); + b.Property("Script") + .HasColumnType("nvarchar(max)"); + b.Property("SerializedModel") .HasColumnType("nvarchar(max)"); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250423093954_user-script-20250423.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250423093954_user-script-20250423.Designer.cs new file mode 100644 index 00000000..6247223e --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250423093954_user-script-20250423.Designer.cs @@ -0,0 +1,967 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using cloudscribe.SimpleContent.Storage.EFCore.MySQL; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MySQL.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250423093954_user-script-20250423")] + partial class userscript20250423 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("char(36)"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ArchivedUtc") + .HasColumnType("datetime(6)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CategoriesCsv") + .HasColumnType("longtext"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DraftContent") + .HasColumnType("longtext"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext"); + + b.Property("IsDraftHx") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MetaDescription") + .HasColumnType("longtext"); + + b.Property("MetaHtml") + .HasColumnType("longtext"); + + b.Property("MetaJson") + .HasColumnType("longtext"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("SerializedModel") + .HasColumnType("longtext"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ShowCreatedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowCreatedDate") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("tinyint(1)"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TeaserOverride") + .HasColumnType("longtext"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ViewRoles") + .HasColumnType("longtext"); + + 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", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("AboutContent") + .HasColumnType("longtext"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("tinyint(1)"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("tinyint(1)"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("BlogPagePosition") + .HasColumnType("int"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ChannelTimeToLive") + .HasColumnType("int"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DaysToComment") + .HasColumnType("int"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("tinyint(1)"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("tinyint(1)"); + + b.Property("PostsPerPage") + .HasColumnType("int"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("varchar(75)"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowCreatedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowCreatedDate") + .HasColumnType("tinyint(1)"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("tinyint(1)"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowTitle") + .HasColumnType("tinyint(1)"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("varchar(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") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("tinyint(1)"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DisableEditor") + .HasColumnType("tinyint(1)"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DraftContent") + .HasColumnType("longtext"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("MenuOnly") + .HasColumnType("tinyint(1)"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("longtext"); + + b.Property("MetaJson") + .HasColumnType("longtext"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("Script") + .HasColumnType("longtext"); + + b.Property("SerializedModel") + .HasColumnType("longtext"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ShowCategories") + .HasColumnType("tinyint(1)"); + + b.Property("ShowComments") + .HasColumnType("tinyint(1)"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean"); + + b.Property("ShowHeading") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModified") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean"); + + b.Property("ShowMenu") + .HasColumnType("tinyint(1)"); + + b.Property("ShowPubDate") + .HasColumnType("tinyint(1)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ViewRoles") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("varchar(15)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Script") + .HasColumnType("longtext"); + + b.Property("Sort") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("AutoTeaser") + .HasColumnType("longtext"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DraftContent") + .HasColumnType("longtext"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("IsFeatured") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("longtext"); + + b.Property("MetaJson") + .HasColumnType("longtext"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("Script") + .HasColumnType("longtext"); + + b.Property("SerializedModel") + .HasColumnType("longtext"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("SuppressTeaser") + .HasColumnType("tinyint(1)"); + + b.Property("TeaserOverride") + .HasColumnType("longtext"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post", (string)null); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250423093954_user-script-20250423.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250423093954_user-script-20250423.cs new file mode 100644 index 00000000..096eb522 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250423093954_user-script-20250423.cs @@ -0,0 +1,51 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MySQL.Migrations +{ + /// + public partial class userscript20250423 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Post", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_PageResource", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Page", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Post"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_PageResource"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Page"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250818153349_remove-pageresource-script.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250818153349_remove-pageresource-script.Designer.cs new file mode 100644 index 00000000..ef0f7a6a --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250818153349_remove-pageresource-script.Designer.cs @@ -0,0 +1,964 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using cloudscribe.SimpleContent.Storage.EFCore.MySQL; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MySQL.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250818153349_remove-pageresource-script")] + partial class removepageresourcescript + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("char(36)"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ArchivedUtc") + .HasColumnType("datetime(6)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CategoriesCsv") + .HasColumnType("longtext"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DraftContent") + .HasColumnType("longtext"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext"); + + b.Property("IsDraftHx") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MetaDescription") + .HasColumnType("longtext"); + + b.Property("MetaHtml") + .HasColumnType("longtext"); + + b.Property("MetaJson") + .HasColumnType("longtext"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("SerializedModel") + .HasColumnType("longtext"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ShowCreatedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowCreatedDate") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("tinyint(1)"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TeaserOverride") + .HasColumnType("longtext"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ViewRoles") + .HasColumnType("longtext"); + + 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", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("AboutContent") + .HasColumnType("longtext"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("tinyint(1)"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("tinyint(1)"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("BlogPagePosition") + .HasColumnType("int"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ChannelTimeToLive") + .HasColumnType("int"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DaysToComment") + .HasColumnType("int"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("tinyint(1)"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("tinyint(1)"); + + b.Property("PostsPerPage") + .HasColumnType("int"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("varchar(75)"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowCreatedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowCreatedDate") + .HasColumnType("tinyint(1)"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("tinyint(1)"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("tinyint(1)"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ShowTitle") + .HasColumnType("tinyint(1)"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("varchar(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") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("tinyint(1)"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DisableEditor") + .HasColumnType("tinyint(1)"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DraftContent") + .HasColumnType("longtext"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("MenuOnly") + .HasColumnType("tinyint(1)"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("longtext"); + + b.Property("MetaJson") + .HasColumnType("longtext"); + + b.Property("PageOrder") + .HasColumnType("int"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("Script") + .HasColumnType("longtext"); + + b.Property("SerializedModel") + .HasColumnType("longtext"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ShowCategories") + .HasColumnType("tinyint(1)"); + + b.Property("ShowComments") + .HasColumnType("tinyint(1)"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean"); + + b.Property("ShowHeading") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModified") + .HasColumnType("tinyint(1)"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean"); + + b.Property("ShowMenu") + .HasColumnType("tinyint(1)"); + + b.Property("ShowPubDate") + .HasColumnType("tinyint(1)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ViewRoles") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("varchar(15)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Sort") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("varchar(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("AutoTeaser") + .HasColumnType("longtext"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedUtc") + .HasColumnType("datetime(6)"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DraftContent") + .HasColumnType("longtext"); + + b.Property("DraftPubDate") + .HasColumnType("datetime(6)"); + + b.Property("DraftSerializedModel") + .HasColumnType("longtext"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("IsFeatured") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("varchar(500)"); + + b.Property("MetaHtml") + .HasColumnType("longtext"); + + b.Property("MetaJson") + .HasColumnType("longtext"); + + b.Property("PubDate") + .HasColumnType("datetime(6)"); + + b.Property("Script") + .HasColumnType("longtext"); + + b.Property("SerializedModel") + .HasColumnType("longtext"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ShowComments") + .HasColumnType("bit"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("SuppressTeaser") + .HasColumnType("tinyint(1)"); + + b.Property("TeaserOverride") + .HasColumnType("longtext"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post", (string)null); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250818153349_remove-pageresource-script.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250818153349_remove-pageresource-script.cs new file mode 100644 index 00000000..5438f0bb --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/20250818153349_remove-pageresource-script.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.MySQL.Migrations +{ + /// + public partial class removepageresourcescript : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Script", + table: "cs_PageResource"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Script", + table: "cs_PageResource", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs index fabdc840..475f35ae 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.MySQL/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -603,6 +603,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PubDate") .HasColumnType("datetime(6)"); + b.Property("Script") + .HasColumnType("longtext"); + b.Property("SerializedModel") .HasColumnType("longtext"); @@ -870,6 +873,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PubDate") .HasColumnType("datetime(6)"); + b.Property("Script") + .HasColumnType("longtext"); + b.Property("SerializedModel") .HasColumnType("longtext"); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250423094338_user-script-20250423.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250423094338_user-script-20250423.Designer.cs new file mode 100644 index 00000000..a32c2c77 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250423094338_user-script-20250423.Designer.cs @@ -0,0 +1,1219 @@ +// +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; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250423094338_user-script-20250423")] + partial class userscript20250423 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("archived_by"); + + b.Property("ArchivedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("archived_utc"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("CategoriesCsv") + .HasColumnType("text") + .HasColumnName("categories_csv"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("content_id"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("content_source"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("content_type"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("correlation_key"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("created_by_user"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_utc"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("draft_author"); + + b.Property("DraftContent") + .HasColumnType("text") + .HasColumnName("draft_content"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("draft_pub_date"); + + b.Property("DraftSerializedModel") + .HasColumnType("text") + .HasColumnName("draft_serialized_model"); + + b.Property("IsDraftHx") + .HasColumnType("boolean") + .HasColumnName("is_draft_hx"); + + b.Property("IsPublished") + .HasColumnType("boolean") + .HasColumnName("is_published"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_modified"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("last_modified_by_user"); + + b.Property("MetaDescription") + .HasColumnType("text") + .HasColumnName("meta_description"); + + b.Property("MetaHtml") + .HasColumnType("text") + .HasColumnName("meta_html"); + + b.Property("MetaJson") + .HasColumnType("text") + .HasColumnName("meta_json"); + + b.Property("PageOrder") + .HasColumnType("integer") + .HasColumnName("page_order"); + + b.Property("ParentId") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("parent_id"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("parent_slug"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("SerializedModel") + .HasColumnType("text") + .HasColumnName("serialized_model"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("serializer"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean") + .HasColumnName("show_created_by"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean") + .HasColumnName("show_created_date"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_by"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_date"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug"); + + b.Property("TeaserOverride") + .HasColumnType("text") + .HasColumnName("teaser_override"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("template_key"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.Property("ViewRoles") + .HasColumnType("text") + .HasColumnName("view_roles"); + + b.Property("WasDeleted") + .HasColumnType("boolean") + .HasColumnName("was_deleted"); + + b.HasKey("Id") + .HasName("pk_cs_content_history"); + + b.HasIndex("ContentId") + .HasDatabaseName("ix_cs_content_history_content_id"); + + b.HasIndex("ContentSource") + .HasDatabaseName("ix_cs_content_history_content_source"); + + b.HasIndex("CorrelationKey") + .HasDatabaseName("ix_cs_content_history_correlation_key"); + + b.HasIndex("CreatedByUser") + .HasDatabaseName("ix_cs_content_history_created_by_user"); + + b.HasIndex("LastModifiedByUser") + .HasDatabaseName("ix_cs_content_history_last_modified_by_user"); + + b.HasIndex("Title") + .HasDatabaseName("ix_cs_content_history_title"); + + b.ToTable("cs_content_history", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("id"); + + b.Property("AboutContent") + .HasColumnType("text") + .HasColumnName("about_content"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("about_heading"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("boolean") + .HasColumnName("add_blog_to_pages_tree"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("boolean") + .HasColumnName("blog_menu_links_to_newest_post"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("blog_page_nav_component_visibility"); + + b.Property("BlogPagePosition") + .HasColumnType("integer") + .HasColumnName("blog_page_position"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("blog_page_text"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("cdn_url"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("channel_categories_csv"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("channel_rating"); + + b.Property("ChannelTimeToLive") + .HasColumnType("integer") + .HasColumnName("channel_time_to_live"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("comment_notification_email"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("copyright_notice"); + + b.Property("DaysToComment") + .HasColumnType("integer") + .HasColumnName("days_to_comment"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("default_content_type"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(20) + .HasColumnName("default_feed_items"); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("default_page_slug"); + + b.Property("Description") + .HasColumnType("text") + .HasColumnName("description"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("disqus_short_name"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("facebook_app_id"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("image"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("boolean") + .HasColumnName("include_pub_date_in_post_urls"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("language_code"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("local_media_virtual_path"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("managing_editor_email"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(1000) + .HasColumnName("max_feed_items"); + + b.Property("ModerateComments") + .HasColumnType("boolean") + .HasColumnName("moderate_comments"); + + b.Property("PostsPerPage") + .HasColumnType("integer") + .HasColumnName("posts_per_page"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("character varying(75)") + .HasColumnName("pub_date_format"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("publisher"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("publisher_entity_type"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("publisher_logo_height"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("publisher_logo_url"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("publisher_logo_width"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("recaptcha_private_key"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("recaptcha_public_key"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("remote_feed_processor_use_agent_fragment"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("remote_feed_url"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_about_box"); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_archived_posts"); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_blog_categories"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean") + .HasColumnName("show_created_by"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean") + .HasColumnName("show_created_date"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("boolean") + .HasColumnName("show_featured_posts_on_default_page"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_by"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_date"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("boolean") + .HasColumnName("show_recent_posts_on_default_page"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_related_posts"); + + b.Property("ShowTitle") + .HasColumnType("boolean") + .HasColumnName("show_title"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("site_name"); + + b.Property("TeaserMode") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)0) + .HasColumnName("teaser_mode"); + + b.Property("TeaserTruncationLength") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(20) + .HasColumnName("teaser_truncation_length"); + + b.Property("TeaserTruncationMode") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)0) + .HasColumnName("teaser_truncation_mode"); + + b.Property("TimeZoneId") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("time_zone_id"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("twitter_creator"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("twitter_publisher"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("boolean") + .HasColumnName("use_default_page_as_root_node"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("webmaster_email"); + + b.HasKey("Id") + .HasName("pk_cs_content_project"); + + b.ToTable("cs_content_project", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("value"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("page_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.HasKey("Value", "PageEntityId") + .HasName("pk_cs_page_category"); + + b.HasIndex("PageEntityId") + .HasDatabaseName("ix_cs_page_category_page_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_page_category_project_id"); + + b.HasIndex("Value") + .HasDatabaseName("ix_cs_page_category_value"); + + b.ToTable("cs_page_category", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("email"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("ip"); + + b.Property("IsAdmin") + .HasColumnType("boolean") + .HasColumnName("is_admin"); + + b.Property("IsApproved") + .HasColumnType("boolean") + .HasColumnName("is_approved"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("page_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("user_agent"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("website"); + + b.HasKey("Id") + .HasName("pk_cs_page_comment"); + + b.HasIndex("PageEntityId") + .HasDatabaseName("ix_cs_page_comment_page_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_page_comment_project_id"); + + b.ToTable("cs_page_comment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("categories_csv"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("content_type"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("correlation_key"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("created_by_user"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_utc"); + + b.Property("DisableEditor") + .HasColumnType("boolean") + .HasColumnName("disable_editor"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("draft_author"); + + b.Property("DraftContent") + .HasColumnType("text") + .HasColumnName("draft_content"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("draft_pub_date"); + + b.Property("DraftSerializedModel") + .HasColumnType("text") + .HasColumnName("draft_serialized_model"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("external_url"); + + b.Property("IsPublished") + .HasColumnType("boolean") + .HasColumnName("is_published"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_modified"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("last_modified_by_user"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("menu_filters"); + + b.Property("MenuOnly") + .HasColumnType("boolean") + .HasColumnName("menu_only"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("meta_description"); + + b.Property("MetaHtml") + .HasColumnType("text") + .HasColumnName("meta_html"); + + b.Property("MetaJson") + .HasColumnType("text") + .HasColumnName("meta_json"); + + b.Property("PageOrder") + .HasColumnType("integer") + .HasColumnName("page_order"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("parent_id"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("parent_slug"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("Script") + .HasColumnType("text") + .HasColumnName("script"); + + b.Property("SerializedModel") + .HasColumnType("text") + .HasColumnName("serialized_model"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("serializer"); + + b.Property("ShowCategories") + .HasColumnType("boolean") + .HasColumnName("show_categories"); + + b.Property("ShowComments") + .HasColumnType("boolean") + .HasColumnName("show_comments"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean") + .HasColumnName("show_created_by"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean") + .HasColumnName("show_created_date"); + + b.Property("ShowHeading") + .HasColumnType("boolean") + .HasColumnName("show_heading"); + + b.Property("ShowLastModified") + .HasColumnType("boolean") + .HasColumnName("show_last_modified"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_by"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_date"); + + b.Property("ShowMenu") + .HasColumnType("boolean") + .HasColumnName("show_menu"); + + b.Property("ShowPubDate") + .HasColumnType("boolean") + .HasColumnName("show_pub_date"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("template_key"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.Property("ViewRoles") + .HasColumnType("text") + .HasColumnName("view_roles"); + + b.HasKey("Id") + .HasName("pk_cs_page"); + + b.HasIndex("CorrelationKey") + .HasDatabaseName("ix_cs_page_correlation_key"); + + b.HasIndex("ParentId") + .HasDatabaseName("ix_cs_page_parent_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_page_project_id"); + + b.ToTable("cs_page", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("character varying(15)") + .HasColumnName("environment"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("page_entity_id"); + + b.Property("Script") + .HasColumnType("text") + .HasColumnName("script"); + + b.Property("Sort") + .HasColumnType("integer") + .HasColumnName("sort"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("type"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_cs_page_resource"); + + b.HasIndex("PageEntityId") + .HasDatabaseName("ix_cs_page_resource_page_entity_id"); + + b.ToTable("cs_page_resource", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("value"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("post_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.HasKey("Value", "PostEntityId") + .HasName("pk_cs_post_category"); + + b.HasIndex("PostEntityId") + .HasDatabaseName("ix_cs_post_category_post_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_post_category_project_id"); + + b.HasIndex("Value") + .HasDatabaseName("ix_cs_post_category_value"); + + b.ToTable("cs_post_category", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("email"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("ip"); + + b.Property("IsAdmin") + .HasColumnType("boolean") + .HasColumnName("is_admin"); + + b.Property("IsApproved") + .HasColumnType("boolean") + .HasColumnName("is_approved"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("post_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("user_agent"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("website"); + + b.HasKey("Id") + .HasName("pk_cs_post_comment"); + + b.HasIndex("PostEntityId") + .HasDatabaseName("ix_cs_post_comment_post_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_post_comment_project_id"); + + b.ToTable("cs_post_comment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("AutoTeaser") + .HasColumnType("text") + .HasColumnName("auto_teaser"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("blog_id"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("categories_csv"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("content_type"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("correlation_key"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("created_by_user"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_utc"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("draft_author"); + + b.Property("DraftContent") + .HasColumnType("text") + .HasColumnName("draft_content"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("draft_pub_date"); + + b.Property("DraftSerializedModel") + .HasColumnType("text") + .HasColumnName("draft_serialized_model"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("image_url"); + + b.Property("IsFeatured") + .HasColumnType("boolean") + .HasColumnName("is_featured"); + + b.Property("IsPublished") + .HasColumnType("boolean") + .HasColumnName("is_published"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_modified"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("last_modified_by_user"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("meta_description"); + + b.Property("MetaHtml") + .HasColumnType("text") + .HasColumnName("meta_html"); + + b.Property("MetaJson") + .HasColumnType("text") + .HasColumnName("meta_json"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("Script") + .HasColumnType("text") + .HasColumnName("script"); + + b.Property("SerializedModel") + .HasColumnType("text") + .HasColumnName("serialized_model"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("serializer"); + + b.Property("ShowComments") + .HasColumnType("boolean") + .HasColumnName("show_comments"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug"); + + b.Property("SuppressTeaser") + .HasColumnType("boolean") + .HasColumnName("suppress_teaser"); + + b.Property("TeaserOverride") + .HasColumnType("text") + .HasColumnName("teaser_override"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("template_key"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("thumbnail_url"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.HasKey("Id") + .HasName("pk_cs_post"); + + b.HasIndex("BlogId") + .HasDatabaseName("ix_cs_post_blog_id"); + + b.HasIndex("CorrelationKey") + .HasDatabaseName("ix_cs_post_correlation_key"); + + b.HasIndex("Slug") + .HasDatabaseName("ix_cs_post_slug"); + + b.ToTable("cs_post", (string)null); + }); + + 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) + .HasConstraintName("fk_cs_page_comment_cs_page_page_entity_id"); + }); + + 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) + .HasConstraintName("fk_cs_page_resource_cs_page_page_entity_id"); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250423094338_user-script-20250423.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250423094338_user-script-20250423.cs new file mode 100644 index 00000000..51e026b2 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250423094338_user-script-20250423.cs @@ -0,0 +1,48 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.Migrations +{ + /// + public partial class userscript20250423 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "script", + table: "cs_post", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "script", + table: "cs_page_resource", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "script", + table: "cs_page", + type: "text", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "script", + table: "cs_post"); + + migrationBuilder.DropColumn( + name: "script", + table: "cs_page_resource"); + + migrationBuilder.DropColumn( + name: "script", + table: "cs_page"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250818153117_remove-pageresource-script.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250818153117_remove-pageresource-script.Designer.cs new file mode 100644 index 00000000..b57cd026 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250818153117_remove-pageresource-script.Designer.cs @@ -0,0 +1,1215 @@ +// +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; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250818153117_remove-pageresource-script")] + partial class removepageresourcescript + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("archived_by"); + + b.Property("ArchivedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("archived_utc"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("CategoriesCsv") + .HasColumnType("text") + .HasColumnName("categories_csv"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("content_id"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("content_source"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("content_type"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("correlation_key"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("created_by_user"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_utc"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("draft_author"); + + b.Property("DraftContent") + .HasColumnType("text") + .HasColumnName("draft_content"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("draft_pub_date"); + + b.Property("DraftSerializedModel") + .HasColumnType("text") + .HasColumnName("draft_serialized_model"); + + b.Property("IsDraftHx") + .HasColumnType("boolean") + .HasColumnName("is_draft_hx"); + + b.Property("IsPublished") + .HasColumnType("boolean") + .HasColumnName("is_published"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_modified"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("last_modified_by_user"); + + b.Property("MetaDescription") + .HasColumnType("text") + .HasColumnName("meta_description"); + + b.Property("MetaHtml") + .HasColumnType("text") + .HasColumnName("meta_html"); + + b.Property("MetaJson") + .HasColumnType("text") + .HasColumnName("meta_json"); + + b.Property("PageOrder") + .HasColumnType("integer") + .HasColumnName("page_order"); + + b.Property("ParentId") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("parent_id"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("parent_slug"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("SerializedModel") + .HasColumnType("text") + .HasColumnName("serialized_model"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("serializer"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean") + .HasColumnName("show_created_by"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean") + .HasColumnName("show_created_date"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_by"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_date"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug"); + + b.Property("TeaserOverride") + .HasColumnType("text") + .HasColumnName("teaser_override"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("template_key"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.Property("ViewRoles") + .HasColumnType("text") + .HasColumnName("view_roles"); + + b.Property("WasDeleted") + .HasColumnType("boolean") + .HasColumnName("was_deleted"); + + b.HasKey("Id") + .HasName("pk_cs_content_history"); + + b.HasIndex("ContentId") + .HasDatabaseName("ix_cs_content_history_content_id"); + + b.HasIndex("ContentSource") + .HasDatabaseName("ix_cs_content_history_content_source"); + + b.HasIndex("CorrelationKey") + .HasDatabaseName("ix_cs_content_history_correlation_key"); + + b.HasIndex("CreatedByUser") + .HasDatabaseName("ix_cs_content_history_created_by_user"); + + b.HasIndex("LastModifiedByUser") + .HasDatabaseName("ix_cs_content_history_last_modified_by_user"); + + b.HasIndex("Title") + .HasDatabaseName("ix_cs_content_history_title"); + + b.ToTable("cs_content_history", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("id"); + + b.Property("AboutContent") + .HasColumnType("text") + .HasColumnName("about_content"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("about_heading"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("boolean") + .HasColumnName("add_blog_to_pages_tree"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("boolean") + .HasColumnName("blog_menu_links_to_newest_post"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("blog_page_nav_component_visibility"); + + b.Property("BlogPagePosition") + .HasColumnType("integer") + .HasColumnName("blog_page_position"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("blog_page_text"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("cdn_url"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("channel_categories_csv"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("channel_rating"); + + b.Property("ChannelTimeToLive") + .HasColumnType("integer") + .HasColumnName("channel_time_to_live"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("comment_notification_email"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("copyright_notice"); + + b.Property("DaysToComment") + .HasColumnType("integer") + .HasColumnName("days_to_comment"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("default_content_type"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(20) + .HasColumnName("default_feed_items"); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("default_page_slug"); + + b.Property("Description") + .HasColumnType("text") + .HasColumnName("description"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("disqus_short_name"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("facebook_app_id"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("image"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("boolean") + .HasColumnName("include_pub_date_in_post_urls"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("language_code"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("local_media_virtual_path"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("managing_editor_email"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(1000) + .HasColumnName("max_feed_items"); + + b.Property("ModerateComments") + .HasColumnType("boolean") + .HasColumnName("moderate_comments"); + + b.Property("PostsPerPage") + .HasColumnType("integer") + .HasColumnName("posts_per_page"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("character varying(75)") + .HasColumnName("pub_date_format"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("publisher"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("publisher_entity_type"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("publisher_logo_height"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("publisher_logo_url"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("publisher_logo_width"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("recaptcha_private_key"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("recaptcha_public_key"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("remote_feed_processor_use_agent_fragment"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("remote_feed_url"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_about_box"); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_archived_posts"); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_blog_categories"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean") + .HasColumnName("show_created_by"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean") + .HasColumnName("show_created_date"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("boolean") + .HasColumnName("show_featured_posts_on_default_page"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_by"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_date"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("boolean") + .HasColumnName("show_recent_posts_on_default_page"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("show_related_posts"); + + b.Property("ShowTitle") + .HasColumnType("boolean") + .HasColumnName("show_title"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("character varying(200)") + .HasColumnName("site_name"); + + b.Property("TeaserMode") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)0) + .HasColumnName("teaser_mode"); + + b.Property("TeaserTruncationLength") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(20) + .HasColumnName("teaser_truncation_length"); + + b.Property("TeaserTruncationMode") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)0) + .HasColumnName("teaser_truncation_mode"); + + b.Property("TimeZoneId") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("time_zone_id"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("twitter_creator"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("twitter_publisher"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("boolean") + .HasColumnName("use_default_page_as_root_node"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("webmaster_email"); + + b.HasKey("Id") + .HasName("pk_cs_content_project"); + + b.ToTable("cs_content_project", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("value"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("page_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.HasKey("Value", "PageEntityId") + .HasName("pk_cs_page_category"); + + b.HasIndex("PageEntityId") + .HasDatabaseName("ix_cs_page_category_page_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_page_category_project_id"); + + b.HasIndex("Value") + .HasDatabaseName("ix_cs_page_category_value"); + + b.ToTable("cs_page_category", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("email"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("ip"); + + b.Property("IsAdmin") + .HasColumnType("boolean") + .HasColumnName("is_admin"); + + b.Property("IsApproved") + .HasColumnType("boolean") + .HasColumnName("is_approved"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("page_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("user_agent"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("website"); + + b.HasKey("Id") + .HasName("pk_cs_page_comment"); + + b.HasIndex("PageEntityId") + .HasDatabaseName("ix_cs_page_comment_page_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_page_comment_project_id"); + + b.ToTable("cs_page_comment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("categories_csv"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("content_type"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("correlation_key"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("created_by_user"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_utc"); + + b.Property("DisableEditor") + .HasColumnType("boolean") + .HasColumnName("disable_editor"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("draft_author"); + + b.Property("DraftContent") + .HasColumnType("text") + .HasColumnName("draft_content"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("draft_pub_date"); + + b.Property("DraftSerializedModel") + .HasColumnType("text") + .HasColumnName("draft_serialized_model"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("external_url"); + + b.Property("IsPublished") + .HasColumnType("boolean") + .HasColumnName("is_published"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_modified"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("last_modified_by_user"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("menu_filters"); + + b.Property("MenuOnly") + .HasColumnType("boolean") + .HasColumnName("menu_only"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("meta_description"); + + b.Property("MetaHtml") + .HasColumnType("text") + .HasColumnName("meta_html"); + + b.Property("MetaJson") + .HasColumnType("text") + .HasColumnName("meta_json"); + + b.Property("PageOrder") + .HasColumnType("integer") + .HasColumnName("page_order"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("parent_id"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("parent_slug"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("Script") + .HasColumnType("text") + .HasColumnName("script"); + + b.Property("SerializedModel") + .HasColumnType("text") + .HasColumnName("serialized_model"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("serializer"); + + b.Property("ShowCategories") + .HasColumnType("boolean") + .HasColumnName("show_categories"); + + b.Property("ShowComments") + .HasColumnType("boolean") + .HasColumnName("show_comments"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean") + .HasColumnName("show_created_by"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean") + .HasColumnName("show_created_date"); + + b.Property("ShowHeading") + .HasColumnType("boolean") + .HasColumnName("show_heading"); + + b.Property("ShowLastModified") + .HasColumnType("boolean") + .HasColumnName("show_last_modified"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_by"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean") + .HasColumnName("show_last_modified_date"); + + b.Property("ShowMenu") + .HasColumnType("boolean") + .HasColumnName("show_menu"); + + b.Property("ShowPubDate") + .HasColumnType("boolean") + .HasColumnName("show_pub_date"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("template_key"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.Property("ViewRoles") + .HasColumnType("text") + .HasColumnName("view_roles"); + + b.HasKey("Id") + .HasName("pk_cs_page"); + + b.HasIndex("CorrelationKey") + .HasDatabaseName("ix_cs_page_correlation_key"); + + b.HasIndex("ParentId") + .HasDatabaseName("ix_cs_page_parent_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_page_project_id"); + + b.ToTable("cs_page", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("character varying(15)") + .HasColumnName("environment"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("page_entity_id"); + + b.Property("Sort") + .HasColumnType("integer") + .HasColumnName("sort"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("type"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_cs_page_resource"); + + b.HasIndex("PageEntityId") + .HasDatabaseName("ix_cs_page_resource_page_entity_id"); + + b.ToTable("cs_page_resource", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("value"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("post_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.HasKey("Value", "PostEntityId") + .HasName("pk_cs_post_category"); + + b.HasIndex("PostEntityId") + .HasDatabaseName("ix_cs_post_category_post_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_post_category_project_id"); + + b.HasIndex("Value") + .HasDatabaseName("ix_cs_post_category_value"); + + b.ToTable("cs_post_category", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("email"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("ip"); + + b.Property("IsAdmin") + .HasColumnType("boolean") + .HasColumnName("is_admin"); + + b.Property("IsApproved") + .HasColumnType("boolean") + .HasColumnName("is_approved"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("post_entity_id"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("project_id"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("user_agent"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("website"); + + b.HasKey("Id") + .HasName("pk_cs_post_comment"); + + b.HasIndex("PostEntityId") + .HasDatabaseName("ix_cs_post_comment_post_entity_id"); + + b.HasIndex("ProjectId") + .HasDatabaseName("ix_cs_post_comment_project_id"); + + b.ToTable("cs_post_comment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)") + .HasColumnName("id"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("author"); + + b.Property("AutoTeaser") + .HasColumnType("text") + .HasColumnName("auto_teaser"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("blog_id"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("categories_csv"); + + b.Property("Content") + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html") + .HasColumnName("content_type"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("correlation_key"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("created_by_user"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_utc"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("draft_author"); + + b.Property("DraftContent") + .HasColumnType("text") + .HasColumnName("draft_content"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("draft_pub_date"); + + b.Property("DraftSerializedModel") + .HasColumnType("text") + .HasColumnName("draft_serialized_model"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("image_url"); + + b.Property("IsFeatured") + .HasColumnType("boolean") + .HasColumnName("is_featured"); + + b.Property("IsPublished") + .HasColumnType("boolean") + .HasColumnName("is_published"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_modified"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("last_modified_by_user"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("meta_description"); + + b.Property("MetaHtml") + .HasColumnType("text") + .HasColumnName("meta_html"); + + b.Property("MetaJson") + .HasColumnType("text") + .HasColumnName("meta_json"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("pub_date"); + + b.Property("Script") + .HasColumnType("text") + .HasColumnName("script"); + + b.Property("SerializedModel") + .HasColumnType("text") + .HasColumnName("serialized_model"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("serializer"); + + b.Property("ShowComments") + .HasColumnType("boolean") + .HasColumnName("show_comments"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug"); + + b.Property("SuppressTeaser") + .HasColumnType("boolean") + .HasColumnName("suppress_teaser"); + + b.Property("TeaserOverride") + .HasColumnType("text") + .HasColumnName("teaser_override"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("template_key"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("thumbnail_url"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("title"); + + b.HasKey("Id") + .HasName("pk_cs_post"); + + b.HasIndex("BlogId") + .HasDatabaseName("ix_cs_post_blog_id"); + + b.HasIndex("CorrelationKey") + .HasDatabaseName("ix_cs_post_correlation_key"); + + b.HasIndex("Slug") + .HasDatabaseName("ix_cs_post_slug"); + + b.ToTable("cs_post", (string)null); + }); + + 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) + .HasConstraintName("fk_cs_page_comment_cs_page_page_entity_id"); + }); + + 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) + .HasConstraintName("fk_cs_page_resource_cs_page_page_entity_id"); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250818153117_remove-pageresource-script.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250818153117_remove-pageresource-script.cs new file mode 100644 index 00000000..f17d6e3d --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/20250818153117_remove-pageresource-script.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.PostgreSql.Migrations +{ + /// + public partial class removepageresourcescript : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "script", + table: "cs_page_resource"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "script", + table: "cs_page_resource", + type: "text", + nullable: true); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs index 0ccae7d2..f3044214 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.PostgreSql/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -763,6 +763,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("timestamp with time zone") .HasColumnName("pub_date"); + b.Property("Script") + .HasColumnType("text") + .HasColumnName("script"); + b.Property("SerializedModel") .HasColumnType("text") .HasColumnName("serialized_model"); @@ -1103,6 +1107,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("timestamp with time zone") .HasColumnName("pub_date"); + b.Property("Script") + .HasColumnType("text") + .HasColumnName("script"); + b.Property("SerializedModel") .HasColumnType("text") .HasColumnName("serialized_model"); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250815092116_simplecontent-userscript.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250815092116_simplecontent-userscript.Designer.cs new file mode 100644 index 00000000..154cfe7c --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250815092116_simplecontent-userscript.Designer.cs @@ -0,0 +1,965 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using cloudscribe.SimpleContent.Storage.EFCore.SQLite; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250815092116_simplecontent-userscript")] + partial class simplecontentuserscript + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ArchivedUtc") + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CategoriesCsv") + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + 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") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MetaDescription") + .HasColumnType("TEXT"); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PageOrder") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ShowCreatedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowCreatedDate") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("TeaserOverride") + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + 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", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("AboutContent") + .HasColumnType("TEXT"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("INTEGER"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("INTEGER"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("BlogPagePosition") + .HasColumnType("INTEGER"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("ChannelTimeToLive") + .HasColumnType("INTEGER"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("DaysToComment") + .HasColumnType("INTEGER"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("INTEGER"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("TEXT"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("INTEGER"); + + b.Property("PostsPerPage") + .HasColumnType("INTEGER"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("TEXT"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowCreatedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowCreatedDate") + .HasColumnType("INTEGER"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("INTEGER"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("INTEGER"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowTitle") + .HasColumnType("INTEGER"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + 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") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("INTEGER"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DisableEditor") + .HasColumnType("INTEGER"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("DraftContent") + .HasColumnType("TEXT"); + + b.Property("DraftPubDate") + .HasColumnType("TEXT"); + + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("IsPublished") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("MenuOnly") + .HasColumnType("INTEGER"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PageOrder") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("Script") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ShowCategories") + .HasColumnType("INTEGER"); + + b.Property("ShowComments") + .HasColumnType("INTEGER"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean"); + + b.Property("ShowHeading") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModified") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean"); + + b.Property("ShowMenu") + .HasColumnType("INTEGER"); + + b.Property("ShowPubDate") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ViewRoles") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("TEXT"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Script") + .HasColumnType("TEXT"); + + b.Property("Sort") + .HasColumnType("INTEGER"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("TEXT"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("AutoTeaser") + .HasColumnType("TEXT"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("DraftContent") + .HasColumnType("TEXT"); + + b.Property("DraftPubDate") + .HasColumnType("TEXT"); + + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("TEXT"); + + b.Property("IsFeatured") + .HasColumnType("INTEGER"); + + b.Property("IsPublished") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("Script") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ShowComments") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("SuppressTeaser") + .HasColumnType("INTEGER"); + + b.Property("TeaserOverride") + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("TEXT"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post", (string)null); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250815092116_simplecontent-userscript.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250815092116_simplecontent-userscript.cs new file mode 100644 index 00000000..cc851689 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250815092116_simplecontent-userscript.cs @@ -0,0 +1,48 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations +{ + /// + public partial class simplecontentuserscript : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Post", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_PageResource", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Page", + type: "TEXT", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Post"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_PageResource"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Page"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250818153135_remove-pageresource-script.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250818153135_remove-pageresource-script.Designer.cs new file mode 100644 index 00000000..82e4a1c4 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250818153135_remove-pageresource-script.Designer.cs @@ -0,0 +1,962 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using cloudscribe.SimpleContent.Storage.EFCore.SQLite; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250818153135_remove-pageresource-script")] + partial class removepageresourcescript + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ArchivedUtc") + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CategoriesCsv") + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + 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") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MetaDescription") + .HasColumnType("TEXT"); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PageOrder") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ShowCreatedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowCreatedDate") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("TeaserOverride") + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + 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", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("AboutContent") + .HasColumnType("TEXT"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("INTEGER"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("INTEGER"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("BlogPagePosition") + .HasColumnType("INTEGER"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("ChannelTimeToLive") + .HasColumnType("INTEGER"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("DaysToComment") + .HasColumnType("INTEGER"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("INTEGER"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("TEXT"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("INTEGER"); + + b.Property("PostsPerPage") + .HasColumnType("INTEGER"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("TEXT"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ShowAboutBox") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowArchivedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowBlogCategories") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowCreatedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowCreatedDate") + .HasColumnType("INTEGER"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("INTEGER"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("INTEGER"); + + b.Property("ShowRelatedPosts") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); + + b.Property("ShowTitle") + .HasColumnType("INTEGER"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + 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") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("INTEGER"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DisableEditor") + .HasColumnType("INTEGER"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("DraftContent") + .HasColumnType("TEXT"); + + b.Property("DraftPubDate") + .HasColumnType("TEXT"); + + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("IsPublished") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("MenuOnly") + .HasColumnType("INTEGER"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PageOrder") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("Script") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ShowCategories") + .HasColumnType("INTEGER"); + + b.Property("ShowComments") + .HasColumnType("INTEGER"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean"); + + b.Property("ShowHeading") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModified") + .HasColumnType("INTEGER"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean"); + + b.Property("ShowMenu") + .HasColumnType("INTEGER"); + + b.Property("ShowPubDate") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ViewRoles") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("TEXT"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Sort") + .HasColumnType("INTEGER"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("TEXT"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("TEXT"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("AutoTeaser") + .HasColumnType("TEXT"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("TEXT"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("DraftContent") + .HasColumnType("TEXT"); + + b.Property("DraftPubDate") + .HasColumnType("TEXT"); + + b.Property("DraftSerializedModel") + .HasColumnType("TEXT"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("TEXT"); + + b.Property("IsFeatured") + .HasColumnType("INTEGER"); + + b.Property("IsPublished") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("TEXT"); + + b.Property("MetaHtml") + .HasColumnType("TEXT"); + + b.Property("MetaJson") + .HasColumnType("TEXT"); + + b.Property("PubDate") + .HasColumnType("TEXT"); + + b.Property("Script") + .HasColumnType("TEXT"); + + b.Property("SerializedModel") + .HasColumnType("TEXT"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ShowComments") + .HasColumnType("INTEGER"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("SuppressTeaser") + .HasColumnType("INTEGER"); + + b.Property("TeaserOverride") + .HasColumnType("TEXT"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("TEXT"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post", (string)null); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250818153135_remove-pageresource-script.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250818153135_remove-pageresource-script.cs new file mode 100644 index 00000000..b791c234 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/20250818153135_remove-pageresource-script.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.SQLite.Migrations +{ + /// + public partial class removepageresourcescript : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Script", + table: "cs_PageResource"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Script", + table: "cs_PageResource", + type: "TEXT", + nullable: true); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs index b6e449e7..9dcbc222 100644 --- a/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.SQLite/Migrations/SimpleContentDbContextModelSnapshot.cs @@ -601,6 +601,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PubDate") .HasColumnType("TEXT"); + b.Property("Script") + .HasColumnType("TEXT"); + b.Property("SerializedModel") .HasColumnType("TEXT"); @@ -868,6 +871,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PubDate") .HasColumnType("TEXT"); + b.Property("Script") + .HasColumnType("TEXT"); + b.Property("SerializedModel") .HasColumnType("TEXT"); diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20250423094108_user-script-20250423.Designer.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20250423094108_user-script-20250423.Designer.cs new file mode 100644 index 00000000..790be820 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20250423094108_user-script-20250423.Designer.cs @@ -0,0 +1,962 @@ +// +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; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.pgsql.Migrations +{ + [DbContext(typeof(SimpleContentDbContext))] + [Migration("20250423094108_user-script-20250423")] + partial class userscript20250423 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ContentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasMaxLength(36) + .HasColumnType("uuid"); + + b.Property("ArchivedBy") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ArchivedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CategoriesCsv") + .HasColumnType("text"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("ContentId") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("ContentSource") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("DraftContent") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("DraftSerializedModel") + .HasColumnType("text"); + + b.Property("IsDraftHx") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("MetaDescription") + .HasColumnType("text"); + + b.Property("MetaHtml") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnType("text"); + + b.Property("PageOrder") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ProjectId") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("SerializedModel") + .HasColumnType("text"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean"); + + b.Property("Slug") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("TeaserOverride") + .HasColumnType("text"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(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", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Models.ProjectSettings", b => + { + b.Property("Id") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("AboutContent") + .HasColumnType("text"); + + b.Property("AboutHeading") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("AddBlogToPagesTree") + .HasColumnType("boolean"); + + b.Property("BlogMenuLinksToNewestPost") + .HasColumnType("boolean"); + + b.Property("BlogPageNavComponentVisibility") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("BlogPagePosition") + .HasColumnType("integer"); + + b.Property("BlogPageText") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CdnUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ChannelCategoriesCsv") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ChannelRating") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ChannelTimeToLive") + .HasColumnType("integer"); + + b.Property("CommentNotificationEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CopyrightNotice") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("DaysToComment") + .HasColumnType("integer"); + + b.Property("DefaultContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html"); + + b.Property("DefaultFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(20); + + b.Property("DefaultPageSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisqusShortName") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("FacebookAppId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Image") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("IncludePubDateInPostUrls") + .HasColumnType("boolean"); + + b.Property("LanguageCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("LocalMediaVirtualPath") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ManagingEditorEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("MaxFeedItems") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(1000); + + b.Property("ModerateComments") + .HasColumnType("boolean"); + + b.Property("PostsPerPage") + .HasColumnType("integer"); + + b.Property("PubDateFormat") + .HasMaxLength(75) + .HasColumnType("character varying(75)"); + + b.Property("Publisher") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PublisherEntityType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PublisherLogoHeight") + .HasMaxLength(20) + .HasColumnType("character varying(20)"); + + b.Property("PublisherLogoUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("PublisherLogoWidth") + .HasMaxLength(20) + .HasColumnType("character varying(20)"); + + b.Property("RecaptchaPrivateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("RecaptchaPublicKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("RemoteFeedProcessorUseAgentFragment") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("RemoteFeedUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ShowAboutBox") + .HasColumnType("boolean"); + + b.Property("ShowArchivedPosts") + .HasColumnType("boolean"); + + b.Property("ShowBlogCategories") + .HasColumnType("boolean"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean"); + + b.Property("ShowFeaturedPostsOnDefaultPage") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean"); + + b.Property("ShowRecentPostsOnDefaultPage") + .HasColumnType("boolean"); + + b.Property("ShowRelatedPosts") + .HasColumnType("boolean"); + + b.Property("ShowTitle") + .HasColumnType("boolean"); + + b.Property("SiteName") + .HasMaxLength(200) + .HasColumnType("character varying(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") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("TwitterCreator") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("TwitterPublisher") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UseDefaultPageAsRootNode") + .HasColumnType("boolean"); + + b.Property("WebmasterEmail") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.ToTable("cs_ContentProject", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Value", "PageEntityId"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PageCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsAdmin") + .HasColumnType("boolean"); + + b.Property("IsApproved") + .HasColumnType("boolean"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PageComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DisableEditor") + .HasColumnType("boolean"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("DraftContent") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("DraftSerializedModel") + .HasColumnType("text"); + + b.Property("ExternalUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("MenuFilters") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("MenuOnly") + .HasColumnType("boolean"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("MetaHtml") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnType("text"); + + b.Property("PageOrder") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("ParentSlug") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Script") + .HasColumnType("text"); + + b.Property("SerializedModel") + .HasColumnType("text"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ShowCategories") + .HasColumnType("boolean"); + + b.Property("ShowComments") + .HasColumnType("boolean"); + + b.Property("ShowCreatedBy") + .HasColumnType("boolean"); + + b.Property("ShowCreatedDate") + .HasColumnType("boolean"); + + b.Property("ShowHeading") + .HasColumnType("boolean"); + + b.Property("ShowLastModified") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedBy") + .HasColumnType("boolean"); + + b.Property("ShowLastModifiedDate") + .HasColumnType("boolean"); + + b.Property("ShowMenu") + .HasColumnType("boolean"); + + b.Property("ShowPubDate") + .HasColumnType("boolean"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ViewRoles") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("ParentId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_Page", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageResourceEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("Environment") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("character varying(15)"); + + b.Property("PageEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("Script") + .HasColumnType("text"); + + b.Property("Sort") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.HasIndex("PageEntityId"); + + b.ToTable("cs_PageResource", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostCategory", b => + { + b.Property("Value") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Value", "PostEntityId"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("Value"); + + b.ToTable("cs_PostCategory", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostComment", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Ip") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsAdmin") + .HasColumnType("boolean"); + + b.Property("IsApproved") + .HasColumnType("boolean"); + + b.Property("PostEntityId") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("ProjectId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("UserAgent") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Website") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.HasIndex("PostEntityId"); + + b.HasIndex("ProjectId"); + + b.ToTable("cs_PostComment", (string)null); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Property("Id") + .HasMaxLength(36) + .HasColumnType("character varying(36)"); + + b.Property("Author") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("AutoTeaser") + .HasColumnType("text"); + + b.Property("BlogId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CategoriesCsv") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasDefaultValue("html"); + + b.Property("CorrelationKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("CreatedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DraftAuthor") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("DraftContent") + .HasColumnType("text"); + + b.Property("DraftPubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("DraftSerializedModel") + .HasColumnType("text"); + + b.Property("ImageUrl") + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("IsFeatured") + .HasColumnType("boolean"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LastModifiedByUser") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("MetaDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("MetaHtml") + .HasColumnType("text"); + + b.Property("MetaJson") + .HasColumnType("text"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Script") + .HasColumnType("text"); + + b.Property("SerializedModel") + .HasColumnType("text"); + + b.Property("Serializer") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ShowComments") + .HasColumnType("boolean"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("SuppressTeaser") + .HasColumnType("boolean"); + + b.Property("TeaserOverride") + .HasColumnType("text"); + + b.Property("TemplateKey") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("ThumbnailUrl") + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.HasIndex("CorrelationKey"); + + b.HasIndex("Slug"); + + b.ToTable("cs_Post", (string)null); + }); + + 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"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PageEntity", b => + { + b.Navigation("PageComments"); + + b.Navigation("PageResources"); + }); + + modelBuilder.Entity("cloudscribe.SimpleContent.Storage.EFCore.Models.PostEntity", b => + { + b.Navigation("PostComments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20250423094108_user-script-20250423.cs b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20250423094108_user-script-20250423.cs new file mode 100644 index 00000000..2c34fc16 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Storage.EFCore.pgsql/Migrations/20250423094108_user-script-20250423.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace cloudscribe.SimpleContent.Storage.EFCore.pgsql.Migrations +{ + /// + public partial class userscript20250423 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Post", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_PageResource", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "Script", + table: "cs_Page", + type: "text", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Post"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_PageResource"); + + migrationBuilder.DropColumn( + name: "Script", + table: "cs_Page"); + } + } +} diff --git a/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPage.cs b/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPage.cs index a9b8ff29..1d021568 100644 --- a/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPage.cs +++ b/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPage.cs @@ -149,6 +149,9 @@ public YamlPage() [YamlMember(Order = 43)] public bool? ShowLastModifiedDate { get; set; } + [YamlMember(Order = 44)] + public string Script { get; set; } = string.Empty; + [YamlIgnore] public string Content { get; set; } = string.Empty; [YamlIgnore] diff --git a/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs b/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs index 4875b828..644d57d2 100644 --- a/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs +++ b/src/cloudscribe.SimpleContent.Storage.NoDb/YamlPost.cs @@ -103,8 +103,8 @@ public YamlPost() [YamlMember(Order = 30)] public bool ShowComments { get; set; } = true; - - + [YamlMember(Order = 31)] + public string Script { get; set; } = string.Empty; [YamlIgnore] public List Comments { get; set; } diff --git a/src/cloudscribe.SimpleContent.Web/Controllers/PageController.cs b/src/cloudscribe.SimpleContent.Web/Controllers/PageController.cs index e18b33aa..f2770047 100644 --- a/src/cloudscribe.SimpleContent.Web/Controllers/PageController.cs +++ b/src/cloudscribe.SimpleContent.Web/Controllers/PageController.cs @@ -8,6 +8,7 @@ using cloudscribe.DateTimeUtils; using cloudscribe.SimpleContent.Models; using cloudscribe.SimpleContent.Models.Versioning; +using cloudscribe.SimpleContent.Services; using cloudscribe.SimpleContent.Web.Services; using cloudscribe.SimpleContent.Web.ViewModels; using cloudscribe.Web.Common.Extensions; @@ -19,6 +20,7 @@ using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Org.BouncyCastle.Asn1.Cmp; using System; using System.Collections.Generic; using System.Globalization; @@ -46,7 +48,9 @@ public PageController( IStringLocalizer localizer, ITreeCache treeCache, DraftPublishService draftPublishService, + JsSecuritySanitizer jsSecuritySanitizer, IOptions pageEditOptionsAccessor, + ILogger logger) { Mediator = mediator; @@ -65,6 +69,7 @@ public PageController( StringLocalizer = localizer; NavigationCache = treeCache; DraftPublishService = draftPublishService; + JsSecuritySanitizer = jsSecuritySanitizer; Log = logger; } @@ -85,7 +90,7 @@ public PageController( protected ITreeCache NavigationCache { get; private set; } protected DraftPublishService DraftPublishService { get; private set; } - + public JsSecuritySanitizer JsSecuritySanitizer { get; private set; } protected IMediator Mediator { get; private set; } [HttpHead] @@ -266,7 +271,7 @@ public virtual async Task NewPage( int pageSize = 10 ) { - var editContextRequest = new PageEditContextRequest(User, null, null, null); + var editContextRequest = new PageEditContextRequest(User, null, null, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) @@ -476,7 +481,7 @@ protected virtual async Task EditWithTemplate(CancellationToken c [ValidateAntiForgeryToken] public virtual async Task EditWithTemplate(PageEditWithTemplateViewModel model) { - var editContextRequest = new PageEditContextRequest(User, null, model.Id, null); + var editContextRequest = new PageEditContextRequest(User, null, model.Id, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) @@ -557,7 +562,7 @@ public virtual async Task Edit( Guid? historyId = null ) { - var request = new PageEditContextRequest(User, slug, null, historyId); + var request = new PageEditContextRequest(User, slug, null, null, historyId); var editContext = await Mediator.Send(request); if(!editContext.IsValidRequest) { @@ -715,7 +720,7 @@ public virtual async Task Edit( [ValidateAntiForgeryToken] public virtual async Task Edit(PageEditViewModel model) { - var editContextRequest = new PageEditContextRequest(User, null, model.Id, null); + var editContextRequest = new PageEditContextRequest(User, null, model.Id, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) @@ -805,11 +810,9 @@ public virtual async Task Edit(PageEditViewModel model) [HttpGet] [AllowAnonymous] - public virtual async Task Development( - CancellationToken cancellationToken, - string slug) + public virtual async Task Development(CancellationToken cancellationToken, string slug, string script) { - var editContextRequest = new PageEditContextRequest(User, slug, null, null); + var editContextRequest = new PageEditContextRequest(User, slug, null, script, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -842,9 +845,12 @@ public virtual async Task Development( ViewData["Title"] = string.Format(CultureInfo.CurrentUICulture, StringLocalizer["Developer Tools - {0}"], editContext.CurrentPage.Title); + var invalidScript = TempData["InvalidScript"] as string; + var model = new PageDevelopmentViewModel { - Slug = editContext.CurrentPage.Slug + Slug = editContext.CurrentPage.Slug, + Script = invalidScript ?? editContext.CurrentPage.Script }; model.AddResourceViewModel.Slug = editContext.CurrentPage.Slug; model.Css = editContext.CurrentPage.Resources.Where(x => x.Type == "css").OrderBy(x => x.Sort).ThenBy(x => x.Url).ToList(); @@ -859,7 +865,7 @@ public virtual async Task Development( [ValidateAntiForgeryToken] public virtual async Task AddResource(AddPageResourceViewModel model) { - var editContextRequest = new PageEditContextRequest(User, model.Slug, null, null); + var editContextRequest = new PageEditContextRequest(User, model.Slug, null, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -910,12 +916,91 @@ public virtual async Task AddResource(AddPageResourceViewModel mo return RedirectToRoute(PageRoutes.PageDevelopRouteName, new { slug = editContext.CurrentPage.Slug }); } + [HttpPost] + [AllowAnonymous] + [ValidateAntiForgeryToken] + public virtual async Task AddScriptResource(PageDevelopmentViewModel model) + { + var editContextRequest = new PageEditContextRequest(User, model.Slug, null, model.Script, null); + var editContext = await Mediator.Send(editContextRequest); + var canDev = EditOptions.AlwaysShowDeveloperLink ? true : User.IsInRole(EditOptions.DeveloperAllowedRole); + + if (!editContext.IsValidRequest) + { + Log.LogInformation("redirecting to index because project settings not found"); + return RedirectToRoute(PageRoutes.PageRouteName, new { slug = "" }); + } + + if (!canDev) + { + Log.LogInformation("redirecting to index because user is not allowed by edit config for developer tools"); + return RedirectToRoute(PageRoutes.PageRouteName); + } + + if (editContext.CurrentPage == null) + { + Log.LogInformation("page not found, redirecting"); + return RedirectToRoute(PageRoutes.PageRouteName, new { slug = "" }); + } + + if (!string.IsNullOrEmpty(editContext.CurrentPage.ViewRoles)) + { + if (!User.IsInRoles(editContext.CurrentPage.ViewRoles)) + { + Log.LogWarning($"page {editContext.CurrentPage.Title} is protected by roles that user is not in so redirecting"); + return RedirectToRoute(PageRoutes.PageRouteName, new { slug = "" }); + } + } + + // Allow empty script to clear/remove existing script + if (string.IsNullOrEmpty(model.Script)) + { + editContext.CurrentPage.Script = null; // Clear the script + await PageService.Update(editContext.CurrentPage); + this.AlertSuccess(StringLocalizer["Script cleared successfully"], true); + return RedirectToRoute(PageRoutes.PageDevelopRouteName, new { slug = editContext.CurrentPage.Slug }); + } + + // Trim whitespace before validation + model.Script = model.Script.Trim(); + + if (!model.Script.EndsWith(';')) + { + this.AlertDanger(StringLocalizer["Scripts should end with a semicolon"], true); + // Preserve the invalid script so user doesn't lose their work + TempData["InvalidScript"] = model.Script; + return RedirectToRoute(PageRoutes.PageDevelopRouteName, new { slug = editContext.CurrentPage.Slug }); + } + + // Validate script security before saving + var sanitizer = new JsSecuritySanitizer(); + if (!sanitizer.IsSafe(model.Script, out var issues)) + { + var errorMessage = $"Script blocked due to security violations: {string.Join(", ", issues)}"; // too helpful?! + // var errorMessage = $"Script blocked due to security violations - check the log for details"; + this.AlertDanger(StringLocalizer[errorMessage], true); + Log.LogWarning("Unsafe user-defined script blocked for page " + (editContext.CurrentPage.Slug ?? editContext.CurrentPage.Id) + " : " + string.Join(", ", issues)); + + // Preserve the invalid script so user doesn't lose their work + TempData["InvalidScript"] = model.Script; + return RedirectToRoute(PageRoutes.PageDevelopRouteName, new { slug = editContext.CurrentPage.Slug }); + } + + editContext.CurrentPage.Script = model.Script; + + await PageService.Update(editContext.CurrentPage); + + this.AlertSuccess(StringLocalizer["Script saved successfully"], true); + + return RedirectToRoute(PageRoutes.PageDevelopRouteName, new { slug = editContext.CurrentPage.Slug }); + } + [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public virtual async Task RemoveResource(string slug, string id) { - var editContextRequest = new PageEditContextRequest(User, slug, null, null); + var editContextRequest = new PageEditContextRequest(User, slug, null, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -976,7 +1061,7 @@ public virtual async Task RemoveResource(string slug, string id) [ValidateAntiForgeryToken] public virtual async Task Delete(string id) { - var editContextRequest = new PageEditContextRequest(User, null, id, null); + var editContextRequest = new PageEditContextRequest(User, null, id, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -1065,7 +1150,7 @@ public virtual async Task UnPublish(string id) return RedirectToRoute(PageRoutes.PageRouteName, new { slug = "" }); } - var editContextRequest = new PageEditContextRequest(User, null, id, null); + var editContextRequest = new PageEditContextRequest(User, null, id, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -1140,7 +1225,7 @@ public virtual async Task UnPublish(string id) [ValidateAntiForgeryToken] public async Task DeleteHistoryOlderThan(string id, int days) { - var editContextRequest = new PageEditContextRequest(User, null, id, null); + var editContextRequest = new PageEditContextRequest(User, null, id, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -1177,7 +1262,7 @@ public virtual IActionResult SiteMap() public virtual async Task Tree() { - var editContextRequest = new PageEditContextRequest(User, null, null, null); + var editContextRequest = new PageEditContextRequest(User, null, null, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -1204,7 +1289,7 @@ public virtual async Task Tree() [AllowAnonymous] public virtual async Task TreeJson(CancellationToken cancellationToken, string node = "root") { - var editContextRequest = new PageEditContextRequest(User, null, null, null); + var editContextRequest = new PageEditContextRequest(User, null, null, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -1244,7 +1329,7 @@ public virtual async Task Move(PageMoveModel model) return BadRequest(); } - var editContextRequest = new PageEditContextRequest(User, null, null, null); + var editContextRequest = new PageEditContextRequest(User, null, null, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -1263,7 +1348,7 @@ public virtual async Task Move(PageMoveModel model) [ValidateAntiForgeryToken] public virtual async Task SortChildPagesAlpha(string pageId) { - var editContextRequest = new PageEditContextRequest(User, null, null, null); + var editContextRequest = new PageEditContextRequest(User, null, null, null, null); var editContext = await Mediator.Send(editContextRequest); if (!editContext.IsValidRequest) { @@ -1433,5 +1518,54 @@ public virtual async Task CanEdit(CancellationToken cancellationT } return showItems; } + + [HttpGet] + [AllowAnonymous] + public async Task InlineScript(string pageId) + { + if (string.IsNullOrWhiteSpace(pageId)) + { + return NoContent(); + } + + IPage page = await PageService.GetPage(pageId); + + if (page?.Script == null) + { + return NoContent(); // HTTP 204 + } + + if (string.IsNullOrWhiteSpace(page.Script)) + { + return NoContent(); + } + + var sanitizer = new JsSecuritySanitizer(); + + if (!sanitizer.IsSafe(page.Script, out var issues)) + { + Log.LogWarning("Unsafe user-defined script blocked on page " + (page.Slug ?? pageId) + " : " + string.Join(", ", issues)); + + // Return a more helpful error message for developers + var errorScript = $"console.warn('Script blocked due to security violations: {string.Join(", ", issues)}');"; + return Content(errorScript, "application/javascript"); + } + + // Add caching headers for performance + var etag = $"\"{page.Id}-{page.LastModified.Ticks}\""; + Response.Headers["ETag"] = etag; + Response.Headers["Cache-Control"] = "public, max-age=3600"; // Cache for 1 hour + + // Check if client has cached version + if (Request.Headers.IfNoneMatch == etag) + { + return StatusCode(304); // Not Modified + } + + // Improved CSP header - less restrictive but still secure + Response.Headers["Content-Security-Policy"] = "script-src 'self'; object-src 'none';"; + + return Content(page.Script, "application/javascript"); + } } } diff --git a/src/cloudscribe.SimpleContent.Web/Services/Page/JsSecuritySanitizer.cs b/src/cloudscribe.SimpleContent.Web/Services/Page/JsSecuritySanitizer.cs new file mode 100644 index 00000000..174e6119 --- /dev/null +++ b/src/cloudscribe.SimpleContent.Web/Services/Page/JsSecuritySanitizer.cs @@ -0,0 +1,132 @@ + +//This product includes software developed by Sebastien Ros and contributors (https://github.com/sebastienros/esprima-dotnet). + +//Esprima.NET is licensed under the BSD 2-Clause License: + +//Copyright(c) 2014, Sebastien Ros +//All rights reserved. + +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions are met: + +//1.Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. + +//2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. + +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +//ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +//LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +//INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. + + +using Esprima; +using Esprima.Ast; +using System.Collections.Generic; + +namespace cloudscribe.SimpleContent.Web.Services +{ + public class JsSecuritySanitizer + { + private static readonly HashSet DangerousCalls = new() + { + "eval", // Executes arbitrary strings as code + "Function", // Creates functions from strings (like eval) + "setTimeout", // Often used with string eval + "setInterval", // Same + "execScript", // IE-specific eval alternative + // "alert", // Common in test payloads (may remove if just for dev) + "confirm", // Can be used to trick users + "prompt", // Same + "fetch", // Sends data out + "XMLHttpRequest", // Same + "open", // Opens new windows/tabs + "showModalDialog", // Obsolete, but sometimes used for phishing + "postMessage", // Can be abused for cross-origin data leaks + "webkitRequestFullscreen", // Abused for phishing + "requestFullscreen", // Tricking users + "requestPointerLock", // Locking pointer as part of scams + }; + + private static readonly HashSet DangerousProperties = new() + { + "document.cookie", // Accesses user's cookies + "window.location", // Can redirect user or steal location + "location.href", // Commonly set to redirect + "document.location", // Same + "window.name", // Used to pass data between domains + "localStorage", // Persistent local storage + "sessionStorage", // Session-scoped storage + "indexedDB", // DB access + "navigator.geolocation", // Gets user location + "navigator.clipboard", // Read/write clipboard + "navigator.sendBeacon", // Sends data after page unload + "navigator.mediaDevices", // Webcam/mic access + "window.parent", // Cross-frame manipulation + "window.top", // Can break out of iframes + "window.opener", // Can hijack the opener page + "window.history", // Modify browser history + }; + + public bool IsSafe(string script, out List issues) + { + issues = new List(); + + try + { + var parser = new JavaScriptParser(); + var program = parser.ParseScript(script); + + TraverseNode(program, issues); + return issues.Count == 0; + } + catch (ParserException ex) + { + issues.Add($"Parsing error: {ex.Message}"); + return false; + } + } + + private void TraverseNode(Node node, List issues) + { + if (node == null) return; + + // Check for dangerous function calls + if (node is CallExpression callExpr) + { + if (callExpr.Callee is Identifier ident && + DangerousCalls.Contains(ident.Name)) + { + issues.Add($"Call to disallowed function: {ident.Name}"); + } + } + + // Check for dangerous property access like window.location or document.cookie + if (node is MemberExpression memberExpr && + memberExpr.Object is Identifier obj && + memberExpr.Property is Identifier prop) + { + string fullAccess = $"{obj.Name}.{prop.Name}"; + if (DangerousProperties.Contains(fullAccess)) + { + issues.Add($"Access to disallowed property: {fullAccess}"); + } + } + + // Recursively walk all child nodes + foreach (var child in node.ChildNodes) + { + TraverseNode(child, issues); + } + } + } +} diff --git a/src/cloudscribe.SimpleContent.Web/Services/Page/PageEditContextRequest.cs b/src/cloudscribe.SimpleContent.Web/Services/Page/PageEditContextRequest.cs index 84714755..9363450f 100644 --- a/src/cloudscribe.SimpleContent.Web/Services/Page/PageEditContextRequest.cs +++ b/src/cloudscribe.SimpleContent.Web/Services/Page/PageEditContextRequest.cs @@ -10,6 +10,7 @@ public PageEditContextRequest( ClaimsPrincipal user, string slug, string pageId, + string script, Guid? historyId ) { @@ -17,10 +18,12 @@ public PageEditContextRequest( Slug = slug; PageId = pageId; HistoryId = historyId; + Script = script; } public ClaimsPrincipal User { get; private set; } public string Slug { get; private set; } + public string Script { get; private set; } public string PageId { get; private set; } public Guid? HistoryId { get; private set; } } diff --git a/src/cloudscribe.SimpleContent.Web/StartupExtensions.cs b/src/cloudscribe.SimpleContent.Web/StartupExtensions.cs index 26b79a9c..af525d5c 100644 --- a/src/cloudscribe.SimpleContent.Web/StartupExtensions.cs +++ b/src/cloudscribe.SimpleContent.Web/StartupExtensions.cs @@ -36,6 +36,7 @@ IConfiguration configuration services.TryAddScoped(); services.AddScoped(); + services.AddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); diff --git a/src/cloudscribe.SimpleContent.Web/ViewModels/AddPageResourceViewModel.cs b/src/cloudscribe.SimpleContent.Web/ViewModels/AddPageResourceViewModel.cs index 0748d4d6..05506779 100644 --- a/src/cloudscribe.SimpleContent.Web/ViewModels/AddPageResourceViewModel.cs +++ b/src/cloudscribe.SimpleContent.Web/ViewModels/AddPageResourceViewModel.cs @@ -19,4 +19,5 @@ public class AddPageResourceViewModel [RegularExpression(@"^(http(s)?://)?(\/?)[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-‌​\.\?\,\'\/\\\+&%\$#_]*)?$", ErrorMessage ="Please provide a valid url or relative url")] public string Url { get; set; } } + } diff --git a/src/cloudscribe.SimpleContent.Web/ViewModels/PageDevelopmentViewModel.cs b/src/cloudscribe.SimpleContent.Web/ViewModels/PageDevelopmentViewModel.cs index 34f81924..6589125a 100644 --- a/src/cloudscribe.SimpleContent.Web/ViewModels/PageDevelopmentViewModel.cs +++ b/src/cloudscribe.SimpleContent.Web/ViewModels/PageDevelopmentViewModel.cs @@ -13,12 +13,10 @@ public PageDevelopmentViewModel() } public string Slug { get; set; } = string.Empty; - + public string Script { get; set; } = string.Empty; public List Css { get; set; } public List Js { get; set; } public AddPageResourceViewModel AddResourceViewModel { get; set; } - - } } diff --git a/src/cloudscribe.SimpleContent.Web/ViewModels/PageEditViewModel.cs b/src/cloudscribe.SimpleContent.Web/ViewModels/PageEditViewModel.cs index d957a06e..87621036 100644 --- a/src/cloudscribe.SimpleContent.Web/ViewModels/PageEditViewModel.cs +++ b/src/cloudscribe.SimpleContent.Web/ViewModels/PageEditViewModel.cs @@ -80,5 +80,6 @@ public PageEditViewModel() public bool? ShowCreatedDate { get; set; } public bool? ShowLastModifiedBy { get; set; } public bool? ShowLastModifiedDate { get; set; } + public string? Script { get; set; } } } diff --git a/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj b/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj index f54ea2ed..b4f4abbc 100644 --- a/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj +++ b/src/cloudscribe.SimpleContent.Web/cloudscribe.SimpleContent.Web.csproj @@ -58,6 +58,8 @@ + + diff --git a/src/cloudscribe.SimpleContent.Web/js/unsaved-changes-warning.js b/src/cloudscribe.SimpleContent.Web/js/unsaved-changes-warning.js new file mode 100644 index 00000000..1874532c --- /dev/null +++ b/src/cloudscribe.SimpleContent.Web/js/unsaved-changes-warning.js @@ -0,0 +1,67 @@ +// Unsaved changes warning for Summernote editor +(function() { + 'use strict'; + + let summernoteChanged = false; + + // Wait for DOM to be ready + document.addEventListener('DOMContentLoaded', function() { + // Find all Summernote textareas + const summernoteTextareas = document.querySelectorAll('[data-summernote-unobtrusive]'); + if (summernoteTextareas.length === 0) { + return; // No Summernote on this page + } + + // Wait for Summernote to initialize (it's loaded asynchronously) + const checkSummernote = setInterval(function() { + if (typeof $ !== 'undefined' && $.fn.summernote) { + // Check if all Summernote instances are initialized + let allInitialized = true; + summernoteTextareas.forEach(function(textarea) { + if (!$(textarea).data('summernote')) { + allInitialized = false; + } + }); + + if (allInitialized) { + clearInterval(checkSummernote); + + // Listen for Summernote change events on all instances + summernoteTextareas.forEach(function(textarea) { + $(textarea).on('summernote.change', function() { + summernoteChanged = true; + }); + }); + + // Find Developer Tools link + const devToolsLink = document.querySelector('a[data-unsaved-warning]'); + if (devToolsLink) { + devToolsLink.addEventListener('click', function(e) { + if (summernoteChanged) { + const warningText = devToolsLink.getAttribute('data-unsaved-warning') || 'You have unsaved changes in the editor. Are you sure you want to navigate to Developer Tools? Your changes will be lost.'; + const confirmLeave = confirm(warningText); + if (!confirmLeave) { + e.preventDefault(); + return false; + } + } + }); + } + + // Reset the flag when form is submitted successfully + const form = document.querySelector('form[data-submit-once="true"]'); + if (form) { + form.addEventListener('submit', function() { + summernoteChanged = false; + }); + } + } + } + }, 100); + + // Stop checking after 10 seconds (failsafe) + setTimeout(function() { + clearInterval(checkSummernote); + }, 10000); + }); +})(); \ No newline at end of file diff --git a/src/sourceDev.WebApp/GlobalResources/SimpleContent.en-US.resx b/src/sourceDev.WebApp/GlobalResources/SimpleContent.en-US.resx index ecdf16b1..f6e2a28c 100644 --- a/src/sourceDev.WebApp/GlobalResources/SimpleContent.en-US.resx +++ b/src/sourceDev.WebApp/GlobalResources/SimpleContent.en-US.resx @@ -585,4 +585,70 @@ Show / hide the following information below the main content of pages (site default). + + You have unsaved changes in the editor. Are you sure you want to navigate to Developer Tools? Your changes will be lost. + + + Raw JavaScript + + + Enter your JavaScript below. Do not include script tags. + + + Scripts are automatically validated for security - only safe DOM manipulation and event handling are permitted. + + + Enter custom Javascript to run on your page. Do not include script tags. + + + Save JavaScript + + + JavaScript URLs + + + CSS URLs + + + Return to Page Editing + + + Creator Twitter Handle + + + Date Required + + + Description + + + Disable HTML Editor + + + Publish Later: + + + Publish Now + + + Publisher Twitter Handle + + + Save Draft + + + Site Name + + + To publish later you must enter a date. + + + Version History + + + Script saved successfully + + + Script cleared successfully + \ No newline at end of file diff --git a/src/sourceDev.WebApp/GlobalResources/SimpleContent.resx b/src/sourceDev.WebApp/GlobalResources/SimpleContent.resx new file mode 100644 index 00000000..f6e2a28c --- /dev/null +++ b/src/sourceDev.WebApp/GlobalResources/SimpleContent.resx @@ -0,0 +1,654 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + A comma separated list of navigation component filter names used to filter the blog out of the menu. Leave this blank so the blog menu item is not filtered from any of the menu views. There are some standard filter names like topnav and breadcrumbs but it is also possible to use custom names with custom views. As soon as you populate this field it becomes filtered to only show the blog menu item in the included views, whereas blank means unfiltered. + + + About me + + + Add Blog To Menu + + + Add CSS Url + + + Add Javascript Url + + + Add the blog as a top level menu item. There are multiple other ways of adding the blog to the menu. You can make a page that links to /blog or it can be done from the navigation.xml file. If you see it in the menu more than once it means you have multiple ways it is configured to be added. + + + Any + + + Archives + + + Are you sure you want to delete the post {0}? You cannot undo this action. + + + Author + + + Blog Menu Links To Newest Post + + + Blog Menu Position + + + Blog Page Menu Text + + + Blog Page Menu Visibility + + + Blog Page Title + + + Cancel + + + Categories + + + Comma Separated Channel Categories + + + Comment Notification Email + + + Comments + + + Content + + + Content Index + + + Correlation Key + + + Date Format + + + Days To Comment + + + Default Page + + + Delete + + + Developer Tools - {0} + + + Development + + + Disqus Short Name + + + Edit + + + Edit - {0} + + + Environment + + + Feedburner Url + + + Home + + + If checked the blog menu item will link to the most recent post instead of the post list. + + + If checked will show the blog title and description at the top of the post list. + + + Image Path + + + Include Date In Post Urls + + + Invalid request + + + Is Published + + + Language Code + + + Managing Editor Email + + + Meta Description + + + Moderate Comments + + + New Page + + + New Post + + + Next Post + + + Note that since this page has an override url, the menu item will link to the url so the page is used only as a means to add a link in the menu, the content is not used. + + + Number of posts to show per page on the post list. + + + On public pages, meta description is very important to search engines. It should be no longer than 135 – 160 characters long (although Google has recently been testing longer snippets). Any longer and search engines will chop the end off, so make sure any important keywords are nearer the front. + + + Organization + + + Page Management + + + Person + + + Please enter a valid e-mail address + + + Posted in: + + + Posts Per Page + + + Previous Post + + + Production + + + Provide your Disqus site name aka short name to use Disqus instead of the internal comment system. Highly recommended. + + + Publication Date + + + Publisher + + + Publisher Logo Height + + + Publisher Logo Url + + + Publisher Logo Width + + + Publisher Type + + + Save + + + Script + + + Show Blog Title and Description + + + Show Recent Posts on Default Page + + + Slug + + + slug is already in use. + + + Sort + + + The description also is used as the channel description in the RSS feed. + + + The page was created successfully. + + + The page was updated successfully. + + + The position of the blog within the top level menu. + + + This is used in meta data, see http://schema.org/logo. + + + This is used in meta data, see http://schema.org/publisher. + + + This setting only applies to using the internal comment system, it does not impact Disqus comments. + + + Title + + + Url + + + Use Meta Description In Feed + + + Webmaster Email + + + With great power comes great responsibility. This page is intended for use by developers, for adding javscript and css into the page. Use this page only if you understand what you are doing. + + + A page becomes a child page of another page if you enter the slug of the other page as the parent slug. The menu hierarchy is determined by the parent child relationship between pages. If you enter an invalid parent slug it will be ignored but will not cause any error. You can also manage the hierarchy from the Page Manager. + + + A page is visible to the public if the Is Published checkbox is checked and if the Publication Date is before the current moment, and if not protected by roles. + + + Are you sure you want to delete the page {0}? + + + Are you sure you want to delete the page {0}? You cannot undo this action. + + + Are you sure you want to move the page {0} {1} {2}? + + + Are you sure you want to sort the child pages of {0} alphabetically? + + + Bad Request + + + Check this box if the current page is only meant as a parent container for other pages and has no content of it's own. + + + Developer Tools + + + Edit Page + + + Enable Comments + + + Forbidden + + + If the page is a parent of other pages, you check this box to make it show a menu of links to the child pages. + + + If you populate this field with an url then the page is used only as a means to add the url as a menu item. The page content in that case is not used or visible to users. You can use a relative url or a fully qualified url so it can link to external sites. Use this with caution and note that once populated the only way to edit the page is from the link in Page Manager. + + + Leave blank to include this page in all menu views. A comma separated list of menu filter names can be used to filter the page out of the various menu views. For example enter breadcrumbs to leave a page out of other views but keep it in breadcrumbs. Standard menu filter names include: topnav,breadcrumbs,childtree + + + Leave View Roles blank for public pages. You can put comma separated role names here to make a page visible only to users who are role members. + + + Manage Page Hierarchy + + + Menu Filters + + + New Child Page + + + New Root Level Page + + + No Content Only Show Child Menu + + + No Pages Found + + + No pages have been created yet, if this is your site, please login to create your first page + + + On most pages you will prbably want the page heading to show, but maybe not on the home page. If unchecked then the page heading will not be shown. + + + Override Url + + + Page Heading + + + Page Not Found + + + Page Order + + + Parent Slug + + + Select Roles + + + Settings + + + Show Child Menu + + + Show Heading + + + Site Home + + + Sorry, but the page requires authentication. + + + Sorry, but the page you were looking for can't be found. + + + Sorry, but you don't have permission to access this page. + + + Sort Child Pages Alpha + + + The page {0} has child pages, if you delete it, all of the child pages will become root level pages. You should delete child pages before deleting the parent page. Are you sure you want to delete {1}? + + + This is the heading and title of the page. For new pages the url slug will be generated based on the title. + + + This is the sort order of this page within it's subtree of the menu. You can also move pages around easily from Page Manager, which will update the page order. + + + Unauthorized + + + Unexpected Error + + + View + + + View Roles + + + Well, this is embarrassing. An error occurred while processing your request. Rest assured, this problem has been logged and hamsters have been released to fix the problem. + + + You can drag and drop page nodes in the treeview below to move them around in the site hierarchy or to change their sort position. Click on a page to show a menu of commands related to that page. Note that changes will not be reflected in the main menu until you refresh the page. + + + Your browser sent a request that this server could not understand. + + + Content Settings + + + Content Settings were successfully updated. + + + Image Url + + + Is Featured + + + Thumbnail Url + + + Show Featured Posts on Default Page + + + Featured Posts + + + Recent Posts + + + If checked will show the blog categories in the side bar + + + If checked will show the blog archives in the side bar + + + Show the blog categories in the side bar + + + Show the blog archives in the side bar + + + Created + + + Created By + + + Last Updated + + + Updated + + + Updated By + + + Show Created By + + + Show Created Date + + + Show Last Modified By + + + Show Last Modified Date + + + Show / hide the following information below the main content of the page. + + + Show / hide the following information below the main content of pages (site default). + + + You have unsaved changes in the editor. Are you sure you want to navigate to Developer Tools? Your changes will be lost. + + + Raw JavaScript + + + Enter your JavaScript below. Do not include script tags. + + + Scripts are automatically validated for security - only safe DOM manipulation and event handling are permitted. + + + Enter custom Javascript to run on your page. Do not include script tags. + + + Save JavaScript + + + JavaScript URLs + + + CSS URLs + + + Return to Page Editing + + + Creator Twitter Handle + + + Date Required + + + Description + + + Disable HTML Editor + + + Publish Later: + + + Publish Now + + + Publisher Twitter Handle + + + Save Draft + + + Site Name + + + To publish later you must enter a date. + + + Version History + + + Script saved successfully + + + Script cleared successfully + + \ No newline at end of file diff --git a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/2c945759-1c3b-43ac-bf4b-241082ee6166.json b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/2c945759-1c3b-43ac-bf4b-241082ee6166.json index c76ed8ca..290a65ff 100644 --- a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/2c945759-1c3b-43ac-bf4b-241082ee6166.json +++ b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/2c945759-1c3b-43ac-bf4b-241082ee6166.json @@ -1 +1 @@ -{"Id":"2c945759-1c3b-43ac-bf4b-241082ee6166","ProjectId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","ParentId":"0","ParentSlug":"","PageOrder":3,"Title":"About","Author":"","Slug":"about","ExternalUrl":null,"CorrelationKey":null,"MetaDescription":"meta meta meta","MetaJson":null,"MetaHtml":null,"Content":"

This could be an about page couldn't it so be true

\r\n\r\n

\"snow

\r\n\r\n

can we edit here then can we go to the beach or something

\r\n\r\n

what about pix and stuff

\r\n","PubDate":"2016-02-24T18:00:00Z","LastModified":"2018-02-05T21:36:50.1081798Z","IsPublished":true,"MenuOnly":false,"ShowMenu":false,"ViewRoles":null,"Categories":[],"Comments":[],"ShowHeading":true,"ShowPubDate":false,"ShowCategories":false,"ShowComments":false,"MenuFilters":null,"DisableEditor":false,"Resources":[],"ContentType":"html"} \ No newline at end of file +{"Id":"2c945759-1c3b-43ac-bf4b-241082ee6166","ProjectId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","ParentId":"0","ParentSlug":"","PageOrder":3,"Title":"About","Author":"","Slug":"about","ExternalUrl":null,"CorrelationKey":null,"MetaDescription":"meta meta meta","MetaJson":null,"MetaHtml":null,"Content":"

This could be an about page couldn't it so be true

\r\n\r\n

\"snow

\r\n\r\n

can we edit here then can we go to the beach or something

\r\n\r\n

what about pix and stuff

\r\n","PubDate":"2016-02-24T18:00:00Z","LastModified":"2025-01-24T14:30:46.8912066Z","IsPublished":true,"MenuOnly":false,"ShowMenu":false,"ViewRoles":null,"Categories":[],"Comments":[],"ShowHeading":true,"ShowPubDate":false,"ShowLastModified":false,"ShowCategories":false,"ShowComments":false,"MenuFilters":null,"DisableEditor":false,"Resources":[],"ContentType":"html","CreatedUtc":"2025-01-24T10:28:53.2710158Z","CreatedByUser":null,"LastModifiedByUser":null,"DraftContent":null,"DraftAuthor":null,"DraftPubDate":null,"TemplateKey":null,"SerializedModel":null,"DraftSerializedModel":null,"Serializer":null,"ShowCreatedBy":null,"ShowCreatedDate":null,"ShowLastModifiedBy":null,"ShowLastModifiedDate":null,"Script":"alert(\"hi\");\r\nalert(\"there\");"} \ No newline at end of file diff --git a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/869cf304-6409-4b4d-880a-a6aa00c37075.json b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/869cf304-6409-4b4d-880a-a6aa00c37075.json index c244210d..ed044624 100644 --- a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/869cf304-6409-4b4d-880a-a6aa00c37075.json +++ b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/869cf304-6409-4b4d-880a-a6aa00c37075.json @@ -1 +1 @@ -{"Id":"869cf304-6409-4b4d-880a-a6aa00c37075","ProjectId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","ParentId":"0","ParentSlug":"","PageOrder":3,"Title":"Home","Author":"Admin","Slug":"home","ExternalUrl":null,"CorrelationKey":null,"MetaDescription":null,"MetaJson":null,"MetaHtml":null,"Content":"

Welcome Home!

\r\n\r\n

This is the home page!

\r\n","PubDate":"2017-03-10T18:40:00Z","LastModified":"2024-12-06T10:52:44.2801681Z","IsPublished":true,"MenuOnly":false,"ShowMenu":false,"ViewRoles":null,"Categories":[],"Comments":[],"ShowHeading":true,"ShowPubDate":false,"ShowLastModified":false,"ShowCategories":false,"ShowComments":false,"MenuFilters":null,"DisableEditor":false,"Resources":[],"ContentType":"html","CreatedUtc":"2022-01-25T13:46:15.8644194Z","CreatedByUser":null,"LastModifiedByUser":"admin","DraftContent":null,"DraftAuthor":null,"DraftPubDate":null,"TemplateKey":null,"SerializedModel":null,"DraftSerializedModel":null,"Serializer":null,"ShowCreatedBy":null,"ShowCreatedDate":null,"ShowLastModifiedBy":null,"ShowLastModifiedDate":null} \ No newline at end of file +{"Id":"869cf304-6409-4b4d-880a-a6aa00c37075","ProjectId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","ParentId":"0","ParentSlug":"","PageOrder":3,"Title":"Home","Author":"Admin","Slug":"home","ExternalUrl":null,"CorrelationKey":null,"MetaDescription":null,"MetaJson":null,"MetaHtml":null,"Content":"

Welcome Home!

\r\n\r\n

This is the home page!

\r\n","PubDate":"2017-03-10T18:40:00Z","LastModified":"2025-01-24T10:25:42.5017972Z","IsPublished":true,"MenuOnly":false,"ShowMenu":false,"ViewRoles":null,"Categories":[],"Comments":[],"ShowHeading":true,"ShowPubDate":false,"ShowLastModified":false,"ShowCategories":false,"ShowComments":false,"MenuFilters":null,"DisableEditor":false,"Resources":[{"Id":"2adbc417-b75c-4a6f-a2f0-4f14e53958da","ContentId":null,"Sort":1,"Type":null,"Environment":null,"Url":null,"Script":"alert(\"hello\");"},{"Id":"735a6240-aceb-4e58-a8d2-e3844126e468","ContentId":"869cf304-6409-4b4d-880a-a6aa00c37075","Sort":1,"Type":null,"Environment":null,"Url":null,"Script":"test"}],"ContentType":"html","CreatedUtc":"2022-01-25T13:46:15.8644194Z","CreatedByUser":null,"LastModifiedByUser":"admin","DraftContent":null,"DraftAuthor":null,"DraftPubDate":null,"TemplateKey":null,"SerializedModel":null,"DraftSerializedModel":null,"Serializer":null,"ShowCreatedBy":null,"ShowCreatedDate":null,"ShowLastModifiedBy":null,"ShowLastModifiedDate":null,"Script":null} \ No newline at end of file diff --git a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/test-2.json b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/test-2.json index 2ac93f7d..1ee7fe99 100644 --- a/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/test-2.json +++ b/src/sourceDev.WebApp/nodb_storage/projects/f83067b4-919d-4910-acd1-4b3b1c210ecf/page/test-2.json @@ -1 +1 @@ -{"Id":"test-2","ProjectId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","ParentId":"0","ParentSlug":"","PageOrder":23,"Title":"test 123","Author":"Admin","Slug":"test-2","ExternalUrl":null,"CorrelationKey":null,"MetaDescription":null,"MetaJson":null,"MetaHtml":null,"Content":"

testing, testing, 123

\r\n","PubDate":"2024-12-13T08:56:01.33245Z","LastModified":"2024-12-13T08:56:21.0955713Z","IsPublished":true,"MenuOnly":false,"ShowMenu":false,"ViewRoles":null,"Categories":[],"Comments":[],"ShowHeading":true,"ShowPubDate":false,"ShowLastModified":false,"ShowCategories":false,"ShowComments":false,"MenuFilters":null,"DisableEditor":false,"Resources":[],"ContentType":"html","CreatedUtc":"2024-12-13T08:56:01.3305956Z","CreatedByUser":"admin","LastModifiedByUser":"admin","DraftContent":null,"DraftAuthor":null,"DraftPubDate":null,"TemplateKey":null,"SerializedModel":null,"DraftSerializedModel":null,"Serializer":null,"ShowCreatedBy":null,"ShowCreatedDate":null,"ShowLastModifiedBy":null,"ShowLastModifiedDate":null} \ No newline at end of file +{"Id":"test-2","ProjectId":"f83067b4-919d-4910-acd1-4b3b1c210ecf","ParentId":"0","ParentSlug":"","PageOrder":23,"Title":"test 123","Author":"Admin","Slug":"test-2","ExternalUrl":null,"CorrelationKey":null,"MetaDescription":null,"MetaJson":null,"MetaHtml":null,"Content":"

testing, testing, 123

\r\n","PubDate":"2024-12-13T08:56:01.33245Z","LastModified":"2024-12-13T13:19:29.3497448Z","IsPublished":true,"MenuOnly":false,"ShowMenu":false,"ViewRoles":null,"Categories":[],"Comments":[],"ShowHeading":true,"ShowPubDate":false,"ShowLastModified":false,"ShowCategories":false,"ShowComments":false,"MenuFilters":null,"DisableEditor":false,"Resources":[{"Id":"4e561963-aa91-4c28-908e-4e22ab89a1b3","ContentId":null,"Sort":1,"Type":null,"Environment":null,"Url":null,"Script":null}],"ContentType":"html","CreatedUtc":"2024-12-13T08:56:01.3305956Z","CreatedByUser":"admin","LastModifiedByUser":"admin","DraftContent":null,"DraftAuthor":null,"DraftPubDate":null,"TemplateKey":null,"SerializedModel":null,"DraftSerializedModel":null,"Serializer":null,"ShowCreatedBy":null,"ShowCreatedDate":null,"ShowLastModifiedBy":null,"ShowLastModifiedDate":null,"Script":null} \ No newline at end of file