Taming the Database

Post on 23-Feb-2016

47 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Taming the Database. Database Version Control. Wes McClure. @g0t4 wmcclure@phxwg.com wes.mcclure@gmail.com geekswithblogs.net/ wesm tsqlmigrations.codeplex.com. What the _ is this column?. Unknown Changes. Hey who dropped that table? Who changed my test data?. Shared dev DB. - PowerPoint PPT Presentation

Transcript

Taming the Database

Database Version Control

Wes McClure

@g0t4

wmcclure@phxwg.comwes.mcclure@gmail.com

geekswithblogs.net/wesmtsqlmigrations.codeplex.com

UNKNOWN CHANGESWhat the _ is this column?

SHARED DEV DB

Hey who dropped that table?Who changed my test data?

MANY VERSIONS OF THE “TRUTH”Time to release, where are the changes?

PRODUCTION ARTIFACTSHey who added a new procedure to production?

MANUAL DEPLOYFriday night: I can’t go out I have to do a release at midnight

PATTERN: LOCAL DEV DBBecause you wouldn’t dream of sharing the same code checkout…

END OF RELEASE DIFF-ATHONWhy am I going bald?

UNTESTED CHANGESYSOD

TELECOMMUTING IS PAINFULExcuses

PATTERN: AUTOMATED MIGRATIONSHeaven

Migrations

• Baseline• SchemaChanges• Going forward– Change script– Commit

Continuous Integration

Automated Deploys

The Whole Picture!

Baseline Schema

SHARED DEV DB?Or local?

WHEN DO YOU ADDRESS DATABASE CHANGES?

Commit with code into VCSRoad blocked team memberEnd of releaseNever

Add Table CustomerTypes

Add Procedure

CREATE PROCEDURE GetCustomerNames ASBEGIN

SET NOCOUNT ON;SELECT Id, CompanyName from Customers

END

top related