Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Migrations might seem strange at first, but over time they’ll become a very ordinary part of your work, whether you generate them automatically or customize them by hand. Rails’ approach to managing data structures is very different from the traditional separation of database design from programming. While Rails still maintains a separate toolkit for defining data structures, that toolkit attempts to improve on the traditional SQL Data Definition Language (DDL) by wrapping DDL in Ruby code.
Migrations are something of a world of their own in the Rails environment, but they are still recognizably Rails, built into the same development process. Migrations are all written in Ruby code, using a fairly small set of conventions. This book has used migrations throughout—you can write much of a Rails application without them—but until the last chapter (and then only once), those migrations were generated using Rails’ inventive scripts. Once you move past those scripts, migrations are a little more difficult, but still not that complicated.