Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92c00360a7 | |||
| 38e765203d |
@@ -162,8 +162,5 @@
|
|||||||
<Using Include="Microsoft.Extensions.Options" />
|
<Using Include="Microsoft.Extensions.Options" />
|
||||||
<Using Include="Microsoft.Extensions.Logging" />
|
<Using Include="Microsoft.Extensions.Logging" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Postgres\Migrations\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+1
-46
@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(MidrandBooksDbContext))]
|
[DbContext(typeof(MidrandBooksDbContext))]
|
||||||
[Migration("20260528052014_Init")]
|
[Migration("20260529070104_Init")]
|
||||||
partial class Init
|
partial class Init
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -649,40 +649,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
b.ToTable("Prices", (string)null);
|
b.ToTable("Prices", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Models.ProductPrice", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<decimal>("Amount")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<decimal>("Discount")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<bool>("Enabled")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<long>("ProductId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("UpdatedAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ProductId")
|
|
||||||
.IsUnique();
|
|
||||||
|
|
||||||
b.ToTable("ProductPrice");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("LiteCharms.Features.MidrandBooks.Authors.Entities.Author", "Author")
|
b.HasOne("LiteCharms.Features.MidrandBooks.Authors.Entities.Author", "Author")
|
||||||
@@ -931,15 +897,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
b.Navigation("Product");
|
b.Navigation("Product");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Models.ProductPrice", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("LiteCharms.Features.MidrandBooks.Products.Entities.Product", null)
|
|
||||||
.WithOne("Price")
|
|
||||||
.HasForeignKey("LiteCharms.Features.MidrandBooks.Products.Models.ProductPrice", "ProductId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Pages");
|
b.Navigation("Pages");
|
||||||
@@ -973,8 +930,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Entities.Product", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Price");
|
|
||||||
|
|
||||||
b.Navigation("Prices");
|
b.Navigation("Prices");
|
||||||
});
|
});
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
-33
@@ -259,30 +259,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
});
|
});
|
||||||
|
|
||||||
//migrationBuilder.CreateTable(
|
|
||||||
// name: "ProductPrice",
|
|
||||||
// columns: table => new
|
|
||||||
// {
|
|
||||||
// Id = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
// .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
// CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
// UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
|
||||||
// ProductId = table.Column<long>(type: "bigint", nullable: false),
|
|
||||||
// Amount = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
// Discount = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
// Enabled = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
// },
|
|
||||||
// constraints: table =>
|
|
||||||
// {
|
|
||||||
// table.PrimaryKey("PK_ProductPrice", x => x.Id);
|
|
||||||
// table.ForeignKey(
|
|
||||||
// name: "FK_ProductPrice_Products_ProductId",
|
|
||||||
// column: x => x.ProductId,
|
|
||||||
// principalTable: "Products",
|
|
||||||
// principalColumn: "Id",
|
|
||||||
// onDelete: ReferentialAction.Cascade);
|
|
||||||
// });
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Shippings",
|
name: "Shippings",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -427,12 +403,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
table: "Prices",
|
table: "Prices",
|
||||||
column: "ProductId");
|
column: "ProductId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_ProductPrice_ProductId",
|
|
||||||
table: "ProductPrice",
|
|
||||||
column: "ProductId",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Refunds_OrderId",
|
name: "IX_Refunds_OrderId",
|
||||||
table: "Refunds",
|
table: "Refunds",
|
||||||
@@ -467,9 +437,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "OrderItems");
|
name: "OrderItems");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "ProductPrice");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Refunds");
|
name: "Refunds");
|
||||||
|
|
||||||
+6
-51
@@ -57,7 +57,7 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ProductId");
|
b.HasIndex("ProductId");
|
||||||
|
|
||||||
b.ToTable("Books", (string)null);
|
b.ToTable("Books");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Authors.Entities.Author", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Authors.Entities.Author", b =>
|
||||||
@@ -454,7 +454,7 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("ShippingProviders", (string)null);
|
b.ToTable("ShippingProviders");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Pages.Entities.BookPage", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Pages.Entities.BookPage", b =>
|
||||||
@@ -646,40 +646,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
b.ToTable("Prices", (string)null);
|
b.ToTable("Prices", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Models.ProductPrice", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<decimal>("Amount")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<decimal>("Discount")
|
|
||||||
.HasColumnType("numeric");
|
|
||||||
|
|
||||||
b.Property<bool>("Enabled")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<long>("ProductId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("UpdatedAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ProductId")
|
|
||||||
.IsUnique();
|
|
||||||
|
|
||||||
b.ToTable("ProductPrice", (string)null);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("LiteCharms.Features.MidrandBooks.Authors.Entities.Author", "Author")
|
b.HasOne("LiteCharms.Features.MidrandBooks.Authors.Entities.Author", "Author")
|
||||||
@@ -718,7 +684,7 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
b1.HasKey("AuthorId", "__synthesizedOrdinal");
|
b1.HasKey("AuthorId", "__synthesizedOrdinal");
|
||||||
|
|
||||||
b1.ToTable("Authors", (string)null);
|
b1.ToTable("Authors");
|
||||||
|
|
||||||
b1
|
b1
|
||||||
.ToJson("SocialMedia")
|
.ToJson("SocialMedia")
|
||||||
@@ -772,7 +738,7 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
b1.HasKey("CustomerId", "__synthesizedOrdinal");
|
b1.HasKey("CustomerId", "__synthesizedOrdinal");
|
||||||
|
|
||||||
b1.ToTable("Customers", (string)null);
|
b1.ToTable("Customers");
|
||||||
|
|
||||||
b1
|
b1
|
||||||
.ToJson("SocialMedia")
|
.ToJson("SocialMedia")
|
||||||
@@ -862,7 +828,7 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
b1.HasKey("BookPageId", "__synthesizedOrdinal");
|
b1.HasKey("BookPageId", "__synthesizedOrdinal");
|
||||||
|
|
||||||
b1.ToTable("BookPages", (string)null);
|
b1.ToTable("BookPages");
|
||||||
|
|
||||||
b1
|
b1
|
||||||
.ToJson("References")
|
.ToJson("References")
|
||||||
@@ -904,7 +870,7 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
b1.HasKey("ProductId");
|
b1.HasKey("ProductId");
|
||||||
|
|
||||||
b1.ToTable("Products", (string)null);
|
b1.ToTable("Products");
|
||||||
|
|
||||||
b1
|
b1
|
||||||
.ToJson("Metadata")
|
.ToJson("Metadata")
|
||||||
@@ -928,15 +894,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
b.Navigation("Product");
|
b.Navigation("Product");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Models.ProductPrice", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("LiteCharms.Features.MidrandBooks.Products.Entities.Product", null)
|
|
||||||
.WithOne("Price")
|
|
||||||
.HasForeignKey("LiteCharms.Features.MidrandBooks.Products.Models.ProductPrice", "ProductId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.AuthorBooks.Entities.AuthorBook", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Pages");
|
b.Navigation("Pages");
|
||||||
@@ -970,8 +927,6 @@ namespace LiteCharms.Features.MidrandBooks.Postgres.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Entities.Product", b =>
|
modelBuilder.Entity("LiteCharms.Features.MidrandBooks.Products.Entities.Product", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Price");
|
|
||||||
|
|
||||||
b.Navigation("Prices");
|
b.Navigation("Prices");
|
||||||
});
|
});
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ public sealed class ProductConfiguration : IEntityTypeConfiguration<Product>
|
|||||||
{
|
{
|
||||||
public void Configure(EntityTypeBuilder<Product> builder)
|
public void Configure(EntityTypeBuilder<Product> builder)
|
||||||
{
|
{
|
||||||
|
builder.Ignore(p => p.Price);
|
||||||
|
|
||||||
builder.ToTable("Products");
|
builder.ToTable("Products");
|
||||||
|
|
||||||
builder.HasKey(f => f.Id);
|
builder.HasKey(f => f.Id);
|
||||||
|
|||||||
Reference in New Issue
Block a user