Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Collection Versioning (allows basic migration logic) #26

Open
6 tasks
Tracked by #251
ecton opened this issue Apr 1, 2021 · 1 comment
Open
6 tasks
Tracked by #251

Add Collection Versioning (allows basic migration logic) #26

ecton opened this issue Apr 1, 2021 · 1 comment
Labels
collections Issues impacting collections or views enhancement New feature or request

Comments

@ecton
Copy link
Member

ecton commented Apr 1, 2021

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).
@ecton ecton added local enhancement New feature or request labels Apr 5, 2021
@ecton ecton added this to the v0.1.0 milestone Apr 25, 2021
@ecton ecton added this to To do in Khonsu Labs Roadmap May 20, 2021
@ecton ecton moved this from To do to Backburner in Khonsu Labs Roadmap Aug 5, 2021
@ecton ecton changed the title Add database manifest Add Collection Versioning (allows basic migration logic) Jan 21, 2022
@ecton ecton moved this from Backburner to Blocked in Khonsu Labs Roadmap Jan 21, 2022
@ecton ecton moved this from Blocked to To do in Khonsu Labs Roadmap Jan 21, 2022
@ecton ecton added collections Issues impacting collections or views and removed local labels Jan 26, 2022
@ecton ecton closed this as completed in ec93e67 Mar 26, 2022
Khonsu Labs Roadmap automation moved this from To do to Done Mar 26, 2022
@ecton ecton reopened this Mar 26, 2022
Khonsu Labs Roadmap automation moved this from Done to In progress Mar 26, 2022
@ecton
Copy link
Member Author

ecton commented Mar 26, 2022

Oops, my brain read the wrong number when writing that commit message.

@ecton ecton modified the milestones: v1.0, v0.5.0 May 10, 2022
@ecton ecton modified the milestones: v0.5.0, Performance Refactor Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collections Issues impacting collections or views enhancement New feature or request
Projects
Status: In Progress
Status: Todo
Development

No branches or pull requests

1 participant