Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: ORM with version control?

by Tabari (Monk)
on Feb 11, 2008 at 16:24 UTC ( [id://667409]=note: print w/replies, xml ) Need Help??


in reply to ORM with version control?

Hello

The following is a purely DB related answer to the question.

I am also inclined to avoid the use of triggers. What follows is an idea I had on the issue, but I did not realize it yet in practice. Moreover, it depends on possibilities of your DB :

Keep one table containing all objects and their history, so primary key should somehow involve the history, I would actually prefer to create a new unique id for each modification to the original object.
Keep a field in the table to indicate that a specific version is default or current.
Create a materialized view and let your DB do the work of updating.

Admittingly, the work of adapting the view when the underlying table changes is not avoided, but this seems to be less cumbersome in maintenance than adapting triggers

Tabari

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://667409]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-23 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found