[Nitro] Problem with forgien key constraints
rob at motionpath.com
Fri Feb 17 12:07:35 EST 2006
The new patch that alters join table names has highlighted a problem
with the foreign key constraints system. The problem is PostgreSQL
doesn't like very long constraint names. This doesn't break any projects
but if you have two long model names in a join table, the constraints
will be incorrectly deleted upon startup (this doesn't alter the data).
They will not function in this state (it will act like they don't exist,
(which they don't on other stores) and will not cause you problems
developing but I suggest you don't use this patch in production until I
(or someone else) have constructed a new naming mechanism for the
constraints (I have one in mind). I will make Og handle that transition
automatically so no external scripts are needed.
For people who don't understand what constraints are they are really a
protection mechanism that cleans up data left behind when doing things
like Model.delete_all by removing relationships with that model from
other tables. Without them it is possible to end up with models at are
incorrectly related to one another (but unlikely).
More information about the Nitro-general