[Nitro] OG automatically adding Foreign Key constraints
rob at motionpath.com
Fri Dec 2 13:38:27 EST 2005
On 2 Dec 2005, at 17:33, Rob Pitt wrote:
> The problem was that the old patch never added constraints to
> anything except join tables. Not only does this new patch do that,
> it is much simpler and if you have :evolve_schema_cautious set to
> false, it will automatically set values that are corrupt and
> prevent the constraints being added (left around from old deleted
> objects) to NULL.
> I have changed the naming scheme somewhat for the constraints.
> Since this is only really going to effect a few people and is
> unlikely to happen again I have not bloated Og out with code to
> clean this up. Instead, here is a script I knocked together (very
> quickly, I know it's horrible :)) that will strip a PostgreSQL
> database (or all PostgreSQL databases) on a system of foreign key
> constraints, then when you next re-launch Og it will re-add them.
> This will not change the data only constraints. I suggest anyone
> who uses Og with PostgreSQL runs this script on a database before
> using this new patch with it. Do not randomly run it on all
> databases unless you know what you are doing. It is safe to use
> with any Og only database store.
> It is interactive and will prompt you for which database to clean
> up. You need to fill out the options hash at the top of the script
> with the credentials for a database to connect to. Once connected,
> it will get a list of database available. This is *not* the
> database it will strip of constraints, the database here will not
> be changed.
I just looked at this from home on my apple mac and instead of
attaching the attachments as attachments it appeared to have put them
in the mail as text. I am not sure if this was the doing of Apple
Mail (what I use at home) or Thunderbird (what I use at work). Would
someone be so kind as to tell me if these attachments worked ok?
More information about the Nitro-general