So far, pgMemento does not enable hierarchical versioning where users can work in separate branches and merge different versions with each other. This is a feature, I had in mind since I've started the development. So, you can find some prerequisites here and there in the code.
- There is only one global sequence for audit_ids. This would be useful to reference tuples accross separate branches.
pgmemento.move_table_statecan be used to copy a whole schema. This sets the foundation for intitializing a branch. Probably I should use
CREATE TABLE ... LIKEto copy also constraints, indexes, triggers etc.
- There are a couple of functions to add constraints, indexes and sequences to a restored state (see next chapter).
- Code from
revert_transactionmight be useful for merging changes (ergo logs) into another branch. But only, a yet to be developed replay API would open the door widely for hierarchical versioning.
audit_tablesVIEW was intended to help for switching the production state to a restored schema. With the improvements on reverting transaction, this idea has been dropped.