DB  Alters During
"The Freeze"

A Modest Proposal

What we've done in the past

  • Table changes applied just prior to code releases
  • Alters were either Developer -> DBA notification
  • Or DBA <- Developer 'pulls'

Why not "Keep Doing It Like We Have Always Done"(tm)

  • We miss things
  • Then things break
  • Then we get in trouble

A New Hope

or 

A New Way Of Doing this

  • We will create file(s) in the Code repository
    • maybe one file per DB
    • or one per Release Unit
    • or one per Feature Branch with DB changes
  • As code requiring DB changes is checked in, devs add to the file required alters for the feature->dev branch merge
  • Annotate the alters with the Ticket and maybe developer name
  • Commit alter file(s) in feature branch and merge to 'dev' with the associated code

When merging Release Unit to Master during the thaw

  • Step 1: DBA's evaluate alters in the file(s)
  • Step 2: Alters are made via appropriate tool
  • Step 3: ???
  • Step 4: Merge and publish release unit code
  • Step 5: Profit!

Example

# SRCH-1234 dfetterman

ALTER TABLE rkexample.demotable
ADD COLUMN demonstration varchar(100) not null;

 

# SRCH-1357 otherdevname

ALTER TABLE rkexample.demotable

MODIFY COLUMN demonstration varchar(256) default null;

Result

# SRCH-1234 dfetterman

ALTER TABLE rkexample.demotable
ADD COLUMN demonstration varchar(100) not null;

 

# SRCH-1357 otherdevname

ALTER TABLE rkexample.demotable

MODIFY COLUMN demonstration varchar(256) default null;

Title Text

  • Bullet One
  • Bullet Two
  • Bullet Three
Made with Slides.com