mceachen/closure_tree — Issue #4: rebuild! causes invalid INSERT rows using PostgreSQL
Author: subhash
Created: 2011-12-06 06:30:02+00:00
State: open

While running a migration file with Tag.rebuild! I encounter the following error:

PGError: ERROR: column "id" does not exist LINE 1: ...r_id", "descendant_id") VALUES(0, NULL, NULL) RETURNING "id"

This is because the join table lacks an id column and this is a problem for the PostgreSQL adapter, see this:

http://www.ruby-forum.com/topic/195472

Any idea how to get around this? Adding an id column is not possible because rails prohibits it for HABTM associations. Composite primary keys also do not work.

TIA,
Subhash