On the last day of RailsConf 2006, I had the opportunity to speak on Rails migrations. The talk appeared to be well received and was well attended. My guess is around 100 people showed up, which is not bad for a Sunday morning session. The questions were good and several people came up to speak with me afterwards.
The main point of the talk was to show how well migrations dovetail with the near-constant flow of changes we experience during continuous development. The talk was kind of a mix of introductory material on migrations with more advanced topics such as transaction issues and monkey patching Rails for foreign key support. I also put together a handy collection of tips for more effective migration development and a corresponding list of gotchas as well. I built the slides so they would be a good reference after the conference. I hope that you find something useful in there. Enjoy.
Agile Databases with Migrations - RailsConf [pdf]
(7000+ downloads as of 2/1/07)
8 comments ↓
A very complete presentation. Thanks.
Thanks Beni.
Hey Damon - Sorry I missed RailsConf, your presentation sounds like it was a hit. General question for you - reading through the slides, I only saw a bit about sticking foreign keys in migrations. I know Dave T. recommends it in his book.. just wondered your thoughts, also see if you had any good examples. Red Hill’s plugin looks solid too.. cheers
It’s currently not very DRY to have to specify foreign keys as well as the relations/validations in your model. The Red Hill plugin figuring out the keys from the naming is pretty nifty, however. Personally, I don’t use foreign key constraints in the database. They do provide an extra level of checking, and can also be a pain at times. I can understand why some people want/need that. As far as examples, I have the one raw SQL example in the FAQ, but it is really no different than the example I see in the AWDWR 2 PDF. As far as I know, you basically have three options for working with foreign keys in migrations: 1) Raw SQL 2) Red Hill Consulting plugin 3) Bubbleshare/Atmos plugin
thx for the presentation ! I’ve found it very useful.
Thanks Thomas. Really glad it was helpful!
Awesome presentation! Now a key part of my dev/help/rails library. Thanks, Damon!
[…] Damon ClinkScales’ very illustrative presentation on Rails Migrations […]
Leave a Comment