Informatika Mihelac

Articles tagged with mysql

January 31 2007 mysql 0 comments

Help! Rails test cases do not remove fixture data

Check if target database table is of MyIsam type. You have two options, first is not to use transactional fixtures in tests:
self.use_transactional_fixtures = false

Second and better option is to convert all tables to InnoDB tables. This migration can help converting:

class MyIsam2InnoDb < ActiveRecord::Migration
  def self.up
    ActiveRecord::Base.connection.tables.each {|t| 
        execute "ALTER TABLE #{t} TYPE=InnoDB"}
  end

  def self.down
  end
end

About

I am Bojan Mihelac and this blog is dedicated to share code, thoughts, tools and advices I came up with while working in Informatika Mihelac.

Contact: bmihelac@mihelac.org

RSS feedSubscribe to RSS Feed