S
S
Smilley2016-10-25 12:09:15
.NET
Smilley, 2016-10-25 12:09:15

Procedure for migrating MS SQL database when working with Entity Framework?

Good afternoon. Please tell me how to work with databases correctly under the following conditions:
- there is a test database on the computer where the software is being developed;
- there is a working database, with db_owner rights in a production environment, without Visual Studio;
- there is a constantly changing model (it changes due to the addition of new functions to the software);
Actually interests as it is correct to synchronize databases. Now I act according to the following scheme:
- in the test environment, I migrate to a new model + clear all tables;
- in a production environment, I unload all working data into a script;
- in a test environment, I run a script to add data;
- in a test environment, I unload data into a script;
- in a production environment, I clear tables and load data from a script.
I understand that some kind of bike turns out ... How to do it right? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-10-25
@impwx

EF has a built-in migration mechanism. Judging by your description, it is completely suitable - in the migration code, you can describe any data or schema transformation that is feasible using SQL tools.
But why clear all tables every time?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question