开发者

Entity Framework + SQL Azure: best practices for database changes

开发者 https://www.devze.com 2023-04-11 01:08 出处:网络
I\'m designing a database that it\'s not totally 开发者_开发问答defined yet, and as the project goes, it won\'t be defined very soon. However, the project will be online very soon, and database will b

I'm designing a database that it's not totally 开发者_开发问答defined yet, and as the project goes, it won't be defined very soon. However, the project will be online very soon, and database will be changing online. So, I need be prepared to database changes. Add tables, add columns, whatever.

I'm not used to Entity Framework, but I already tried all approaches (code first, database and model first) and I like most the Model First approach, cuz I'm not used to relations yet and Model First do that for me.

The problem is: my server is Windows Azure, and I have to script SQL Azure (I still wonder why Microsoft changed that.........)

So, my question is: - What should I do, step-by-step, to update my Model and update my database when Model changes?


What I do is

  1. Have a database project in VS2010 so I can create a fresh database with latest schema.
  2. Backup the Azure database locally with RedGate SQL Azure Backup.
  3. Use RedGate Compare to compare the databases and create a diff script.
  4. Run the script to make sure it works locally on my backup from step 2.
  5. Run the script on Azure.
0

精彩评论

暂无评论...
验证码 换一张
取 消