Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Managing Databases with Migrations

Chapter 10. Managing Databases with Migrations

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial