Our team works on a website with ASP MVC5 & EF5. there are 3 machines involved in my question:
- Developer's machine
- Test server
- Production server
So a regular work cycle is: the developer adding features & puts them on the test server when there are some approved tested features they goes to the Production server. When there are no model changes - everything works great. But, when there are model changes - sometimes the migration gets wrong. and the DB get so messed up so we need to backit up, clear everything & copy the data from the backup. what we do is:
- Add migration on dev-env.
- Copy all the source to the test/production (Model & Migration folders).
- Update database.
when doing this basic cycle some times the migration failes to update because of table already exists; I guess im doing something wrong in the process.
Another bad thing: we have copy of the development environment on the Test & Production servers - my guess is that we dont need VS on the server in order to update version (we use the VS to run the EF commands from the package manager.
My question is
Is there any best practice/manual regarding dev->test->production process & how to do it right with code first & no visual studio on the servers?