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

Use separate *.sqlite files for each database version #401

Merged
merged 1 commit into from Jan 1, 2019

Conversation

Projects
None yet
2 participants
@ubruhin
Copy link
Member

commented Dec 28, 2018

Until now, the workspace library database is stored in the file
"cache.sqlite" in the workspace. And the database itself contains a
version number which is intended to be incremented if we change the
database layout.

But if you use two different LibrePCB application versions on the same
workspace, this doesn't work well in every case. The newer application
would upgrade the database on the first application start, but the older
application may no longer be able to work with that database version. So
generally we must introduce database format changes only with new major
versions of the application, which decreases our flexibility in minor
releases.

This change puts the database version number into the filename of the
database, i.e. the file "cache.sqlite" will be renamed to
"cache_v1.sqlite" and every future database version will use a separate
file. This way the issue as described above is fixed, and we still have
the flexibility to introduce breaking database changes at any time, even
in minor releases.

Used for #400 as it introduces a new database layout.

Use separate *.sqlite files for each database version
Until now, the workspace library database is stored in the file
"cache.sqlite" in the workspace. And the database itself contains a
version number which is intended to be incremented if we change the
database layout.

But if you use two different LibrePCB application versions on the same
workspace, this doesn't work well in every case. The newer application
would upgrade the database on the first application start, but the older
application may no longer be able to work with that database version. So
generally we must introduce database format changes only with new major
versions of the application, which decreases our flexibility in minor
releases.

This change puts the database version number into the filename of the
database, i.e. the file "cache.sqlite" will be renamed to
"cache_v1.sqlite" and every future database version will use a separate
file. This way the issue as described above is fixed, and we still have
the flexibility to introduce breaking database changes at any time, even
in minor releases.

@ubruhin ubruhin added the enhancement label Dec 28, 2018

@ubruhin ubruhin added this to the 0.1.1 milestone Dec 28, 2018

@ubruhin ubruhin self-assigned this Dec 28, 2018

@ubruhin ubruhin merged commit dde1d4d into master Jan 1, 2019

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ubruhin ubruhin deleted the rename-workspace-library-cache branch Jan 1, 2019

ubruhin added a commit that referenced this pull request Mar 17, 2019

Merge pull request #401 from LibrePCB/rename-workspace-library-cache
Use separate *.sqlite files for each database version
(cherry picked from commit dde1d4d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.