//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyWebLog.Data;
#nullable disable
namespace MyWebLog.Data.Migrations
{
[DbContext(typeof(WebLogDbContext))]
partial class WebLogDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.2");
modelBuilder.Entity("CategoryPost", b =>
{
b.Property("CategoriesId")
.HasColumnType("TEXT");
b.Property("PostsId")
.HasColumnType("TEXT");
b.HasKey("CategoriesId", "PostsId");
b.HasIndex("PostsId");
b.ToTable("CategoryPost");
});
modelBuilder.Entity("MyWebLog.Data.Category", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Description")
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("ParentId")
.HasColumnType("TEXT");
b.Property("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ParentId");
b.HasIndex("Slug");
b.ToTable("Category");
});
modelBuilder.Entity("MyWebLog.Data.Comment", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("Email")
.IsRequired()
.HasColumnType("TEXT");
b.Property("InReplyToId")
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PostId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PostedOn")
.HasColumnType("TEXT");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("Text")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Url")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("InReplyToId");
b.HasIndex("PostId");
b.ToTable("Comment");
});
modelBuilder.Entity("MyWebLog.Data.Page", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("AuthorId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Permalink")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PublishedOn")
.HasColumnType("TEXT");
b.Property("ShowInPageList")
.HasColumnType("INTEGER");
b.Property("Template")
.HasColumnType("TEXT");
b.Property("Text")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Title")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("AuthorId");
b.HasIndex("Permalink");
b.ToTable("Page");
});
modelBuilder.Entity("MyWebLog.Data.PagePermalink", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("PageId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Url")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("PageId");
b.ToTable("PagePermalink");
});
modelBuilder.Entity("MyWebLog.Data.PageRevision", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("AsOf")
.HasColumnType("TEXT");
b.Property("PageId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("SourceType")
.HasColumnType("INTEGER");
b.Property("Text")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("PageId");
b.ToTable("PageRevision");
});
modelBuilder.Entity("MyWebLog.Data.Post", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("AuthorId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Permalink")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PublishedOn")
.HasColumnType("TEXT");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("Text")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Title")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("AuthorId");
b.HasIndex("Permalink");
b.ToTable("Post");
});
modelBuilder.Entity("MyWebLog.Data.PostPermalink", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("PostId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Url")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("PostId");
b.ToTable("PostPermalink");
});
modelBuilder.Entity("MyWebLog.Data.PostRevision", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("AsOf")
.HasColumnType("TEXT");
b.Property("PostId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("SourceType")
.HasColumnType("INTEGER");
b.Property("Text")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("PostId");
b.ToTable("PostRevision");
});
modelBuilder.Entity("MyWebLog.Data.Tag", b =>
{
b.Property("Name")
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("Tag");
});
modelBuilder.Entity("MyWebLog.Data.WebLogDetails", b =>
{
b.Property("Name")
.HasColumnType("TEXT");
b.Property("DefaultPage")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PostsPerPage")
.HasColumnType("INTEGER");
b.Property("Subtitle")
.HasColumnType("TEXT");
b.Property("ThemePath")
.IsRequired()
.HasColumnType("TEXT");
b.Property("TimeZone")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UrlBase")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("WebLogDetails");
});
modelBuilder.Entity("MyWebLog.Data.WebLogUser", b =>
{
b.Property("Id")
.HasColumnType("TEXT");
b.Property("AuthorizationLevel")
.HasColumnType("INTEGER");
b.Property("FirstName")
.IsRequired()
.HasColumnType("TEXT");
b.Property("LastName")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PasswordHash")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PreferredName")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Salt")
.HasColumnType("TEXT");
b.Property("Url")
.HasColumnType("TEXT");
b.Property("UserName")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("WebLogUser");
});
modelBuilder.Entity("PostTag", b =>
{
b.Property("PostsId")
.HasColumnType("TEXT");
b.Property("TagsName")
.HasColumnType("TEXT");
b.HasKey("PostsId", "TagsName");
b.HasIndex("TagsName");
b.ToTable("PostTag");
});
modelBuilder.Entity("CategoryPost", b =>
{
b.HasOne("MyWebLog.Data.Category", null)
.WithMany()
.HasForeignKey("CategoriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyWebLog.Data.Post", null)
.WithMany()
.HasForeignKey("PostsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("MyWebLog.Data.Category", b =>
{
b.HasOne("MyWebLog.Data.Category", "Parent")
.WithMany()
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("MyWebLog.Data.Comment", b =>
{
b.HasOne("MyWebLog.Data.Comment", "InReplyTo")
.WithMany()
.HasForeignKey("InReplyToId");
b.HasOne("MyWebLog.Data.Post", "Post")
.WithMany()
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InReplyTo");
b.Navigation("Post");
});
modelBuilder.Entity("MyWebLog.Data.Page", b =>
{
b.HasOne("MyWebLog.Data.WebLogUser", "Author")
.WithMany("Pages")
.HasForeignKey("AuthorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Author");
});
modelBuilder.Entity("MyWebLog.Data.PagePermalink", b =>
{
b.HasOne("MyWebLog.Data.Page", "Page")
.WithMany("PriorPermalinks")
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Page");
});
modelBuilder.Entity("MyWebLog.Data.PageRevision", b =>
{
b.HasOne("MyWebLog.Data.Page", "Page")
.WithMany("Revisions")
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Page");
});
modelBuilder.Entity("MyWebLog.Data.Post", b =>
{
b.HasOne("MyWebLog.Data.WebLogUser", "Author")
.WithMany("Posts")
.HasForeignKey("AuthorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Author");
});
modelBuilder.Entity("MyWebLog.Data.PostPermalink", b =>
{
b.HasOne("MyWebLog.Data.Post", "Post")
.WithMany("PriorPermalinks")
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Post");
});
modelBuilder.Entity("MyWebLog.Data.PostRevision", b =>
{
b.HasOne("MyWebLog.Data.Post", "Post")
.WithMany("Revisions")
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Post");
});
modelBuilder.Entity("PostTag", b =>
{
b.HasOne("MyWebLog.Data.Post", null)
.WithMany()
.HasForeignKey("PostsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyWebLog.Data.Tag", null)
.WithMany()
.HasForeignKey("TagsName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("MyWebLog.Data.Page", b =>
{
b.Navigation("PriorPermalinks");
b.Navigation("Revisions");
});
modelBuilder.Entity("MyWebLog.Data.Post", b =>
{
b.Navigation("PriorPermalinks");
b.Navigation("Revisions");
});
modelBuilder.Entity("MyWebLog.Data.WebLogUser", b =>
{
b.Navigation("Pages");
b.Navigation("Posts");
});
#pragma warning restore 612, 618
}
}
}