You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to have a way to allow collections to upgrade themselves between versions.
Add an CollectionSchema trait with a version() function, like View. Also add a a function like async fn upgrade_from_previous_version<C: Connection>(connection: &C, stored_version: u64). Maybe blocked by Backend trait should support error handling #113.
Store a mapping of all known schema names and their versions when creating a database.
Upon opening an existing database, check the list of schemas against the ones stored. If any versions don't match, call upgrade_from_previous_version before allowing any operations on that collection.
A list of all views should be stored for each collection.
If a collection or view is missing after upgrade, the files should be removed.
This sounds dangerous, but having data that must be cleaned up manually is also bad. Maybe there should be a setting that prevents this behavior for Collections? Views are ephemeral so this is fine for views no matter what.
Schema should have a callback that is invoked when any set of collections are upgraded (with the list of upgraded collections).
The text was updated successfully, but these errors were encountered:
We need to have a way to allow collections to upgrade themselves between versions.
CollectionSchema
trait with aversion()
function, likeView
. Also add a a function likeasync fn upgrade_from_previous_version<C: Connection>(connection: &C, stored_version: u64)
. Maybe blocked byBackend
trait should support error handling #113.upgrade_from_previous_version
before allowing any operations on that collection.The text was updated successfully, but these errors were encountered: