//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NetinaCMS.Repository.Models;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace HamyanEdalat.Repository.Migrations
{
[DbContext(typeof(ApplicationContext))]
partial class ApplicationContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("public")
.HasAnnotation("ProductVersion", "8.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.Blog", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CategoryId")
.HasColumnType("uuid");
b.Property("Content")
.IsRequired()
.HasColumnType("text");
b.Property("CreatedAt")
.HasColumnType("timestamp without time zone");
b.Property("CreatedBy")
.HasColumnType("text");
b.Property("IsRemoved")
.HasColumnType("boolean");
b.Property("IsSuggested")
.HasColumnType("boolean");
b.Property("ModifiedAt")
.HasColumnType("timestamp without time zone");
b.Property("ModifiedBy")
.HasColumnType("text");
b.Property("ReadingTime")
.HasColumnType("integer");
b.Property("RemovedAt")
.HasColumnType("timestamp without time zone");
b.Property("RemovedBy")
.HasColumnType("text");
b.Property("Summery")
.IsRequired()
.HasColumnType("text");
b.Property("Tags")
.IsRequired()
.HasColumnType("text");
b.Property("Title")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("CategoryId");
b.ToTable("Blogs", "public");
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.BlogCategory", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAt")
.HasColumnType("timestamp without time zone");
b.Property("CreatedBy")
.HasColumnType("text");
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.Property("IsRemoved")
.HasColumnType("boolean");
b.Property("ModifiedAt")
.HasColumnType("timestamp without time zone");
b.Property("ModifiedBy")
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("RemovedAt")
.HasColumnType("timestamp without time zone");
b.Property("RemovedBy")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("BlogCategories", "public");
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.StorageFiles.StorageFile", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAt")
.HasColumnType("timestamp without time zone");
b.Property("CreatedBy")
.HasColumnType("text");
b.Property("Discriminator")
.IsRequired()
.HasMaxLength(21)
.HasColumnType("character varying(21)");
b.Property("FileLocation")
.IsRequired()
.HasColumnType("text");
b.Property("FileName")
.IsRequired()
.HasColumnType("text");
b.Property("FileType")
.HasColumnType("integer");
b.Property("IsHeader")
.HasColumnType("boolean");
b.Property("IsPrimary")
.HasColumnType("boolean");
b.Property("IsRemoved")
.HasColumnType("boolean");
b.Property("ModifiedAt")
.HasColumnType("timestamp without time zone");
b.Property("ModifiedBy")
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("RemovedAt")
.HasColumnType("timestamp without time zone");
b.Property("RemovedBy")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("StorageFiles", "public");
b.HasDiscriminator("Discriminator").HasValue("StorageFile");
b.UseTphMappingStrategy();
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Users.ApplicationRole", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.Property("EnglishName")
.IsRequired()
.HasColumnType("text");
b.Property("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("PersianName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("Roles", "public");
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Users.ApplicationUser", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AccessFailedCount")
.HasColumnType("integer");
b.Property("BirthDate")
.HasColumnType("timestamp without time zone");
b.Property("City")
.IsRequired()
.HasColumnType("text");
b.Property("CityId")
.HasColumnType("integer");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("EmailConfirmed")
.HasColumnType("boolean");
b.Property("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property("Gender")
.HasColumnType("integer");
b.Property("LastName")
.IsRequired()
.HasColumnType("text");
b.Property("LockoutEnabled")
.HasColumnType("boolean");
b.Property("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property("NationalId")
.IsRequired()
.HasColumnType("text");
b.Property("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("PasswordHash")
.HasColumnType("text");
b.Property("PhoneNumber")
.HasColumnType("text");
b.Property("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property("SecurityStamp")
.HasColumnType("text");
b.Property("SignUpStatus")
.HasColumnType("integer");
b.Property("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("Users", "public");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("text");
b.Property("ClaimValue")
.HasColumnType("text");
b.Property("RoleId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("RoleClaims", "public");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("text");
b.Property("ClaimValue")
.HasColumnType("text");
b.Property("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Claims", "public");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.Property("LoginProvider")
.HasColumnType("text");
b.Property("ProviderKey")
.HasColumnType("text");
b.Property("ProviderDisplayName")
.HasColumnType("text");
b.Property("UserId")
.HasColumnType("uuid");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("Logins", "public");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.Property("UserId")
.HasColumnType("uuid");
b.Property("RoleId")
.HasColumnType("uuid");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("UserRoles", "public");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.Property("UserId")
.HasColumnType("uuid");
b.Property("LoginProvider")
.HasColumnType("text");
b.Property("Name")
.HasColumnType("text");
b.Property("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("Tokens", "public");
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.BlogStorageFile", b =>
{
b.HasBaseType("HamyanEdalat.Domain.Entities.StorageFiles.StorageFile");
b.Property("BlogId")
.HasColumnType("uuid");
b.HasIndex("BlogId");
b.HasDiscriminator().HasValue("BlogStorageFile");
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.Blog", b =>
{
b.HasOne("HamyanEdalat.Domain.Entities.Blogs.BlogCategory", "Category")
.WithMany("Blogs")
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Category");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict);
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.BlogStorageFile", b =>
{
b.HasOne("HamyanEdalat.Domain.Entities.Blogs.Blog", "Blog")
.WithMany("Files")
.HasForeignKey("BlogId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Blog");
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.Blog", b =>
{
b.Navigation("Files");
});
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.BlogCategory", b =>
{
b.Navigation("Blogs");
});
#pragma warning restore 612, 618
}
}
}