Pomelo.entityframeworkcore.mysql: scaffolding bug: bit(1) mapped to ulong

Created on 10 Oct 2020  路  10Comments  路  Source: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql

Steps to reproduce

CREATE DATABASE IF NOT EXISTS `db1`;
USE `db1`;
DROP TABLE IF EXISTS `t1`;

CREATE TABLE `t1` (
  `id` int NOT NULL AUTO_INCREMENT,
  `Gender` bit(1) NOT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
dotnet ef dbcontext scaffold "Server=localhost;Database=mydb;User=root;Password=1111;TreatTinyAsBoolean=true;" Pomelo.EntityFrameworkCore.MySql -c MyDB -f -d --no-build -p

With TreatTinyAsBoolean=false; same result.

The issue

Using scaffold command I expect to get mapped c# boolean property from bit(1) mysql column 'Gender'. As was with .net core 2.2.
But i got
c# ... [Column(TypeName = "bit(1)")] public ulong Gender { get; set; } ...

Further technical details

.net core 3.1.8

closed-fixed type-bug

All 10 comments

Ok. I got this problem in 3.2.2.

Please update to the latest version 3.2.2 and see #917 (comment) and #577 (comment) along w/ PR #909.

Ok. I got this problem in 3.2.2.

@alex-dubatov Just give us a short feedback, that https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/917#issuecomment-565340084 mentioned by @mguinness solves your issue (which it should), so we can close this one as a duplicate.

917 doesn't solve my issue because with TreatTinyAsBoolean=false;. I still don't get bit(1) as bool.

917 doesn't solve my issue because with TreatTinyAsBoolean=false;. I still don't get bit(1) as bool.

@alex-dubatov Thanks for reporting this issue! It is a regression bug introduced with #1066. We will release a fix (see #1188) shortly.

@lauxjpn Thanks for you!
I will close the issue after checking the release.

@alex-dubatov The fix is now part of the nightly build feed, in case you want to start using it.

@lauxjpn nuget doesn't find version 3.2.3 in nightly build feed.
Also command below doesn't show version 3.2.3.

nuget list -AllVersions -Source "https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json"

nuget doesn't find version 3.2.3 in nightly build feed.

@alex-dubatov The release is 3.2.3-servicing.20511.3 and was added to the feed yesterday.
You need to enable prereleases (use either the checkbox in VS or the -Prerelease option for nuget.exe).

@lauxjpn Thank you very much for the info!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leobert1226 picture leobert1226  路  3Comments

ptsneves picture ptsneves  路  3Comments

matthewjcooper picture matthewjcooper  路  4Comments

mason-chase picture mason-chase  路  4Comments

aramirezh-dev picture aramirezh-dev  路  3Comments