Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make sure the migration table is alive and empty

  • Loading branch information...
commit b1e555142236a6b2fbb36bd80e5a0799e52e434b 1 parent e0f0afb
@tenderlove tenderlove authored
View
3  activerecord/lib/active_record/schema_migration.rb
@@ -20,8 +20,7 @@ def self.create_table
def self.drop_table
if connection.table_exists?(table_name)
- connection.remove_index table_name, :version, :unique => true,
- :name => "#{Base.table_name_prefix}unique_schema_migrations#{Base.table_name_suffix}"
+ connection.remove_index table_name, :name => "#{Base.table_name_prefix}unique_schema_migrations#{Base.table_name_suffix}"
connection.drop_table(table_name)
end
end
View
11 activerecord/test/cases/migration/logger_test.rb
@@ -9,6 +9,17 @@ def migrate direction
end
end
+ def setup
+ super
+ ActiveRecord::SchemaMigration.create_table
+ ActiveRecord::SchemaMigration.delete_all
+ end
+
+ def teardown
+ super
+ ActiveRecord::SchemaMigration.drop_table
+ end
+
def test_migration_should_be_run_without_logger
previous_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
Please sign in to comment.
Something went wrong with that request. Please try again.