|
-
Jun 20th, 2012, 08:11 AM
#1
Thread Starter
Randalf the Red
Database Migration Woes Entity Framework 4.1 Code First
We are following the Entity Framework Code First model and developing a couple of applications. Now we have production/staging/development databases, and I need a good way to ensure changes are properly effected in each of the environments.
The blunt approach is to have the app create an empty database (or deploy an empty database) and then migrate all the necessary data, but this is just a lame way of doing things.
I checked online and there are suggestions for VSDBCMD (?), but we only have VS 2010 prof, so no database projects to speak of.
Any other solution?
If I migrated to EF 4.3 which supposedly has support for migrations, do I need to change anything else in the code?
.
-
Jun 21st, 2012, 12:49 AM
#2
Re: Database Migration Woes Entity Framework 4.1 Code First
We generally use Management Studio to generate scripts for creation of tables and, if required, insertion of data. Such a script can be run by SQLCMD directly, from a batch file or from a Custom Action during installation.
-
Jun 21st, 2012, 03:34 AM
#3
Thread Starter
Randalf the Red
Re: Database Migration Woes Entity Framework 4.1 Code First
This is my scenario: I have development going on on four different machines (which in turn may have their own database versions). At the end of the development cycle, I use a staging machine (usually my laptop) where all the changes are integrated and the final database structure created.
Now the changes have to be deployed on a staging server, which has an older copy of the database. How do I synchronize the database on the staging server with that on my laptop? I could generate the DDL scripts from Management Studio, but I can't run them as they are on the staging server database.
Is there a way I can generate the change scripts through Management Studio automatically?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|