Versioning database principles and example