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.
Entity Dev wants to update smallint fields every time
-
- Posts: 9
- Joined: Thu 17 Mar 2016 14:26
Re: Entity Dev wants to update smallint fields every time
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.
Smallint is a synonym of int2. When Entity Developer retrieves PostgreSQL metadata, the actual data type of the smallint column is int2.
-
- Posts: 9
- Joined: Thu 17 Mar 2016 14:26
Re: Entity Dev wants to update smallint fields every time
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
Thank you for your suggestion. We will notify you when the issue is fixed.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.
Please clarify what "other special byte lengths" mean.tom.puckett wrote:Same suggestion for other special byte lengths, wherever this issue would happen.
Re: Entity Dev wants to update smallint fields every time
The fix is included in the newest (4.5.1024) build of LinqConnect.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.