Domanda

So I have a F# project that connects to a MsSQL database. In the dev environment the database structure is a bit different (Some tables has extra columns, no renames or deletions or type changes) to the structure in prod. So when I compile the code it references the dev db and everything works fine. But then when I deploy the code and update the connectionstrings to point to the prod db the code fails complaining about the missing fields in the table. Surely there is a pattern to avoid this? Any pointers or suggestions will be highly appreciated....

È stato utile?

Soluzione

Well no, there is no 'easy' solution to this. It's a common plague of multi-environment systems.

There are partial solutions, but I am still to see a satisfactory one.
For example:

1) Keep different code branches for different database versions.

2) Have an 'adapter' layer on top of your data access layer taking care of (mocking) the differences between your updated data model and the old database implementation.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top