Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Like this? Share it with your network

Share

Database version control without pain - the PHP Barcelona version

on

  • 6,881 views

The slides for the talk "database version control without pain" as presented at PHP Barcelona, October 30th 2010

The slides for the talk "database version control without pain" as presented at PHP Barcelona, October 30th 2010

Statistics

Views

Total Views
6,881
Views on SlideShare
6,880
Embed Views
1

Actions

Likes
7
Downloads
83
Comments
1

1 Embed 1

https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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…
  • Hey !
    I suggest you have a look at the GPL neXtep designer, an alternate solution to the ones you presented here. It offers a full-featured database development on top of a version control repository, offerring some amazing features in terms of database delivery automation, merge, design.
    All information available at :
    http://www.nextep-softwares.com

    Kind regards,
    Christophe
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Database version control without pain - the PHP Barcelona version Presentation Transcript

  • 1. Database Version Control Without Pain Harrie Verveer PHP Barcelona Conference - 30th October 2010 zaterdag 30 oktober 2010
  • 2. Oh hai! Harrie Verveer aka Hairy Dutchy I live in a town called “Goes” Software engineer at ibuildings since 2004 Vlissingen (Flushing) office 2 zaterdag 30 oktober 2010
  • 3. http://www.mediawiki.org/wiki/File:Europe_satellite_orthographic.jpg zaterdag 30 oktober 2010
  • 4. zaterdag 30 oktober 2010
  • 5. zaterdag 30 oktober 2010
  • 6. zaterdag 30 oktober 2010
  • 7. zaterdag 30 oktober 2010
  • 8. zaterdag 30 oktober 2010
  • 9. zaterdag 30 oktober 2010
  • 10. zaterdag 30 oktober 2010
  • 11. Database Version Control What’s the problem? 8 zaterdag 30 oktober 2010
  • 12. http://www.sxc.hu/photo/1207911 zaterdag 30 oktober 2010
  • 13. zaterdag 30 oktober 2010 http://en.wikipedia.org/wiki/File:STS120LaunchHiRes.jpg
  • 14. http://www.flickr.com/photos/kt/1217157/ zaterdag 30 oktober 2010
  • 15. http://www.sxc.hu/photo/1255121 zaterdag 30 oktober 2010
  • 16. Why Database Version Control 13 zaterdag 30 oktober 2010
  • 17. Simple Patching Strategy The basic idea 14 zaterdag 30 oktober 2010
  • 18. Simple patching strategy 15 zaterdag 30 oktober 2010
  • 19. Example patch file patch-001.sql 16 zaterdag 30 oktober 2010
  • 20. http://www.sxc.hu/photo/314594 zaterdag 30 oktober 2010
  • 21. Simple patching strategy Development Write code Write DB patches Apply patches to own DB Apply patches Commit Update 18 zaterdag 30 oktober 2010
  • 22. Fixing patches patch-002.sql 19 zaterdag 30 oktober 2010
  • 23. Fixing patches patch-002.sql 19 zaterdag 30 oktober 2010
  • 24. Fixing patches patch-002.sql 19 zaterdag 30 oktober 2010
  • 25. Fixing patches patch-003.sql 20 zaterdag 30 oktober 2010
  • 26. Fixing patches patch-003.sql Never modify a patch file once it’s under version control 20 zaterdag 30 oktober 2010
  • 27. Undo patch files undo-001.sql 21 zaterdag 30 oktober 2010
  • 28. http://www.freefoto.com/preview/41-07-7 zaterdag 30 oktober 2010
  • 29. Bonus points Install.sql 23 zaterdag 30 oktober 2010
  • 30. Bonus points Initial dummy content 24 zaterdag 30 oktober 2010
  • 31. http://www.sxc.hu/photo/643214 zaterdag 30 oktober 2010
  • 32. http://www.sxc.hu/photo/946855 zaterdag 30 oktober 2010
  • 33. Automating the process Faster & Safer 27 zaterdag 30 oktober 2010
  • 34. Typical patch script 28 zaterdag 30 oktober 2010
  • 35. Typical patch script update.sh 29 zaterdag 30 oktober 2010
  • 36. Branches Merge problems 30 zaterdag 30 oktober 2010
  • 37. Branches Trunk patch-001.sql patch-002.sql patch-003.sql 31 zaterdag 30 oktober 2010
  • 38. 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 32 zaterdag 30 oktober 2010
  • 39. 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 32 zaterdag 30 oktober 2010
  • 40. 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 33 zaterdag 30 oktober 2010
  • 41. Separate sequence db/patches/trunk/ db/patches/branchA/ patch-001.sql patch-001.sql patch-002.sql patch-002.sql patch-003.sql 34 zaterdag 30 oktober 2010
  • 42. 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 34 zaterdag 30 oktober 2010
  • 43. Patchfile naming patch_20100611_1430.sql 35 zaterdag 30 oktober 2010
  • 44. Patch log 36 zaterdag 30 oktober 2010
  • 45. http://www.sxc.hu/photo/692740 zaterdag 30 oktober 2010
  • 46. There is no silver bullet Why it can’t exist 38 zaterdag 30 oktober 2010
  • 47. http://www.flickr.com/photos/eschipul/4160817135/ zaterdag 30 oktober 2010
  • 48. Comparing tables Table in DB 1 Table in DB 2 column 1 int column 1 int column 2 varchar(255) column 2 varchar(255) column 3 varchar(255) column 4 varchar(255) 40 zaterdag 30 oktober 2010
  • 49. Comparing tables Table in DB 1 Table in DB 2 id int id int name varchar(255) name varchar(255) city varchar(255) website varchar(255) 41 zaterdag 30 oktober 2010
  • 50. Comparing tables Table in DB 1 Table in DB 2 id int id int firstname varchar(255) firstname varchar(255) lname varchar(255) lastname varchar(255) 42 zaterdag 30 oktober 2010
  • 51. To synchronize two database structures without unexpected dataloss, communicating all steps needed to get from A to B is inevitable. 43 zaterdag 30 oktober 2010
  • 52. Phing & DB Deploy 44 zaterdag 30 oktober 2010
  • 53. Phing & DB Deploy Cartoon by Oliver Widder - http://geekandpoke.typepad.com/ 45 zaterdag 30 oktober 2010
  • 54. http://phing.info/ 46 zaterdag 30 oktober 2010
  • 55. Phing 47 zaterdag 30 oktober 2010
  • 56. 48 zaterdag 30 oktober 2010
  • 57. DB Deploy 49 zaterdag 30 oktober 2010
  • 58. Phing & DB Deploy 50 zaterdag 30 oktober 2010
  • 59. DB Deploy db/patches/1-create_user_table.sql 51 zaterdag 30 oktober 2010
  • 60. DB Deploy changelog table: 52 zaterdag 30 oktober 2010
  • 61. DB Deploy changelog table: 52 zaterdag 30 oktober 2010
  • 62. DB Deploy PHP 53 zaterdag 30 oktober 2010
  • 63. DB Deploy SQL 54 zaterdag 30 oktober 2010
  • 64. DB Deploy Features 55 zaterdag 30 oktober 2010
  • 65. Liquibase The most complete solution I know 56 zaterdag 30 oktober 2010
  • 66. Liquibase www.liquibase.org 57 zaterdag 30 oktober 2010
  • 67. Liquibase 58 zaterdag 30 oktober 2010
  • 68. Liquibase 59 zaterdag 30 oktober 2010
  • 69. Liquibase 60 zaterdag 30 oktober 2010
  • 70. Liquibase Updating Reverting Tagging Generate XML Diff 61 zaterdag 30 oktober 2010
  • 71. http://www.sxc.hu/photo/1241520 zaterdag 30 oktober 2010
  • 72. Liquibase Branches 63 zaterdag 30 oktober 2010
  • 73. Liquibase DBMS Support 64 zaterdag 30 oktober 2010
  • 74. Liquibase Documentation 65 zaterdag 30 oktober 2010
  • 75. Liquibase Java 66 zaterdag 30 oktober 2010
  • 76. Akrabat DB Schema Manager Zend Framework specific solution 67 zaterdag 30 oktober 2010
  • 77. Akrabat DB Schema Manager Zend Framework Proposed by Rob Allen in 2006 Recently implemented http://github.com/akrabat/Akrabat 68 zaterdag 30 oktober 2010
  • 78. Writing the patch scripts/migrations/001-CreateUserTable.php 69 zaterdag 30 oktober 2010
  • 79. Writing the patch scripts/migrations/001-CreateUserTable.php 70 zaterdag 30 oktober 2010
  • 80. Akrabat DB Schema Manager PHP Patches 71 zaterdag 30 oktober 2010
  • 81. Akrabat DB Schema Manager Easy syntax if you know ZF 72 zaterdag 30 oktober 2010
  • 82. Akrabat DB Schema Manager Easy to install, easy to use 73 zaterdag 30 oktober 2010
  • 83. Akrabat DB Schema Manager Easy to install, easy to use 73 zaterdag 30 oktober 2010
  • 84. Akrabat DB Schema Manager Branch merging 74 zaterdag 30 oktober 2010
  • 85. Doctrine Migrations Doctrine ORM specific solution 75 zaterdag 30 oktober 2010
  • 86. Doctrine Migrations http://www.doctrine-project.org/ 76 zaterdag 30 oktober 2010
  • 87. Doctrine Migrations Patch 77 zaterdag 30 oktober 2010
  • 88. Doctrine Migrations Update-to-version ./doctrine migrate 78 zaterdag 30 oktober 2010
  • 89. YAML 79 zaterdag 30 oktober 2010
  • 90. YAML ./doctrine generate-migrations-diff 79 zaterdag 30 oktober 2010
  • 91. Doctrine Migrations 80 zaterdag 30 oktober 2010
  • 92. Doctrine Migrations Generate patches 81 zaterdag 30 oktober 2010
  • 93. Doctrine Migrations Useful if you’re already using Doctrine ORM 82 zaterdag 30 oktober 2010
  • 94. Summary 83 zaterdag 30 oktober 2010
  • 95. Summary Patchfiles Akrabat DB Schema Manager http://akrabat.com • Automating http://github.com/akrabat/Akrabat • Branch merging • Why there is no silver bullet Doctrine Migrations http://www.doctrine-project.org Phing + DB Deploy http://phing.info http://dbdeploy.com Liquibase http://www.liquibase.org 84 zaterdag 30 oktober 2010
  • 96. Questions ? 85 zaterdag 30 oktober 2010
  • 97. Contact me Harrie Verveer Software Engineer at Ibuildings Blog: www.harrieverveer.com E-mail: harrie@ibuildings.nl Skype: harrie-ibuildings Twitter: @harrieverveer 86 zaterdag 30 oktober 2010