aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorCristi Balan <evil@che.lu>2009-08-08 17:39:31 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-08-08 17:41:43 +0100
commit7f84f14efabf3e342a231b8aa9650cb484c802d6 (patch)
treefe96f90e6e8f2fcbad0c69f92f9b7e8bfa49f6b9 /activerecord/test/cases
parentc284412b149e03f46144ef566bcd6a16750961b1 (diff)
downloadrails-7f84f14efabf3e342a231b8aa9650cb484c802d6.tar.gz
rails-7f84f14efabf3e342a231b8aa9650cb484c802d6.tar.bz2
rails-7f84f14efabf3e342a231b8aa9650cb484c802d6.zip
Add rake db:forward - opposite of db:rollback [#768 state:resolved]
Example: rake db:forward # performs the next migration rake db:forward STEP=4 # performs the next 4 migrations Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/migration_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 72d4892435..f0f21615e0 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -1136,6 +1136,17 @@ if ActiveRecord::Base.connection.supports_migrations?
assert_equal(0, ActiveRecord::Migrator.current_version)
end
+ def test_migrator_forward
+ ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid", 1)
+ assert_equal(1, ActiveRecord::Migrator.current_version)
+
+ ActiveRecord::Migrator.forward(MIGRATIONS_ROOT + "/valid", 2)
+ assert_equal(3, ActiveRecord::Migrator.current_version)
+
+ ActiveRecord::Migrator.forward(MIGRATIONS_ROOT + "/valid")
+ assert_equal(3, ActiveRecord::Migrator.current_version)
+ end
+
def test_schema_migrations_table_name
ActiveRecord::Base.table_name_prefix = "prefix_"
ActiveRecord::Base.table_name_suffix = "_suffix"