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

Allow versioning and easy updating of database scheme #200

Closed
nolden opened this issue Jul 13, 2012 · 4 comments
Closed

Allow versioning and easy updating of database scheme #200

nolden opened this issue Jul 13, 2012 · 4 comments
Assignees

Comments

@nolden
Copy link
Member

nolden commented Jul 13, 2012

Database version should be checked on startup:

  • create a const member in ctkDICOMDatabase for the version number of the schema
  • create a config table in the database containing a version number
  • on instantiaton compare the versions and signal any incompatibility to the application to (optionally) let the user rebuild

The rebuld method:

  • select all filenames
  • create a second database file with the new schema
  • reindex all files and insert to new database
  • on success replace old database file
@pieper
Copy link
Member

pieper commented Jul 13, 2012

We can document this process and specify that the 'Filename' column of the Images table can never be changed in any future version of the schema (also the version config table schema cannot be changed). This will mean that the database can always be rebuild from the information available in the old database.

@nolden
Copy link
Member Author

nolden commented Jul 13, 2012

Sounds good. I'm already working on the rebuild part. First results will be available soon in the 200-database-schema-update branch.

@nolden
Copy link
Member Author

nolden commented Jul 13, 2012

@pieper Ok, the branch contains now the new updateSchema method that should re-insert everything after applying the schema. The testing is still very basic, see ctkDICOMDatabaseTest2.cpp

@pieper pieper closed this as completed Jul 23, 2012
@pieper
Copy link
Member

pieper commented Jul 23, 2012

We needed this for the SlicerRt project (for a deadline next week) so I finished some of the integration and committed the changes from Marco's branch.

The ctkDICOMAppWidget will auto-update if it sees a version mismatch and provides a dialog. Ideally this should be done with the QFuture pattern to make the progress dialog interruptible, but since this schema update probably happens rarely I didn't add that feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants