From: Dennis F. <de...@co...> - 2002-07-07 11:21:58
|
Hi Dave, Um I think I must better describe the problem :/ Or maybe I didn't understand your code. The REAL problem is that if you the data in a database and you want to upgrade tot the newer version you need to do a couple of things: - get the data to a file - erase the database - insert the new database scheme - change the 0's into NULLs in the file - put the data back. (real-time in a database just doesn't sound like a good thing to me) So as this hack seems okay it bypasses the real problem. That is to actually change all the data. Am I wrong here ? Dennis ----- Original Message ----- From: "Dave Cridland" <da...@cr...> To: "Dennis Fleurbaaij" <de...@co...> Cc: <cor...@li...> Sent: Sunday, July 07, 2002 1:08 PM Subject: Re: [Core-lan-org-devel] jumbo edits, cvsdiff -u > On Sat, 2002-07-06 at 17:35, Dennis Fleurbaaij wrote: > > The point is that the data you now have is full of 0's and the database > > won't allow you to insert them as they refer to non-existant tasks (0 is not > > a possible task, SQL starts couting at 1). So as I've said before we need a > > script to take all the 0's and convert them into NULL's. > > I hasten to add this is not a good example of my coding, but anyway. > > Attached is a very quick, highly untested perl hack which ought to read > in create_database.sql, spot the REFERENCES (ACtually the trigger > statements), parse them according to my weak knowledge of what these > are, and then - hopefully - generate reasonable SQL statements which > should fix up the database, replacing non-existent values with NULL. > > As I say, I haven't tested it *AT ALL*. If someone wants to send me a > suitable candidate test database to run it on, I'll happily do so. > > I apologise profusely for the appalling hack that this is, but I figured > it was possibly quicker than identifying each REFERENCES manually. > > Dave. > |