diff options
author | Josh Susser <josh@hasmanythrough.com> | 2012-12-01 18:32:23 -0800 |
---|---|---|
committer | Josh Susser <josh@hasmanythrough.com> | 2012-12-01 19:41:09 -0800 |
commit | 0a5afa229d769bce9e221f34053bb93b60817a5a (patch) | |
tree | dfc0149cf2dd6b9545f01ef50d3758d68ced15d4 /activerecord/test/cases/migrator_test.rb | |
parent | a7776924a67d32067b2c1ecb9ca773c96a33da63 (diff) | |
download | rails-0a5afa229d769bce9e221f34053bb93b60817a5a.tar.gz rails-0a5afa229d769bce9e221f34053bb93b60817a5a.tar.bz2 rails-0a5afa229d769bce9e221f34053bb93b60817a5a.zip |
Add metadata to schema_migrations
migrated_at: timestamp when migration run
fingerprint: md5 hash of migration source
name: filename without version or extension
Diffstat (limited to 'activerecord/test/cases/migrator_test.rb')
-rw-r--r-- | activerecord/test/cases/migrator_test.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb index 1e16addcf3..0f0384382f 100644 --- a/activerecord/test/cases/migrator_test.rb +++ b/activerecord/test/cases/migrator_test.rb @@ -18,6 +18,9 @@ module ActiveRecord def up; @went_up = true; end def down; @went_down = true; end + # also used in place of a MigrationProxy + def filename; "anon.rb"; end + def fingerprint; "123456789012345678901234567890ab"; end end def setup @@ -102,7 +105,7 @@ module ActiveRecord end def test_finds_pending_migrations - ActiveRecord::SchemaMigration.create!(:version => '1') + ActiveRecord::SchemaMigration.create!(:version => '1', :name => "anon", :migrated_at => Time.now) migration_list = [ Migration.new('foo', 1), Migration.new('bar', 3) ] migrations = ActiveRecord::Migrator.new(:up, migration_list).pending_migrations @@ -152,7 +155,7 @@ module ActiveRecord end def test_current_version - ActiveRecord::SchemaMigration.create!(:version => '1000') + ActiveRecord::SchemaMigration.create!(:version => '1000', :name => "anon", :migrated_at => Time.now) assert_equal 1000, ActiveRecord::Migrator.current_version end @@ -320,7 +323,7 @@ module ActiveRecord def test_only_loads_pending_migrations # migrate up to 1 - ActiveRecord::SchemaMigration.create!(:version => '1') + ActiveRecord::SchemaMigration.create!(:version => '1', :name => "anon", :migrated_at => Time.now) calls, migrator = migrator_class(3) migrator.migrate("valid", nil) |