Package: rake
Version: 0.8.4-1
Severity: normal

Running rake db:migrate the first time, all tables are created ok.

Running rake after that results in:
r...@shakti:~/src/camera/camera$ rake db:migrate
(in /home/rupa/src/camera/camera)
rake aborted!
PGError: ERROR:  relation "schema_migrations" already exists
: CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)

The problem is in the SQL that is generated to see if the table exists:

2009-04-06 12:24:33 CDT LOG:  duration: 2.893 ms  statement:           
SELECT tablename
   FROM pg_tables
   WHERE schemaname IN (E'"$user"',E'public')

there will never be a schemaname $user.  The driver gets the schemaname list
from the SQL: SHOW search_path and then feeds that into the above select.

The $user needs to be expanded to the currently logged in user.


This problem prevents migrations from actually working against postgres.

Oh, this won't fail if the tables are created in the public schema.  Only 
if they are created in the user's schema and one is running with the default
search_path will there be a problem.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (300, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages rake depends on:
ii  ruby                          4.2        An interpreter of object-oriented 

Versions of packages rake recommends:
ii  zip                           2.32-1     Archiver for .zip files

rake suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to