BUG: wrong sql-type (when copying and pasting properties)

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
RobertK
Posts: 85
Joined: Thu 02 Mar 2017 05:44

BUG: wrong sql-type (when copying and pasting properties)

Post by RobertK » Tue 23 Feb 2021 04:06

How to reproduce issue

1. Create a class model in the Entity Developer, standalone program.
2. Add primary key and prosperities as you normally would, add a column "myitem" with data type int32.
3. Copy "myitem" to "sku"
4. change "sku" to data type string.
5. Generate the class model code and you will find the data type is incorrect.

If you have a look inside the efml you will find entity developer saved this xml with the wrong sql-type

Code: Select all

    <property name="Sku" type="String" p1:nullable="True" p1:ValidateRequired="false" p1:Guid="5236fc66-aaea-4f6f-8ca7-fa132b9e841b">
      <column name="" not-null="False" sql-type="int4" p1:unicode="False" />
    </property>
sql-type should be "varchar" because its a string.

Code: Select all

    <property name="Sku" type="String" p1:nullable="True" p1:ValidateRequired="false" p1:Guid="5236fc66-aaea-4f6f-8ca7-fa132b9e841b">
      <column name="" not-null="False" sql-type="varchar" p1:unicode="False" />
    </property>
Work around: remove the column and create a new column or manually update the efml file and change the sql-type from int4 to varchar

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

Re: BUG: wrong sql-type (when copying and pasting properties)

Post by Shalex » Tue 23 Feb 2021 19:18

We cannot reproduce the issue with Entity Developer v6.10.1189. Please upgrade.
1. Create a class model in the Entity Developer, standalone program.
1. You work with Devart EF Core Model (*.efml) and SQL Server, don't you?
2. Add primary key and prosperities as you normally would, add a column "myitem" with data type int32.
2. Did you set SQL Type (via Column Editor) for "myitem" explicitly? If yes, what value?
4. change "sku" to data type string.
4.1. Did you change SQL Type for "sku" explicitly?
4.2. Did you run Regenerate Storage and Mapping?

If possible, send us a test model for reproducing the issue.

RobertK
Posts: 85
Joined: Thu 02 Mar 2017 05:44

Re: BUG: wrong sql-type (when copying and pasting properties)

Post by RobertK » Thu 25 Feb 2021 16:39

im using postgres and ef core template, standalone entity developer

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

Re: BUG: wrong sql-type (when copying and pasting properties)

Post by Shalex » Thu 25 Feb 2021 18:31

We still cannot reproduce the issue.

1. Did you change SQL Type for "sku" explicitly?
2. Did you run Regenerate Storage and Mapping?
3. Please send us a test model for reproducing the issue.

RobertK
Posts: 85
Joined: Thu 02 Mar 2017 05:44

Re: BUG: wrong sql-type (when copying and pasting properties)

Post by RobertK » Sun 28 Feb 2021 09:52

Shalex wrote:
Thu 25 Feb 2021 18:31
We still cannot reproduce the issue.

1. Did you change SQL Type for "sku" explicitly?
2. Did you run Regenerate Storage and Mapping?
3. Please send us a test model for reproducing the issue.
1. Yes, thats correct
2. No, I did not, I just regenerated the code for class models
3. Download from here https://filebin.net/5bz15qlz87r2e146 (it contains the issue)

You could also reproduce this issue aswell as per instruction above.

RobertK
Posts: 85
Joined: Thu 02 Mar 2017 05:44

Re: BUG: wrong sql-type (when copying and pasting properties)

Post by RobertK » Sun 28 Feb 2021 09:55

You can also check ApplicationDbContext, the NewCol is a string but in ApplicationDbContext it is an int

NewCol was copied from "Order" and renamed to "NewCol" with it's data type changed from int to string.

Copying and pasting and changing the data type does not work, you might assume it works because the model shows you everything is correct but the generated code is incorrect.

Post Reply