Add migration for DiscountProductImages table
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m53s

- Created a new table `DiscountProductImages` in the CMS schema.
- Added columns for image details including `Title`, `AltText`, `ImagePath`, `ThumbnailPath`, `SortOrder`, `IsActive`, `Created`, `CreatedBy`, `LastModified`, `LastModifiedBy`, and `IsDeleted`.
- Established a foreign key relationship with the `DiscountProducts` table.
- Created indexes on `DiscountProductId` and a composite index on `DiscountProductId` and `SortOrder`.
This commit is contained in:
masoodafar-web
2026-01-01 02:26:33 +03:30
parent 500e169141
commit f0117eb1d5
29 changed files with 5068 additions and 4 deletions
@@ -902,6 +902,64 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.ToTable("DiscountProductCategories", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.DiscountShop.DiscountProductImage", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
b.Property<string>("AltText")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property<long>("DiscountProductId")
.HasColumnType("bigint");
b.Property<string>("ImagePath")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime?>("LastModified")
.HasColumnType("datetime2");
b.Property<string>("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property<int>("SortOrder")
.HasColumnType("int");
b.Property<string>("ThumbnailPath")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("Title")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id");
b.HasIndex("DiscountProductId");
b.HasIndex("DiscountProductId", "SortOrder");
b.ToTable("DiscountProductImages", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.DiscountShop.DiscountShoppingCart", b =>
{
b.Property<long>("Id")
@@ -3026,6 +3084,17 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.Navigation("Product");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.DiscountShop.DiscountProductImage", b =>
{
b.HasOne("CMSMicroservice.Domain.Entities.DiscountShop.DiscountProduct", "DiscountProduct")
.WithMany("Images")
.HasForeignKey("DiscountProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DiscountProduct");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.DiscountShop.DiscountShoppingCart", b =>
{
b.HasOne("CMSMicroservice.Domain.Entities.DiscountShop.DiscountProduct", "Product")
@@ -3439,6 +3508,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
modelBuilder.Entity("CMSMicroservice.Domain.Entities.DiscountShop.DiscountProduct", b =>
{
b.Navigation("Images");
b.Navigation("OrderDetails");
b.Navigation("ProductCategories");