N1QL has laid out a versioning approach that may be worth considering here: https://docs.google.com/document/d/1Uyv4t06DNGq7TxJjGI_T_MbbEYf8Er-imC7yzTY0uZw/edit#heading=h.x2b1nkw2rstt