Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
EShop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
EShop
Commits
07b8ae39
Commit
07b8ae39
authored
May 06, 2020
by
gdlcf88
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added HasColumnType to price properties
parent
1ca24495
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2800 additions
and
7 deletions
+2800
-7
OrdersDbContextModelCreatingExtensions.cs
...tyFrameworkCore/OrdersDbContextModelCreatingExtensions.cs
+7
-0
20200506014116_AddedColumnTypes.Designer.cs
...ns/Migrations/20200506014116_AddedColumnTypes.Designer.cs
+2661
-0
20200506014116_AddedColumnTypes.cs
...bMigrations/Migrations/20200506014116_AddedColumnTypes.cs
+125
-0
EasyMallMigrationsDbContextModelSnapshot.cs
...ns/Migrations/EasyMallMigrationsDbContextModelSnapshot.cs
+7
-7
No files found.
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs
View file @
07b8ae39
...
...
@@ -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)"
);
});
}
}
...
...
samples/EasyMall/aspnet-core/src/EasyMall.EntityFrameworkCore.DbMigrations/Migrations/20200506014116_AddedColumnTypes.Designer.cs
0 → 100644
View file @
07b8ae39
This source diff could not be displayed because it is too large. You can
view the blob
instead.
samples/EasyMall/aspnet-core/src/EasyMall.EntityFrameworkCore.DbMigrations/Migrations/20200506014116_AddedColumnTypes.cs
0 → 100644
View file @
07b8ae39
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)"
);
}
}
}
samples/EasyMall/aspnet-core/src/EasyMall.EntityFrameworkCore.DbMigrations/Migrations/EasyMallMigrationsDbContextModelSnapshot.cs
View file @
07b8ae39
...
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment