[Rails] rake test:units -> table already exists

Jeroen
2006-08-14T13:08:27Z

Hi!

When I run test:units, rails complains about the tables already being
present. They had to be present so I could run individual unit tests. So
why doesn''t rails just drop the tables if they exist?

Any ideas??

Jeroen

debug oupt below:


>rake test:units --trace
(in ...)
** Invoke test:units (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:test:prepare
** Invoke db:test:clone (first_time)
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
** Execute db:test:clone
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
rake aborted!
Mysql::Error: #42S01Table ''cats'' already exists: CREATE TABLE
cats (`id`
int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255)
DEFAULT
'''' NOT NULL, `position` int(11) DEFAULT 0 NOT NULL,
`created_at`
datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB

--
Posted via http://www.ruby-forum.com/.