//
using System;
using CMSMicroservice.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20251127030633_u12")]
partial class u12
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("CMS")
.HasAnnotation("ProductVersion", "9.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Category", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("ImagePath")
.HasColumnType("nvarchar(max)");
b.Property("IsActive")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ParentId")
.HasColumnType("bigint");
b.Property("SortOrder")
.HasColumnType("int");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Categorys", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Contract", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("HtmlContent")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Type")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Contracts", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.FactorDetails", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Count")
.HasColumnType("int");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsChangePrice")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("OrderId")
.HasColumnType("bigint");
b.Property("ProductId")
.HasColumnType("bigint");
b.Property("UnitDiscount")
.HasColumnType("int");
b.Property("UnitDiscountPrice")
.HasColumnType("bigint");
b.Property("UnitPrice")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("OrderId");
b.HasIndex("ProductId");
b.ToTable("FactorDetailss", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.OtpToken", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Attempts")
.HasColumnType("int");
b.Property("CodeHash")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("ExpiresAt")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsUsed")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Mobile")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Purpose")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("OtpTokens", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Package", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ImagePath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Price")
.HasColumnType("bigint");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Packages", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.ProductGallerys", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("ProductId")
.HasColumnType("bigint");
b.Property("ProductImageId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ProductId");
b.HasIndex("ProductImageId");
b.ToTable("ProductGalleryss", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.ProductImages", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("ImagePath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ImageThumbnailPath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("ProductImagess", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Products", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Discount")
.HasColumnType("int");
b.Property("FullInformation")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ImagePath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Price")
.HasColumnType("bigint");
b.Property("Rate")
.HasColumnType("int");
b.Property("RemainingCount")
.HasColumnType("int");
b.Property("SaleCount")
.HasColumnType("int");
b.Property("ShortInfomation")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ThumbnailPath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ViewCount")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Productss", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.PruductCategory", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CategoryId")
.HasColumnType("bigint");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("ProductId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("CategoryId");
b.HasIndex("ProductId");
b.ToTable("PruductCategorys", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.PruductTag", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("ProductId")
.HasColumnType("bigint");
b.Property("TagId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ProductId");
b.HasIndex("TagId");
b.ToTable("PruductTags", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Role", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Tag", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("IsActive")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("SortOrder")
.HasColumnType("int");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Tags", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Transactions", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Amount")
.HasColumnType("bigint");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("PaymentDate")
.HasColumnType("datetime2");
b.Property("PaymentStatus")
.HasColumnType("int");
b.Property("RefId")
.HasColumnType("nvarchar(max)");
b.Property("Type")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Transactionss", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("AvatarPath")
.HasColumnType("nvarchar(max)");
b.Property("BirthDate")
.HasColumnType("datetime2");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("EmailNotifications")
.HasColumnType("bit");
b.Property("FirstName")
.HasColumnType("nvarchar(max)");
b.Property("HashPassword")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsMobileVerified")
.HasColumnType("bit");
b.Property("IsRulesAccepted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("LastName")
.HasColumnType("nvarchar(max)");
b.Property("Mobile")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("MobileVerifiedAt")
.HasColumnType("datetime2");
b.Property("NationalCode")
.HasColumnType("nvarchar(max)");
b.Property("ParentId")
.HasColumnType("bigint");
b.Property("PushNotifications")
.HasColumnType("bit");
b.Property("ReferralCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("RulesAcceptedAt")
.HasColumnType("datetime2");
b.Property("SmsNotifications")
.HasColumnType("bit");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Users", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserAddress", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Address")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("CityId")
.HasColumnType("bigint");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDefault")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("PostalCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("UserAddresss", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserCarts", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Count")
.HasColumnType("int");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("ProductId")
.HasColumnType("bigint");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ProductId");
b.HasIndex("UserId");
b.ToTable("UserCartss", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserContract", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ContractId")
.HasColumnType("bigint");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("SignGuid")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("SignedPdfFile")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ContractId");
b.HasIndex("UserId");
b.ToTable("UserContracts", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserOrder", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Amount")
.HasColumnType("bigint");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("DeliveryDescription")
.HasColumnType("nvarchar(max)");
b.Property("DeliveryStatus")
.HasColumnType("int");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("PackageId")
.HasColumnType("bigint");
b.Property("PaymentDate")
.HasColumnType("datetime2");
b.Property("PaymentMethod")
.HasColumnType("int");
b.Property("PaymentStatus")
.HasColumnType("int");
b.Property("TrackingCode")
.HasColumnType("nvarchar(max)");
b.Property("TransactionId")
.HasColumnType("bigint");
b.Property("UserAddressId")
.HasColumnType("bigint");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("PackageId");
b.HasIndex("TransactionId");
b.HasIndex("UserAddressId");
b.HasIndex("UserId");
b.ToTable("UserOrders", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserRole", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("RoleId")
.HasColumnType("bigint");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserWallet", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Balance")
.HasColumnType("bigint");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModified")
.HasColumnType("datetime2");
b.Property("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property("NetworkBalance")
.HasColumnType("bigint");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("UserWallets", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserWalletChangeLog", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ChangeNerworkValue")
.HasColumnType("bigint");
b.Property("ChangeValue")
.HasColumnType("bigint");
b.Property("Created")
.HasColumnType("datetime2");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("CurrentBalance")
.HasColumnType("bigint");
b.Property