提交 0c294e00 编写于 作者: S Steve Klabnik

Migrations: move massive paragraph out of intro.

Most of the guides have a few simple sentences describing what they will show
you at the top. This one had a few big paragraphs. I've moved those paragraphs
down to an introductory one, and written a new smaller one for the introduction.
This makes this guide more consistent with the others.
上级 28e8abfa
Migrations
==========
Migrations are a feature of Active Record that allows you to evolve your
database schema over time. Rather than write schema modifications in pure SQL,
migrations allow you to use an easy Ruby DSL to describe changes to your
tables.
In this guide, you'll learn all about migrations including:
* The generators you can use to create them
* The methods Active Record provides to manipulate your database
* The Rake tasks that manipulate them
* How they relate to `schema.rb`
--------------------------------------------------------------------------------
What are Migrations?
--------------------
Migrations are a convenient way for you to alter your database in a structured
and organized manner. You could edit fragments of SQL by hand but you would then
be responsible for telling other developers that they need to go and run them.
......@@ -9,7 +26,8 @@ production machines next time you deploy.
Active Record tracks which migrations have already been run so all you have to
do is update your source and run `rake db:migrate`. Active Record will work out
which migrations should be run. Active Record will also update your `db/schema.rb` file to match the up-to-date structure of your database.
which migrations should be run. Active Record will also update your
`db/schema.rb` file to match the up-to-date structure of your database.
Migrations also allow you to describe these transformations using Ruby. The
great thing about this is that (like most of Active Record's functionality) it
......@@ -18,15 +36,6 @@ is database independent: you don't need to worry about the precise syntax of
drop down to raw SQL for database specific features). For example, you could use
SQLite3 in development, but MySQL in production.
In this guide, you'll learn all about migrations including:
* The generators you can use to create them
* The methods Active Record provides to manipulate your database
* The Rake tasks that manipulate them
* How they relate to `schema.rb`
--------------------------------------------------------------------------------
Anatomy of a Migration
----------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册