Skip to content

Commit

Permalink
Correctly map unsigned database types with precision, scale, size o…
Browse files Browse the repository at this point in the history
…r display width to CLR types.
  • Loading branch information
lauxjpn committed Oct 24, 2019
1 parent e7aca63 commit 78d038c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/EFCore.MySql/Storage/Internal/MySqlTypeMappingSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,5 +440,17 @@ private RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingIn

return null;
}

protected override string ParseStoreTypeName(string storeTypeName, out bool? unicode, out int? size, out int? precision, out int? scale)
{
var storeTypeBaseName = base.ParseStoreTypeName(storeTypeName, out unicode, out size, out precision, out scale);

if (storeTypeName?.Contains("unsigned", StringComparison.OrdinalIgnoreCase) ?? false)
{
return storeTypeBaseName + " unsigned";
}

return storeTypeBaseName;
}
}
}

0 comments on commit 78d038c

Please sign in to comment.