Permalink
Browse files

Update Migration and 4.0 Release Guides, Changelogs [#8267]

  • Loading branch information...
marcandre committed Dec 19, 2012
1 parent 06c7ba8 commit a81845f26864d076970e706863c766aead432672
Showing with 223 additions and 36 deletions.
  1. +17 −0 activerecord/CHANGELOG.md
  2. +13 −0 guides/source/4_0_release_notes.md
  3. +189 −36 guides/source/migrations.md
  4. +4 −0 railties/CHANGELOG.md
View
@@ -1,5 +1,22 @@
## Rails 4.0.0 (unreleased) ##
+* Improve ways to write `change` migrations, making the old `up` & `down` methods no longer necessary.
+
+ * The methods `drop_table` and `remove_column` are now reversible, as long as the necessary information is given.
+ The method `remove_column` used to accept multiple column names; instead use `remove_columns` (which is not revertible).
+ The method `change_table` is also reversible, as long as its block doesn't call `remove`, `change` or `change_default`
+
+ * New method `reversible` makes it possible to specify code to be run when migrating up or down.
+ See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/migrations.md#using-the-reversible-method)
+
+ * New method `revert` will revert a whole migration or the given block.
+ If migrating down, the given migration / block is run normally.
+ See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/migrations.md#reverting-previous-migrations)
+
+ Attempting to revert the methods `execute`, `remove_columns` and `change_column` will now raise an IrreversibleMigration instead of actually executing them without any output.
+
+ *Marc-André Lafortune*
+
* Serialized attributes can be serialized in integer columns.
Fix #8575.
@@ -165,6 +165,19 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/master/railt
### Notable changes
+* Improve ways to write `change` migrations, making the old `up` & `down` methods no longer necessary.
+
+ * The methods `drop_table` and `remove_column` are now reversible, as long as the necessary information is given.
+ The method `remove_column` used to accept multiple column names; instead use `remove_columns` (which is not revertible).
+ The method `change_table` is also reversible, as long as its block doesn't call `remove`, `change` or `change_default`
+
+ * New method `reversible` makes it possible to specify code to be run when migrating up or down.
+ See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/migrations.md#using-the-reversible-method)
+
+ * New method `revert` will revert a whole migration or the given block.
+ If migrating down, the given migration / block is run normally.
+ See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/migrations.md#reverting-previous-migrations)
+
* Adds some metadata columns to `schema_migrations` table.
* `migrated_at`
Oops, something went wrong.

0 comments on commit a81845f

Please sign in to comment.