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

Jonathan Viney
2006-08-14T14:08:21Z

Are you using any plugins... I recall seeing this when a plugin was
misbehaving a while ago.

-Jonathan.

On 8/15/06, Jeroen <jeroen.houben@lostboys.nl>
wrote:
>
> 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/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...