DB refactoring - remove unbound jsonb fields
Refactor Project and ProjectVersion tables - remove unbound files/changes metadata jsonb fields. New table FileHistory is introduced which records changes to project files during project lifetime. This way we remove duplicates and simplify lookup in db. As a result database is smaller and more predictable. ProjectVersion table is simplified so any updates should be quick enough.
ProjectVersion.name was internally changed to integer (easier search, comparison) but we still use v prefix in API.
Refactor metadata handling - instead of using python dicts everywhere during upload and in project files we moved to dataclasses.
Few other methods from disk.py were simplified and / or moved to other places.
Just wondering about indexing of ProjectVersion table. It should be usefull to perform analysis on indexing the most frequently queried fields.
It would be awesome to merge that - it takes a lot of time to sync when we have a lot of files and a lot of versions - every version needs to create huge json in database.
It is also difficult to trace history of individual files - this change would improve that a lot.
Thank you!
It would be awesome to merge that - it takes a lot of time to sync when we have a lot of files and a lot of versions - every version needs to create huge json in database.
It is also difficult to trace history of individual files - this change would improve that a lot.
Thank you!
Yeah... thanks for feedback @kapiwko ... this PR is now in testing phase on our staging servers :)