Description:
I am reporting a missing type mapping in the MySQL Connector/NET Entity Framework Core provider.
The provider does not currently support DECIMAL UNSIGNED columns during database reverse engineering (scaffolding).
Environment:
MySql.EntityFrameworkCore: 10.0.9
Microsoft.EntityFrameworkCore.Design: 10.0.12
.NET: 10.x
MySQL Server: 9.7.4-2
Operating System: Linux
This issue was initially reported in the Connector/NET GitHub repository:
https://github.com/mysql/mysql-connector-net/issues/93
A Connector/NET team member (@Ch3M4x) confirmed that DECIMAL UNSIGNED is currently not supported and explicitly requested that this issue be reported through the official MySQL Bugs Database under the Connector / NET category.
The issue affects both generated entity properties and indexes containing DECIMAL UNSIGNED columns.
How to repeat:
Create a database table containing a DECIMAL UNSIGNED column:
sql
CREATE TABLE test_decimal_unsigned (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
prod_hora DECIMAL(12,4) UNSIGNED NOT NULL
);
Use MySQL Connector/NET Entity Framework Core provider (MySql.EntityFrameworkCore 10.0.9) to scaffold the existing database.
Observe the scaffolding output.
The following warning is generated:
text
Could not find type mapping for column
'database_name.table_name.prod_hora'
with data type 'decimal(12,4) unsigned'.
Skipping column.
Inspect the generated entity.
The prod_hora property is missing.
The same issue also affects indexes containing DECIMAL UNSIGNED columns.
Suggested fix:
Add support for DECIMAL UNSIGNED column types in the Entity Framework Core type mapping and scaffolding implementation.
DECIMAL UNSIGNED columns should be recognized and mapped to the CLR System.Decimal type.
For example:
csharp
public decimal ProdHora { get; set; }
Ensure that indexes containing DECIMAL UNSIGNED columns are also correctly handled during database scaffolding.
Page generated in 0.037 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders. It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.