diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-09-13 20:28:01 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-09-13 20:28:01 +0100 |
commit | a17027d13a48e1e64b14a28e7d58e341812f8cb4 (patch) | |
tree | 09699984d7a4f612689f19e3e0ccb663ae207d3f /railties/doc/guides/migrations/migrations.txt | |
parent | 96055414d6197b9705e408c17236f79372a007e5 (diff) | |
download | rails-a17027d13a48e1e64b14a28e7d58e341812f8cb4.tar.gz rails-a17027d13a48e1e64b14a28e7d58e341812f8cb4.tar.bz2 rails-a17027d13a48e1e64b14a28e7d58e341812f8cb4.zip |
Merge docrails
Diffstat (limited to 'railties/doc/guides/migrations/migrations.txt')
-rw-r--r-- | railties/doc/guides/migrations/migrations.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/doc/guides/migrations/migrations.txt b/railties/doc/guides/migrations/migrations.txt new file mode 100644 index 0000000000..bbb39d0ccb --- /dev/null +++ b/railties/doc/guides/migrations/migrations.txt @@ -0,0 +1,21 @@ +Migrations +========== + +Migrations are a convenient way for you to alter your database in a structured and organised 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 it. You'd also have to keep track of which changes need to be run against the 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. + +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 is database independent: you don't need to worry about the precise syntax of CREATE TABLE any more that you worry about variations on SELECT * (you can drop down to raw SQL for database specific features). For example you could use SQLite3 in development, but MySQL in production. + +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` + +include::anatomy_of_a_migration.txt[] +include::creating_a_migration.txt[] +include::writing_a_migration.txt[] +include::rakeing_around.txt[] +include::using_models_in_migrations.txt[] +include::scheming.txt[] +include::foreign_keys.txt[]
\ No newline at end of file |