Snapshot inventories/registries
We should be able to create snapshot of differente inventories like vendors, data, assets, risks, etc.
The idea would be to have a single new snapshots table containing a foreign key organization_id.
All “snapshotable” tables would have a snapshot_id column. When creating a snapshot, we duplicate the data of the table and associate it with a new snapshot_id. When an object is current, it simply does not have a snapshot_id.
This way, we can preserve all existing foreign keys and uniqueness constraints, with the only difference being that snapshot_id replaces organization_id.
That means we only introduce one new table, regardless of how many tables we decide to make “snapshotable.”
However, this does require some data migration and code adjustments. We can move forward progressively, table by table (for example, starting with vendors).
No need anymore for vendor_snapshots, people_snapshots... or unstructured data. On the frontend, we just add a snapshot selector and adjust the queries to use the current snapshot_id for snapshotable tables.
Done in https://github.com/getprobo/probo/commit/16ced9638d0074130079e838313f3ecae42bd9bb and other previous commits.