Forum: Ruby on Rails problems testing on 1.1 and postgresql

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jeroen H. (Guest)
on 2006-04-03 16:11
(Received via mailing list)
Hi,

I get errors doing this:

1) createdb myapp_test
2) rake db:test:clone_structure
3) rake test:units

rake aborted!
PGError: ERROR:  relation "matches" already exists


I'm using the :sql schema format because there are some problems with
postgres and the :ruby schema format

config.active_record.schema_format = :sql


It seems rake test:units is trying to create the tables again, is this a
bug?

Jeroen
Jeroen H. (Guest)
on 2006-04-03 16:15
(Received via mailing list)
And if I do this:

1) dropdb myapp_test
2) createdb myapp_test
3) rake test:units

I get an error:

...E...........
Finished in 1.094318 seconds.

   1) Error:
test_insert(PlayerTest):
ActiveRecord::StatementInvalid: PGError: ERROR:  relation
"vw_player_matches" does not exist
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod),
d.adsrc, a.attnotnull
               FROM pg_attribute a LEFT JOIN pg_attrdef d
                 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
              WHERE a.attrelid = 'vw_player_matches'::regclass
                AND a.attnum > 0 AND NOT a.attisdropped
              ORDER BY a.attnum



This looks like it silently creating the db structure using the :ruby
schema format which does not dump views
(http://dev.rubyonrails.org/ticket/4112)

Jeroen
Jeroen H. (Guest)
on 2006-04-03 16:31
(Received via mailing list)
I am stupid.

I didn't actually add this:
config.active_record.schema_format = :sql

After I did it works fine.
(but there definitely is a problem with the default :ruby schema dump
format)

Jeroen
This topic is locked and can not be replied to.