Database version control DPC version
Upcoming SlideShare
Loading in...5
×
 

Database version control DPC version

on

  • 5,229 views

Slides as used on the Dutch PHP Conference 2010

Slides as used on the Dutch PHP Conference 2010

Statistics

Views

Total Views
5,229
Views on SlideShare
5,179
Embed Views
50

Actions

Likes
8
Downloads
93
Comments
0

1 Embed 50

http://www.slideshare.net 50

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • ORM = Object Relations Mapper <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Database version control DPC version Database version control DPC version Presentation Transcript

  • Database Version Control Without Pain Harrie Verveer June 11th 2010
  • Database Version Control What’s the problem? 2
  • http://www.sxc.hu/photo/754535
  • http://www.sxc.hu/photo/1207911
  • http://en.wikipedia.org/wiki/File:STS120LaunchHiRes.jpg
  • http://www.sxc.hu/photo/1255121
  • Why Database Version Control 7
  • Simple Patching Strategy The basic idea 8
  • Simple patching strategy 9
  • Example patch file patch-001.sql 10
  • http://www.sxc.hu/photo/1214820
  • Simple patching strategy Development Write code Write DB patches Apply patches to own DB Apply patches Commit Update 12
  • Fixing patches patch-002.sql 13
  • Fixing patches patch-002.sql 13
  • Fixing patches patch-002.sql 13
  • Fixing patches patch-003.sql 14
  • Fixing patches patch-003.sql Never modify a patch file once it’s under version control 14
  • Undo patch files undo-001.sql 15
  • http://www.freefoto.com/preview/41-07-7
  • Bonus points Install.sql 17
  • Bonus points Initial dummy content 18
  • http://www.sxc.hu/photo/643214
  • http://www.sxc.hu/photo/946855
  • Automating the process Faster & Safer 21
  • http://www.sxc.hu/photo/314594
  • Typical patch script 23
  • Typical patch script update.sh 24
  • http://www.sxc.hu/photo/1196126
  • Branches Merge problems 26
  • Branches Trunk patch-001.sql patch-002.sql patch-003.sql 27
  • Branches Trunk patch-001.sql patch-002.sql patch-003.sql Branch A create branch patch-004.sql patch-004.sql patch-005.sql patch-005.sql Merge 28
  • Branches Trunk patch-001.sql patch-002.sql patch-003.sql Branch A create branch patch-004.sql patch-006.sql patch-004.sql patch-005.sql patch-007.sql patch-005.sql Merge 28
  • Branches Trunk patch-001.sql Branch A create branch patch-002.sql patch-002.sql patch-003.sql Branch B create branch patch-003.sql Merge patch-004.sql patch-004.sql patch-004.sql patch-005.sql patch-005.sql Merge patch-005.sql Merge Merge 29
  • Separate sequence db/patches/trunk/ db/patches/branchA/ patch-001.sql patch-001.sql patch-002.sql patch-002.sql patch-003.sql 30
  • Separate sequence db/patches/trunk/ db/patches/branchA/ patch-001.sql patch-001.sql patch-002.sql patch-002.sql patch-003.sql Trunk version 3 BranchA version 2 30
  • Patchfile naming patch_20100611_1430.sql 31
  • Patch log 32
  • http://www.sxc.hu/photo/692740
  • Phing & DB Deploy Avoiding the NIH syndrome 34
  • http://phing.info/ 35
  • Phing 36
  • 37
  • DB Deploy 38
  • DB Deploy db/patches/1-create_user_table.sql 39
  • Phing & DB Deploy 40
  • DB Deploy changelog table: 41
  • DB Deploy changelog table: 41
  • DB Deploy PHP 42
  • DB Deploy SQL 43
  • DB Deploy Features 44
  • Liquibase A different approach 45
  • Liquibase www.liquibase.org 46
  • Liquibase 47
  • Liquibase 48
  • Liquibase 49
  • Liquibase Updating Reverting Tagging Generate XML Diff 50
  • http://www.sxc.hu/photo/1241520
  • Liquibase Branches 52
  • Liquibase DBMS Support 53
  • Liquibase Documentation 54
  • Liquibase Java 55
  • Akrabat DB Schema Manager Zend Framework specific solution 56
  • Akrabat DB Schema Manager Zend Framework Proposed by Rob Allen in 2006 Recently implemented Might be in ZF in the near future http://github.com/akrabat/Akrabat 57
  • Writing the patch scripts/migrations/001-CreateUserTable.php 58
  • Writing the patch scripts/migrations/001-CreateUserTable.php 59
  • Akrabat DB Schema Manager PHP Patches 60
  • Akrabat DB Schema Manager Easy syntax if you know ZF 61
  • Akrabat DB Schema Manager Easy to use 62
  • Akrabat DB Schema Manager Branch merging 63
  • Doctrine Migrations 64
  • Doctrine Migrations http://www.doctrine-project.org/ 65
  • Doctrine Migrations 66
  • Doctrine Migrations Update-to-version 67
  • Doctrine Migrations Generate patches 68
  • Doctrine Migrations Useful if you’re already using Doctrine ORM 69
  • Summary 70
  • Summary Patchfiles Akrabat DB Schema Manager http://akrabat.com • Automating http://github.com/akrabat/Akrabat • Branch merging Doctrine Migrations Phing + DB Deploy http://www.doctrine-project.org http://phing.info http://dbdeploy.com Liquibase http://www.liquibase.org 71
  • Questions ? 72
  • Contact me Harrie Verveer Software Engineer at Ibuildings E-mail: harrie@ibuildings.nl Skype: harrie-ibuildings Twitter: @harrieverveer http://joind.in/1544 73