-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework the db version management (#1775)
* rework the db version management The way our `getVersion`/`setVersion` was very unintuitive and led to comments like the following in tests: ```scala dbs.getVersion(statement, "network", 1) // this will set version to 1 ``` The reason is that we treat unitialized databases and up-to-date databases exactly the same way. That is why a `getVersion` will set the version to the most up-to-date if none is found. It's also why we use `CREATE IF NOT EXISTS` statements for tables and indices. With this change, the `getVersion` now only _gets_ the version, or returns `None` if no version exists. Since we now differentiate between uninitialized and up-to-date db, we don't need to make the create statements idempotent. This makes the code more strict, and we will see errors if our versioning system has bugs. Internal tables (used for versioning, locking, etc.) have been left unchanged. Co-authored-by: Bastien Teinturier <[email protected]>
- Loading branch information
Showing
22 changed files
with
338 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.