I have an application that requires the use of MyISAM on several tables, but the rest is the traditional type of InnoDB. The application itself is not transactional, where it is applied to these records, but performance is a problem.
In the Rails testing environment, it is assumed that the engine used is transactional, so when the test database is created from schema.rb, it is imported with the same engine. Is excessive behavior of this behavior possible?
I resorted to a terrible hack to provide the correct type of tables by adding this to test_helper.rb:
(ActiveRecord::Base.connection.select_values("SHOW TABLES") - %w[ schema_info ]).each do |table_name|
ActiveRecord::Base.connection.execute("ALTER TABLE `#{table_name}` ENGINE=InnoDB")
end
Is there a better way to make a model that supports MyISAM validation?
source
share