Issues creating tables in mysql tests

Hello,

I’m a beginner, so any hints are appreciated; I’m still trying to find my way around Rails code. For a bug I’ve found I need to create a table called “values” so I added this:

create_table :values do |t|

t.integer :value

end

among the other table creations in activerecord/test/cases/migration_test.rb. Is that ok? But then, when I run the tests for a second time, I get an error about values already existing. Where are the drop table calls? I couldn’t find them.

My more immediate problem so far is that I’m getting this error:

/Users/pupeno/Projects/rails/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:210:in log': Mysql::Error: Table 'camelcase' already exists: CREATE TABLE CamelCase (idint(11) DEFAULT NULL auto_increment PRIMARY KEY,name` varchar(255)) ENGINE=InnoDB (ActiveRecord::StatementInvalid)

It started happening when I was playing with adding and not adding value. The whole output is bellow. The puzzling part is that CamelCase doesn’t exist. I actually dropped and re-created the activerecord_unittest tables just to be sure. It never creates CamelCase in there. SQlite3 tests run just fine, I haven’t tried PostgreSQL.

This is the state of the databases just after running the tests and failing:

use activerecord_unittest;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

use :force => true to drop tables before creating them. Here’s an example from a test of my own:

Hello Kim,

Thanks for the info. Interestingly enough, the problem remains after adding :force => true, but if I change the table name to :values2 it does work. Is there some kind of dumped schema I could clean up? Did I find another bug?

Thanks.

Is there a place to review your code?

Hello Kim,

All my code is in http://github.com/pupeno/rails but I ended up not using the schema that way, so nothing to review, sorry.

ok, well, if that comes back, bring it up again, I guess…