Commit 07b8ae39 authored by gdlcf88's avatar gdlcf88

Added HasColumnType to price properties

parent 1ca24495
......@@ -46,6 +46,10 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
b.ToTable(options.TablePrefix + "Orders", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.ProductTotalPrice).HasColumnType("decimal(18,6)");
b.Property(x => x.TotalPrice).HasColumnType("decimal(18,6)");
b.Property(x => x.TotalDiscount).HasColumnType("decimal(18,6)");
b.Property(x => x.RefundedAmount).HasColumnType("decimal(18,6)");
});
builder.Entity<OrderLine>(b =>
......@@ -53,6 +57,9 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
b.ToTable(options.TablePrefix + "OrderLines", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.TotalPrice).HasColumnType("decimal(18,6)");
b.Property(x => x.TotalDiscount).HasColumnType("decimal(18,6)");
b.Property(x => x.UnitPrice).HasColumnType("decimal(18,6)");
});
}
}
......
using Microsoft.EntityFrameworkCore.Migrations;
namespace EasyMall.Migrations
{
public partial class AddedColumnTypes : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "OrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "OrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundedAmount",
table: "OrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "ProductTotalPrice",
table: "OrdersOrders",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "UnitPrice",
table: "OrdersOrderLines",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "OrdersOrderLines",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "OrdersOrderLines",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "OrdersOrders",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "OrdersOrders",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "RefundedAmount",
table: "OrdersOrders",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "ProductTotalPrice",
table: "OrdersOrders",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "UnitPrice",
table: "OrdersOrderLines",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalPrice",
table: "OrdersOrderLines",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
migrationBuilder.AlterColumn<decimal>(
name: "TotalDiscount",
table: "OrdersOrderLines",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
}
}
}
......@@ -86,7 +86,7 @@ namespace EasyMall.Migrations
.HasColumnType("datetime2");
b.Property<decimal>("ProductTotalPrice")
.HasColumnType("decimal(18,2)");
.HasColumnType("decimal(18,6)");
b.Property<DateTime?>("ReducedInventoryAfterPaymentTime")
.HasColumnType("datetime2");
......@@ -95,7 +95,7 @@ namespace EasyMall.Migrations
.HasColumnType("datetime2");
b.Property<decimal>("RefundedAmount")
.HasColumnType("decimal(18,2)");
.HasColumnType("decimal(18,6)");
b.Property<string>("StaffRemark")
.HasColumnType("nvarchar(max)");
......@@ -108,10 +108,10 @@ namespace EasyMall.Migrations
.HasColumnType("uniqueidentifier");
b.Property<decimal>("TotalDiscount")
.HasColumnType("decimal(18,2)");
.HasColumnType("decimal(18,6)");
b.Property<decimal>("TotalPrice")
.HasColumnType("decimal(18,2)");
.HasColumnType("decimal(18,6)");
b.HasKey("Id");
......@@ -185,13 +185,13 @@ namespace EasyMall.Migrations
.HasColumnType("nvarchar(max)");
b.Property<decimal>("TotalDiscount")
.HasColumnType("decimal(18,2)");
.HasColumnType("decimal(18,6)");
b.Property<decimal>("TotalPrice")
.HasColumnType("decimal(18,2)");
.HasColumnType("decimal(18,6)");
b.Property<decimal>("UnitPrice")
.HasColumnType("decimal(18,2)");
.HasColumnType("decimal(18,6)");
b.HasKey("Id");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment