Permalink
Browse files

make sure the migration table is alive and empty

  • Loading branch information...
1 parent e0f0afb commit b1e555142236a6b2fbb36bd80e5a0799e52e434b @tenderlove tenderlove committed Jan 14, 2012
@@ -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
@@ -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

0 comments on commit b1e5551

Please sign in to comment.