diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-19 11:20:02 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-19 11:20:02 -0800 |
commit | db32b545dadae7808c210cd7ceef949a620490f0 (patch) | |
tree | 575e8443fe4f0607c1dd8472aef37dc7ea741748 /activerecord/CHANGELOG | |
parent | 87124457e55a207e190fc8dc981c2dc68445c736 (diff) | |
download | rails-db32b545dadae7808c210cd7ceef949a620490f0.tar.gz rails-db32b545dadae7808c210cd7ceef949a620490f0.tar.bz2 rails-db32b545dadae7808c210cd7ceef949a620490f0.zip |
adding Migration#change to the CHANGELOG
Diffstat (limited to 'activerecord/CHANGELOG')
-rw-r--r-- | activerecord/CHANGELOG | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 7f54c0fa30..f1e16ea2c1 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,23 @@ *Rails 3.1.0 (unreleased)* +* Migrations can be defined as reversible, meaning that the migration system +will figure out how to reverse your migration. To use reversible migrations, +just define the "change" method. For example: + + class MyMigration < ActiveRecord::Migration + def change + create_table(:horses) do + t.column :content, :text + t.column :remind_at, :datetime + end + end + end + +Some things cannot be automatically reversed for you. If you know how to +reverse those things, you should define 'up' and 'down' in your migration. If +you define something in `change` that cannot be reversed, an +IrreversibleMigration exception will be raised when going down. + * Migrations should use instance methods rather than class methods: class FooMigration < ActiveRecord::Migration def up |