Page 1 of 1

Entity Dev wants to update smallint fields every time

Posted: Thu 02 Jun 2016 18:16
by tom.puckett
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.

Re: Entity Dev wants to update smallint fields every time

Posted: Fri 03 Jun 2016 16:06
by Shalex
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.

Re: Entity Dev wants to update smallint fields every time

Posted: Fri 24 Jun 2016 13:33
by tom.puckett
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.

Re: Entity Dev wants to update smallint fields every time

Posted: Thu 30 Jun 2016 16:15
by Shalex
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.

Re: Entity Dev wants to update smallint fields every time

Posted: Thu 07 Jul 2016 17:07
by Shalex
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.