Hello,
In each of my tables, I have the following:
Code:
CREATE TABLE my_table (
-- ...
create_user_name VARCHAR2(30) NOT NULL,
create_time DATE NOT NULL,
modify_user_name VARCHAR2(30),
modify_time DATE
);
I thought of using these columns for versioning (create_time and modify_time), HOWEVER:
* When a record is inserted, create_time is populated, modify_time is not (so it's NULL).
* From this point forward, create_time never changes.
* When this record is updated, modify_time changes.
Having said that, is it possible to use these columns for versioning? I read somewhere that the design implies that you can't use "insert" for generated, VERSION columns, which, while it makes sense, might not work.
The only thing I have going for me right now is that if modify_time is NULL, the record has never been updated.
Can I somehow make my own version class to handle this mix of two columns, or is there insufficient abstraction for this in the API? Do I have an alternative that doesn't affect the database design and treatment of the columns mentioned above?
EDIT: What about adding a NUMBER column to every table? Would this be most effective, or can I stick with what I have?
Thanks!