Changing backend to an existing model

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
lc4pro
Posts: 51
Joined: Thu 12 Jul 2012 08:16

Changing backend to an existing model

Post by lc4pro » Wed 23 Apr 2014 19:49

I had been developing my first model (Model First strategy) and changed my mind: it was against MySql, but now I would like to put the database on a postgresql server.
How do I swap engines losing the least from my work?

TIA

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Changing backend to an existing model

Post by MariiaI » Fri 25 Apr 2014 12:03

Perform the following steps:
1. Change the connection in the Database Explorer to the necessary one.
2. Check the Target Server in Model Settings -> Synchronization -> Mapping. It must be set to the one that you are going to use (i.e., to PostgreSQL).
3. Select "Regenerate Storage and Mapping" from the diagram shortcut menu for regenerating model parts, specific to the database server.
4. Run the Update Database Wizard to create the database objects.
5. Save changes and open the mapping file. Now it should contain mapping for the new database.

Please tell us if this helps.

lc4pro
Posts: 51
Joined: Thu 12 Jul 2012 08:16

Re: Changing backend to an existing model

Post by lc4pro » Fri 25 Apr 2014 21:36

Thank you.
It nearly works.
Playing with the Crm sample, at first sight the mapping is correct, but when I go through the Update database wizard, when it reaches the Product table, shows this error

Code: Select all

column "Discontinued" is of type boolean but default expression is of type bit
Looking at the properties and mapping, the field is bool for the .NET class, and boolean for the table in the backend.

What or where is the error raising?

TIA

Edit (same day, two hours later)
I tried the backend swap with the project I'm working on. It worked without complaints...
Nevertheless, I beg the Devart people to look at the error I reported, because it may bit again.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Changing backend to an existing model

Post by MariiaI » Mon 28 Apr 2014 09:21

shows this error
CODE: SELECT ALL
column "Discontinued" is of type boolean but default expression is of type bit
Thank you for the report on this. We have reproduced this issue. We will investigate it in more details and inform you about the results as soon as possible.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Changing backend to an existing model

Post by MariiaI » Fri 16 May 2014 05:12

The bug related to the storage and mapping regeneration via the "Update Database from Model" wizard, or via the "Regenerate Storage and Mapping" option of the diagram shortcut menu, when changing one DBMS to another, is fixed.
New build of LinqConnect 4.4.499 is available!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=29593.

Post Reply