refactor Blog module

pull/3432/head
Alper Ebicoglu 6 years ago
parent e73f9e10df
commit e52b3a48e5

@ -0,0 +1,926 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.BloggingTestApp.EntityFrameworkCore;
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
[DbContext(typeof(BloggingTestAppDbContext))]
[Migration("20200402110128_Added_Post_Description")]
partial class Added_Post_Description
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Description")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Regex")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("RegexDescription")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("AbpClaimTypes");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault")
.HasColumnType("bit");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic")
.HasColumnType("bit");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("NormalizedName");
b.ToTable("AbpRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AbpRoleClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd()
.HasColumnName("AccessFailedCount")
.HasColumnType("int")
.HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("Name")
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnName("NormalizedUserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("PasswordHash")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnName("SecurityStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("TwoFactorEnabled")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("Email");
b.HasIndex("NormalizedEmail");
b.HasIndex("NormalizedUserName");
b.HasIndex("UserName");
b.ToTable("AbpUsers");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AbpUserClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("nvarchar(196)")
.HasMaxLength(196);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "LoginProvider");
b.HasIndex("LoginProvider", "ProviderKey");
b.ToTable("AbpUserLogins");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId", "UserId");
b.ToTable("AbpUserRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("Name")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AbpUserTokens");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(2048)")
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ShortName")
.IsRequired()
.HasColumnName("ShortName")
.HasColumnType("nvarchar(32)")
.HasMaxLength(32);
b.HasKey("Id");
b.ToTable("BlgBlogs");
});
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("PostId")
.HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("RepliedCommentId")
.HasColumnName("RepliedCommentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Text")
.IsRequired()
.HasColumnName("Text")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.HasKey("Id");
b.HasIndex("PostId");
b.HasIndex("RepliedCommentId");
b.ToTable("BlgComments");
});
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId")
.HasColumnName("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Content")
.HasColumnName("Content")
.HasColumnType("nvarchar(max)")
.HasMaxLength(1048576);
b.Property<string>("CoverImage")
.IsRequired()
.HasColumnName("CoverImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(1000)")
.HasMaxLength(1000);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<int>("ReadCount")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("Url")
.IsRequired()
.HasColumnName("Url")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("BlogId");
b.ToTable("BlgPosts");
});
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.Property<Guid>("PostId")
.HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("TagId")
.HasColumnName("TagId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.HasKey("PostId", "TagId");
b.HasIndex("TagId");
b.ToTable("BlgPostTags");
});
modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<int>("UsageCount")
.HasColumnName("UsageCount")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("BlgTags");
});
modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.HasKey("Id");
b.ToTable("BlgUsers");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany()
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Comments.Comment", null)
.WithMany()
.HasForeignKey("RepliedCommentId");
});
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.HasOne("Volo.Blogging.Blogs.Blog", null)
.WithMany()
.HasForeignKey("BlogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany("Tags")
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Tagging.Tag", null)
.WithMany()
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,138 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
public partial class Added_Post_Description : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "BlgUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "BlgPosts",
maxLength: 1000,
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedEmail",
table: "AbpUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "IsDeleted",
table: "AbpUsers",
nullable: false,
defaultValue: false,
oldClrType: typeof(bool));
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "AbpUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
maxLength: 256,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "AbpClaimTypes",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Description",
table: "BlgPosts");
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "AbpClaimTypes");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "AbpClaimTypes");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "BlgUsers",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "NormalizedEmail",
table: "AbpUsers",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<bool>(
name: "IsDeleted",
table: "AbpUsers",
nullable: false,
oldClrType: typeof(bool),
oldDefaultValue: false);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "AbpUsers",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
}
}
}

@ -15,33 +15,52 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("ProductVersion", "3.1.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Description")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<bool>("IsStatic");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Regex")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("RegexDescription")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<bool>("Required");
b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<int>("ValueType");
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
@ -51,31 +70,45 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault");
.HasColumnName("IsDefault")
.HasColumnType("bit");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic");
.HasColumnName("IsPublic")
.HasColumnType("bit");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic");
.HasColumnName("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
@ -87,18 +120,23 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<Guid>("RoleId");
b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
@ -110,97 +148,133 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd()
.HasColumnName("AccessFailedCount")
.HasColumnType("int")
.HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("Name")
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnName("NormalizedUserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("PasswordHash")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnName("SecurityStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("TwoFactorEnabled")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.HasKey("Id");
@ -219,18 +293,23 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("UserId");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
@ -241,19 +320,25 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.Property<Guid>("UserId");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("nvarchar(196)")
.HasMaxLength(196);
b.Property<Guid?>("TenantId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "LoginProvider");
@ -264,11 +349,15 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("RoleId");
b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "RoleId");
@ -279,17 +368,23 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.Property<Guid>("UserId");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("Name")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<Guid?>("TenantId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Value");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
@ -299,21 +394,27 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
@ -325,20 +426,25 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(2048)")
.HasMaxLength(2048);
b.HasKey("Id");
@ -351,48 +457,63 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ShortName")
.IsRequired()
.HasColumnName("ShortName")
.HasColumnType("nvarchar(32)")
.HasMaxLength(32);
b.HasKey("Id");
@ -403,45 +524,60 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("PostId")
.HasColumnName("PostId");
.HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("RepliedCommentId")
.HasColumnName("RepliedCommentId");
.HasColumnName("RepliedCommentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Text")
.IsRequired()
.HasColumnName("Text")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.HasKey("Id");
@ -456,57 +592,80 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId")
.HasColumnName("BlogId");
.HasColumnName("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Content")
.HasColumnName("Content")
.HasColumnType("nvarchar(max)")
.HasMaxLength(1048576);
b.Property<string>("CoverImage")
.IsRequired()
.HasColumnName("CoverImage");
.HasColumnName("CoverImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(1000)")
.HasMaxLength(1000);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<int>("ReadCount");
b.Property<int>("ReadCount")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("Url")
.IsRequired()
.HasColumnName("Url")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.HasKey("Id");
@ -519,14 +678,20 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.Property<Guid>("PostId")
.HasColumnName("PostId");
.HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("TagId")
.HasColumnName("TagId");
.HasColumnName("TagId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.HasKey("PostId", "TagId");
@ -538,49 +703,65 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId");
b.Property<Guid>("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<int>("UsageCount")
.HasColumnName("UsageCount");
.HasColumnName("UsageCount")
.HasColumnType("int");
b.HasKey("Id");
@ -590,45 +771,59 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.HasKey("Id");
@ -638,80 +833,90 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Abp.Identity.IdentityUser")
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.HasOne("Volo.Blogging.Posts.Post")
b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany()
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Comments.Comment")
b.HasOne("Volo.Blogging.Comments.Comment", null)
.WithMany()
.HasForeignKey("RepliedCommentId");
});
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.HasOne("Volo.Blogging.Blogs.Blog")
b.HasOne("Volo.Blogging.Blogs.Blog", null)
.WithMany()
.HasForeignKey("BlogId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.HasOne("Volo.Blogging.Posts.Post")
b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany("Tags")
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Tagging.Tag")
b.HasOne("Volo.Blogging.Tagging.Tag", null)
.WithMany()
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>
@ -17,8 +18,8 @@
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.2"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.2"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.2" />
</ItemGroup>
<ItemGroup>

@ -10,5 +10,8 @@
public const int MaxDescriptionLength = 1000;
public const int MaxTitleLengthToBeSeoFriendly = 60;
public const int MaxSeoFriendlyDescriptionLength = 200;
}
}

@ -1,6 +1,7 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor
@using Volo.Blogging.Pages.Blog.Posts
@using Volo.Blogging.Posts
@model EditModel
@inherits Volo.Blogging.Pages.Blog.BloggingPage
@{
@ -27,7 +28,11 @@
<form method="post" id="edit-post-form">
<abp-input asp-for="Post.Title" auto-focus="true" />
<abp-alert dismissible="true" style="display: none" id="title-length-warning">
<abp-alert
dismissible="true"
style="display: none"
id="title-length-warning"
data-max-length="@PostConsts.MaxTitleLengthToBeSeoFriendly">
@L["TitleLengthWarning"]
</abp-alert>

@ -42,7 +42,7 @@ namespace Volo.Blogging.Pages.Blog.Posts
var postDto = await _postAppService.GetAsync(new Guid(PostId));
Post = ObjectMapper.Map<PostWithDetailsDto, EditPostViewModel>(postDto);
Post.Tags = String.Join(", ", postDto.Tags.Select(p=>p.Name).ToArray());
Post.Tags = String.Join(", ", postDto.Tags.Select(p => p.Name).ToArray());
return Page();
}
@ -57,7 +57,9 @@ namespace Volo.Blogging.Pages.Blog.Posts
CoverImage = Post.CoverImage,
Content = Post.Content,
Tags = Post.Tags,
Description = !Post.Description.IsNullOrWhiteSpace() ? Post.Description : Post.Content.Substring(0,200)
Description = Post.Description.IsNullOrEmpty() ?
Post.Content.Truncate(PostConsts.MaxSeoFriendlyDescriptionLength) :
Post.Description
};
var editedPost = await _postAppService.UpdateAsync(Post.Id, post);

@ -1,6 +1,7 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor
@using Volo.Blogging.Pages.Blog.Posts
@using Volo.Blogging.Posts
@model NewModel
@inherits Volo.Blogging.Pages.Blog.BloggingPage
@{
@ -27,8 +28,11 @@
<form method="post" id="new-post-form">
<abp-input asp-for="Post.BlogId" />
<abp-input asp-for="Post.Title" auto-focus="true" />
<abp-alert dismissible="true" style="display: none" id="title-length-warning">
<abp-alert dismissible="true"
style="display: none"
id="title-length-warning"
data-max-length="@PostConsts.MaxTitleLengthToBeSeoFriendly">
@L["TitleLengthWarning"]
</abp-alert>
@ -78,7 +82,7 @@
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>

@ -55,12 +55,12 @@ namespace Volo.Blogging.Pages.Blog.Posts
{
var blog = await _blogAppService.GetAsync(Post.BlogId);
if (Post.Description == null)
if (string.IsNullOrEmpty(Post.Description))
{
Post.Description = Post.Content.Substring(0, 200);
Post.Description = Post.Content.Truncate(PostConsts.MaxSeoFriendlyDescriptionLength);
}
var postWithDetailsDto = await _postAppService.CreateAsync(ObjectMapper.Map<CreatePostViewModel,CreatePostDto>(Post));
var postWithDetailsDto = await _postAppService.CreateAsync(ObjectMapper.Map<CreatePostViewModel, CreatePostDto>(Post));
//TODO: Try Url.Page(...)
var urlPrefix = _blogOptions.RoutePrefix;

@ -5,11 +5,18 @@
var $submitButton = $container.find("button[type=submit]");
var $form = $container.find("form#edit-post-form");
var editorDataKey = "tuiEditor";
var maxTitleLength = 60;
var $titleLengthWarning = $("#title-length-warning");
var maxTitleLength = parseInt($titleLengthWarning.data("max-length"));
var $title = $('#Post_Title');
var $coverImage = $("#CoverImage");
var $postCoverImage = $('#Post_CoverImage');
var $coverImageFile = $('#CoverImageFile');
var setCoverImage = function (file) {
$('#Post_CoverImage').val(file.fileUrl);
$("#CoverImage").attr("src", file.fileUrl);
$postCoverImage.val(file.fileUrl);
$coverImage.attr("src", file.fileUrl);
};
var uploadCoverImage = function (file) {
@ -29,26 +36,27 @@
};
var checkTitleLength = function () {
var title = $('#Post_Title').val();
var title = $title.val();
if (title.length > maxTitleLength) {
$("#title-length-warning").css("display", "block");
$titleLengthWarning.show();
} else {
$("#title-length-warning").css("display", "none");
$titleLengthWarning.hide();
}
};
checkTitleLength();
$('#Post_Title').on("change paste keyup", function () {
$title.on("change paste keyup", function () {
checkTitleLength();
});
$('#CoverImageFile').change(function () {
if (!$('#CoverImageFile').prop('files').length) {
$coverImageFile.change(function () {
if (!$coverImageFile.prop('files').length) {
return;
}
var file = $('#CoverImageFile').prop('files')[0];
var file = $coverImageFile.prop('files')[0];
uploadCoverImage(file);
});
@ -110,6 +118,7 @@
$submitButton.buttonBusy();
$(this).off('submit').submit();
return true;
});
});

@ -5,12 +5,18 @@
var $submitButton = $container.find("button[type=submit]");
var $form = $container.find("form#new-post-form");
var editorDataKey = "tuiEditor";
var maxTitleLength = 60;
var $titleLengthWarning = $("#title-length-warning");
var maxTitleLength = parseInt($titleLengthWarning.data("max-length"));
var $title = $('#Post_Title');
var $url = $('#Post_Url');
var $coverImage = $("#CoverImage");
var $postCoverImage = $('#Post_CoverImage');
var $coverImageFile = $('#CoverImageFile');
var setCoverImage = function (file) {
$('#Post_CoverImage').val(file.fileUrl);
$("#CoverImage").attr("src", file.fileUrl);
$("#CoverImage").show();
$postCoverImage.val(file.fileUrl);
$coverImage.attr("src", file.fileUrl);
$coverImage.show();
};
var uploadCoverImage = function (file) {
@ -29,11 +35,11 @@
});
};
$('#CoverImageFile').change(function () {
if (!$('#CoverImageFile').prop('files').length) {
$coverImageFile.change(function () {
if (!$coverImageFile.prop('files').length) {
return;
}
var file = $('#CoverImageFile').prop('files')[0];
var file = $coverImageFile.prop('files')[0];
uploadCoverImage(file);
});
@ -41,7 +47,7 @@
var formData = new FormData();
formData.append('file', file);
$.ajax({
$.ajax({
type: "POST",
url: "/api/blogging/files/images/upload",
data: formData,
@ -93,35 +99,36 @@
$submitButton.buttonBusy();
$(this).off('submit').submit();
return true;
});
var urlEdited = false;
var reflectedChange = false;
$('#Post_Title').on("change paste keyup", function () {
$title.on("change paste keyup", function () {
if (urlEdited) {
return;
}
var title = $('#Post_Title').val();
var title = $title.val();
if (title.length > maxTitleLength) {
$("#title-length-warning").css("display", "block");
$titleLengthWarning.show();
} else {
$("#title-length-warning").css("display", "none");
$titleLengthWarning.hide();
}
title = title.replace(' ', '-');
title = title.replace(new RegExp(' ', 'g'), '-');
reflectedChange = true;
$('#Post_Url').val(title);
$url.val(title);
reflectedChange = false;
});
$('#Post_Url').change(function () {
$url.change(function () {
if (!reflectedChange) {
urlEdited = true;
}
});
});
});
Loading…
Cancel
Save