514 lines
18 KiB
C#
514 lines
18 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace HamyanEdalat.Repository.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationContext))]
|
|
[Migration("20240324082152_Init")]
|
|
partial class Init
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(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<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Content")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsRemoved")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsSuggested")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateTime>("ModifiedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("ModifiedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("ReadingTime")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("RemovedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("RemovedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Summery")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Tags")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.ToTable("Blogs", "public");
|
|
});
|
|
|
|
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Blogs.BlogCategory", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsRemoved")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateTime>("ModifiedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("ModifiedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("RemovedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("RemovedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("BlogCategories", "public");
|
|
});
|
|
|
|
modelBuilder.Entity("HamyanEdalat.Domain.Entities.StorageFiles.StorageFile", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("CreatedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Discriminator")
|
|
.IsRequired()
|
|
.HasMaxLength(21)
|
|
.HasColumnType("character varying(21)");
|
|
|
|
b.Property<string>("FileLocation")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("FileName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("FileType")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsHeader")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsPrimary")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsRemoved")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateTime>("ModifiedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("ModifiedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("RemovedAt")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("RemovedBy")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("StorageFiles", "public");
|
|
|
|
b.HasDiscriminator<string>("Discriminator").HasValue("StorageFile");
|
|
|
|
b.UseTphMappingStrategy();
|
|
});
|
|
|
|
modelBuilder.Entity("HamyanEdalat.Domain.Entities.Users.ApplicationRole", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("EnglishName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("NormalizedName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("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<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("BirthDate")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("City")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("CityId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("FirstName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Gender")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("LastName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("LockoutEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("NationalId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("NormalizedEmail")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("NormalizedUserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("SignUpStatus")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("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<System.Guid>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("RoleClaims", "public");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Claims", "public");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
|
{
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ProviderKey")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ProviderDisplayName")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("LoginProvider", "ProviderKey");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Logins", "public");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
|
{
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("UserId", "RoleId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("UserRoles", "public");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
|
{
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("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<Guid>("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<System.Guid>", b =>
|
|
{
|
|
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationRole", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
|
{
|
|
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
|
{
|
|
b.HasOne("HamyanEdalat.Domain.Entities.Users.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", 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<System.Guid>", 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
|
|
}
|
|
}
|
|
}
|