Forum: Ruby on Rails PostgreSQL and unit tests

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.
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2006-04-03 01:20
(Received via mailing list)
After upgrading to 1.1, I can't run any unit tests.  Apparently when I
run rake test_units, it uses a migration to set up the database.
Unfortunately when it runs the migration, it's adding not null
constraints to every field, even though I haven't got that set up.
I'm using the ruby-postgres (0.7.1.2005.12.21) adapter with PostgreSQL
8.1.0.

I'm getting closer to switching over to MySQL, even though I prefer
PostgreSQL in general, as there are lots of little gotchas that get in
the way of development.  I always question whether the rails code base
actually gets tested against postgres.

Pat
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-04-03 01:35
(Received via mailing list)
On Sun, 2006-04-02 at 16:19 -0700, Pat Maddox wrote:
> actually gets tested against postgres.
-----
I'm using gem...

postgres (0.7.1)
    The extension library to access a PostgreSQL database from Ruby.

rails (1.1.0, 1.0.0)
    Web-application framework with template engine, control-flow layer,
    and ORM.

rake (0.7.0, 0.6.2)
    Ruby based make-like utility.

# rpm -q postgresql
postgresql-7.4.8-1.RHEL4.1

and I just tested this and I didn't have a problem with NOT NULL
migrations...they turned out just as defined.

Craig
E041c55ecdb461902f5dab69e19fe4df?d=identicon&s=25 John Smith (Guest)
on 2006-04-03 02:07
Pat Maddox wrote:
> After upgrading to 1.1, I can't run any unit tests.  Apparently when I
> run rake test_units, it uses a migration to set up the database.
> Unfortunately when it runs the migration, it's adding not null
> constraints to every field, even though I haven't got that set up.
> I'm using the ruby-postgres (0.7.1.2005.12.21) adapter with PostgreSQL
> 8.1.0.
>
> I'm getting closer to switching over to MySQL, even though I prefer
> PostgreSQL in general, as there are lots of little gotchas that get in
> the way of development.  I always question whether the rails code base
> actually gets tested against postgres.
>
> Pat

Please try using 'postgres' gem instead of 'ruby-postgres' gem and let
us know what happens.

There are 3 different postgres drivers for Ruby, we should probably
bless one of them as the preferred driver for rails-1.1 and beyond.
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2006-04-03 02:39
(Received via mailing list)
On 4/2/06, John Smith <nospam1@nospam1.lan> wrote:
> > the way of development.  I always question whether the rails code base
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

Okay some of my gems were messed up so it took a while, but the tests
work using 'postgres' instead.

As for the three different drivers..it's just really confusing, to
tell you the truth.  Periodically I post to the list asking which one
to use, but there's never a consensus it seems.

Thanks for the help.

Pat
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-04-03 07:54
(Received via mailing list)
Use the latest release version of ruby-postgres, no the latest build.

I attempted to 'update' once before and ran into the same problem.

--
-- Tom Mornini
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-04-03 08:01
(Received via mailing list)
On Sun, 2006-04-02 at 22:52 -0700, Tom Mornini wrote:
> Use the latest release version of ruby-postgres, no the latest build.
>
> I attempted to 'update' once before and ran into the same problem.
----
I guess I was lucky to have chosen the postgres gem and thus was spared
but I have been having a problem now of new rows created in the
schema_info table rather than updating the 1 row. I do recall someone
asking about that in the past so I know it's in the archives but if it's
an easy answer, perhaps someone wants to save me the trouble of
searching the archives.

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