Forum OpenACS Development: Re: More worker bee jobs

Collapse
10: Re: More worker bee jobs (response to 1)
Posted by Tom Jackson on

I also recently had a need for a 'soft delete'. Imagine your data is stored in the myobject table. I needed to upgrade the datamodel, but I wanted the data. column types were changing, so I couldn't do it in place. So I created myobject_tmp using the new datamodel, and selected the data into this table.

The soft delete dropped the myobject table, but left the data in acs_objects, then I recreate the table and other stuff with the regular, upgraded, create script and reload the data.

Collapse
18: "soft delete" (response to 10)
Posted by Andrew Piskorski on
Tom, your "soft delete" thing - aka, leave the acs_object references dangling so we can immediately re-use them later - sounds interesting. In your particular example, I'm not clear on why you couldn't upgrade the table in place. But regardless, maybe "soft delete" is something the data model should eventually explicitly support, to aid in upgrades or whatever.
Collapse
Posted by Tom Jackson on

Andrew,

I may not have needed to do it, but one attribute was varchar and needed to be text. I also added a few not null attributes. I thought by the time I figured that out, for several tables, I could write the save/restore script. Then a few days later I made more changes and only spent a few minutes on the save/restore.

I think this also points to the fact that developing with real data can make you realize shortcomings pretty quickly.