Skip to content

Commit

Permalink
temporary comment out setting decimal for ef migration to work
Browse files Browse the repository at this point in the history
  • Loading branch information
thiennn committed Jan 18, 2024
1 parent 7cb6e13 commit 7fb6d40
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Modules/SimplCommerce.Module.Core/Data/SimplDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)

RegisterCustomMappings(modelBuilder, typeToRegisters);

foreach (var property in modelBuilder.Model.GetEntityTypes()
.SelectMany(t => t.GetProperties())
.Where(p => p.ClrType == typeof(decimal) || p.ClrType == typeof(decimal?)))
{
property.SetColumnType("decimal(18,2)");
}
//foreach (var property in modelBuilder.Model.GetEntityTypes()
// .SelectMany(t => t.GetProperties())
// .Where(p => p.ClrType == typeof(decimal) || p.ClrType == typeof(decimal?)))
//{
// Console.WriteLine("decimal property: " + property.Name);
// //property.SetColumnType("decimal(18,2)");
//}

if (Database.ProviderName == "Microsoft.EntityFrameworkCore.Sqlite")
{
Expand Down

0 comments on commit 7fb6d40

Please sign in to comment.