Your SlideShare is downloading. ×
Database version control without pain - the PHP Barcelona version
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Database version control without pain - the PHP Barcelona version

6,306
views

Published on

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

Published in: Technology

1 Comment
7 Likes
Statistics
Notes
  • 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
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
6,306
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
84
Comments
1
Likes
7
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. PHP Barcelona Conference - 30th October 2010 Harrie Verveer Database Version Control Without Pain zaterdag 30 oktober 2010
  • 2. Oh hai! 2 HarrieVerveer aka Hairy Dutchy I live in a town called “Goes” Software engineer at ibuildings since 2004 Vlissingen (Flushing) office zaterdag 30 oktober 2010
  • 3. http://www.mediawiki.org/wiki/File:Europe_satellite_orthographic.jpghttp://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. http://en.wikipedia.org/wiki/File:STS120LaunchHiRes.jpg zaterdag 30 oktober 2010
  • 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 14 The basic idea zaterdag 30 oktober 2010
  • 18. Simple patching strategy 15 zaterdag 30 oktober 2010
  • 19. Example patch file 16 patch-001.sql zaterdag 30 oktober 2010
  • 20. http://www.sxc.hu/photo/314594 zaterdag 30 oktober 2010
  • 21. Simple patching strategy 18 Development Write code Write DB patches Apply patches to own DB Update Apply patches Commit zaterdag 30 oktober 2010
  • 22. Fixing patches 19 patch-002.sql zaterdag 30 oktober 2010
  • 23. Fixing patches 19 patch-002.sql zaterdag 30 oktober 2010
  • 24. Fixing patches 19 patch-002.sql zaterdag 30 oktober 2010
  • 25. Fixing patches 20 patch-003.sql zaterdag 30 oktober 2010
  • 26. Fixing patches 20 patch-003.sql Never modify a patch file once it’s under version control zaterdag 30 oktober 2010
  • 27. Undo patch files 21 undo-001.sql 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 29 update.sh zaterdag 30 oktober 2010
  • 36. Branches Merge problems 30 zaterdag 30 oktober 2010
  • 37. Branches 31 Trunk patch-001.sql patch-002.sql patch-003.sql zaterdag 30 oktober 2010
  • 38. Trunk patch-001.sql patch-002.sql patch-003.sql create branch patch-004.sql patch-005.sql patch-004.sql patch-005.sql Branch A Merge Branches 32 zaterdag 30 oktober 2010
  • 39. Trunk patch-001.sql patch-002.sql patch-003.sql create branch patch-004.sql patch-005.sql patch-004.sql patch-005.sql Branch A Merge Branches 32 patch-006.sql patch-007.sql zaterdag 30 oktober 2010
  • 40. Branches 33 Trunk patch-001.sql patch-002.sql patch-003.sql create branch patch-004.sql patch-005.sql patch-004.sql patch-005.sql Branch B create branch patch-002.sql patch-003.sql Branch A Merge patch-004.sql Merge patch-005.sql Merge Merge zaterdag 30 oktober 2010
  • 41. Separate sequence db/patches/trunk/ patch-001.sql patch-002.sql patch-003.sql 34 db/patches/branchA/ patch-001.sql patch-002.sql zaterdag 30 oktober 2010
  • 42. Separate sequence db/patches/trunk/ patch-001.sql patch-002.sql patch-003.sql 34 db/patches/branchA/ patch-001.sql patch-002.sql Trunk version 3 BranchA version 2 zaterdag 30 oktober 2010
  • 43. Patchfile naming 35 patch_20100611_1430.sql 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 40 Table in DB 1Table in DB 1 column 1 int column 2 varchar(255) column 3 varchar(255) Table in DB 2Table in DB 2 column 1 int column 2 varchar(255) column 4 varchar(255) zaterdag 30 oktober 2010
  • 49. Comparing tables 41 Table in DB 1Table in DB 1 id int name varchar(255) city varchar(255) Table in DB 2Table in DB 2 id int name varchar(255) website varchar(255) zaterdag 30 oktober 2010
  • 50. Comparing tables 42 Table in DB 1Table in DB 1 id int firstname varchar(255) lname varchar(255) Table in DB 2Table in DB 2 id int firstname varchar(255) lastname varchar(255) zaterdag 30 oktober 2010
  • 51. 43 To synchronize two database structures without unexpected dataloss, communicating all steps needed to get from A to B is inevitable. zaterdag 30 oktober 2010
  • 52. Phing & DB Deploy 44 zaterdag 30 oktober 2010
  • 53. Phing & DB Deploy 45Cartoon by Oliver Widder - http://geekandpoke.typepad.com/ zaterdag 30 oktober 2010
  • 54. 46 http://phing.info/ 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 51 db/patches/1-create_user_table.sql zaterdag 30 oktober 2010
  • 60. DB Deploy 52 changelog table: zaterdag 30 oktober 2010
  • 61. DB Deploy 52 changelog table: zaterdag 30 oktober 2010
  • 62. DB Deploy 53 PHP zaterdag 30 oktober 2010
  • 63. DB Deploy 54 SQL zaterdag 30 oktober 2010
  • 64. DB Deploy 55 Features zaterdag 30 oktober 2010
  • 65. Liquibase The most complete solution I know 56 zaterdag 30 oktober 2010
  • 66. Liquibase 57 www.liquibase.org 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 69 scripts/migrations/001-CreateUserTable.php zaterdag 30 oktober 2010
  • 79. Writing the patch 70 scripts/migrations/001-CreateUserTable.php 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 76 http://www.doctrine-project.org/ zaterdag 30 oktober 2010
  • 87. Doctrine Migrations Patch 77 zaterdag 30 oktober 2010
  • 88. Doctrine Migrations 78 Update-to-version ./doctrine migrate zaterdag 30 oktober 2010
  • 89. YAML 79 zaterdag 30 oktober 2010
  • 90. YAML 79 ./doctrine generate-migrations-diff zaterdag 30 oktober 2010
  • 91. Doctrine Migrations 80 zaterdag 30 oktober 2010
  • 92. Doctrine Migrations 81 Generate patches zaterdag 30 oktober 2010
  • 93. Doctrine Migrations 82 Useful if you’re already using Doctrine ORM zaterdag 30 oktober 2010
  • 94. Summary 83 zaterdag 30 oktober 2010
  • 95. Summary Patchfiles • Automating • Branch merging • Why there is no silver bullet Phing + DB Deploy http://phing.info http://dbdeploy.com Liquibase http://www.liquibase.org 84 Akrabat DB Schema Manager http://akrabat.com http://github.com/akrabat/Akrabat Doctrine Migrations http://www.doctrine-project.org zaterdag 30 oktober 2010
  • 96. Questions ? 85 zaterdag 30 oktober 2010
  • 97. 86 Contact me Harrie Verveer Software Engineer at Ibuildings Blog: www.harrieverveer.com E-mail: harrie@ibuildings.nl Skype: harrie-ibuildings Twitter: @harrieverveer zaterdag 30 oktober 2010