Appearance
How To Manage Database Schema Changes 
Goal: Version database schema changes alongside the code that requires them. Make both deploy and rollback easier.
Steps 
- Accomplish the goal Ensure SQL solution folder exists
 - Create two SQL scripts for each feature or story you're working on: 
{story}-UP.sqland{story}-DOWN.sql. - Write the one schema change into the 
-UP.sqlscript. Don't try to get your entire final schema in one step; just do one change. - Apply the 
-UP.sqlscript to your database. - Manually verify the resulting schema is correct.
 - Implement as much of the code change as you can with just the amount of schema change you've implemented so far.
 - Use the 
-UP.sqlscript as a guide to write the-DOWN.sqlscript. - Apply the 
-DOWN.sqlscript to your database. - Manually verify that you are back to the original schema.
 - Commit code and scripts to source control.
 - Does your 
-UP.sqlscript get to the whole final schema you want?- No:
 - Repeat from step 2. You will modify/extend the same script files.
 
 - Done!
 
Ensure SQL solution folder exists 
- In your solution folder, create a physical directory named 
SQL. - In Visual Studio, add the newly created 
SQLdirectory as a Solution Folder. - Done!