Entity Dev wants to update smallint fields every time

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
tom.puckett
Posts: 9
Joined: Thu 17 Mar 2016 14:26

Entity Dev wants to update smallint fields every time

Post by tom.puckett » Thu 02 Jun 2016 18:16

Using PostgreSQL 9.5 and multiple recent versions of Entity Developer and LinqConnect

My model has an entity with an enumeration field (enumeration defined in the model) and I set this field up to implement in C# as type short (System.Int16). There have been no changes to this entity for a long time but each time I "update database from model" the generated script includes code to ALTER the column type to SMALLINT (notice all upper case) for this entity, even though it already is smallint (notice lower case) in the database. There must be a problem when the db schema is compared to the model to generate the update script.

Added note, after testing I see this same issue where a field is not an enumeration but just a simple short.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Entity Dev wants to update smallint fields every time

Post by Shalex » Fri 03 Jun 2016 16:06

Please set the Server Data Type property of your field to int2. Now schema comparison should consider that entity field and database column are equal.

Smallint is a synonym of int2. When Entity Developer retrieves PostgreSQL metadata, the actual data type of the smallint column is int2.

tom.puckett
Posts: 9
Joined: Thu 17 Mar 2016 14:26

Re: Entity Dev wants to update smallint fields every time

Post by tom.puckett » Fri 24 Jun 2016 13:33

OK, so maybe it would help for Entity Developer to assign a default storage type of int2 (instead of smallint) when the model type is short. Same suggestion for other special byte lengths, wherever this issue would happen.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Entity Dev wants to update smallint fields every time

Post by Shalex » Thu 30 Jun 2016 16:15

tom.puckett wrote:OK, so maybe it would help for Entity Developer to assign a default storage type of int2 (instead of smallint) when the model type is short.
Thank you for your suggestion. We will notify you when the issue is fixed.
tom.puckett wrote:Same suggestion for other special byte lengths, wherever this issue would happen.
Please clarify what "other special byte lengths" mean.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Entity Dev wants to update smallint fields every time

Post by Shalex » Thu 07 Jul 2016 17:07

tom.puckett wrote:OK, so maybe it would help for Entity Developer to assign a default storage type of int2 (instead of smallint) when the model type is short.
The fix is included in the newest (4.5.1024) build of LinqConnect.

Post Reply