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 older gramps versions to see (not crash) db schema 21 #1974

Open
wants to merge 5 commits into
base: maintenance/gramps60
Choose a base branch
from

Conversation

dsblank
Copy link
Member

@dsblank dsblank commented Feb 14, 2025

Older versions of Gramps cannot see the new db format (21) but just crashes.

This PR:

  1. adds a value column of type BLOB to metadata
  2. writes the version value there

Fixes #13633

@dsblank dsblank self-assigned this Feb 14, 2025
@dsblank dsblank added the bug label Feb 14, 2025
@dsblank dsblank added this to the v6.0 milestone Feb 14, 2025
@Nick-Hall
Copy link
Member

It looks like you didn't initialise the blob version for new databases.

I am getting the error: a bytes-like object is required, not 'NoneType'

@dsblank
Copy link
Member Author

dsblank commented Feb 14, 2025

It looks like you didn't initialise the blob version for new databases.

Are you sure this went through the upgrade? You can force it by removing the json_data in the metadata table.

@dsblank
Copy link
Member Author

dsblank commented Feb 14, 2025

Oh, I see... it only works on the upgrade. Needs to always work.

@dsblank
Copy link
Member Author

dsblank commented Feb 14, 2025

@Nick-Hall, ok I believe I have all of the paths correct now. I tested a 6.0 newly create DB, opened in 5.2, and an upgraded 6.0 in 5.2. Both complained about the version 21.

@Nick-Hall
Copy link
Member

Now I get a problem reading the name formats in the metadata table. It doesn't give me an error regarding incompatible versions.

Steps to reproduce:

  1. Create a new database in gramps60
  2. Import the example database
  3. Open the database in gramps52

@dsblank
Copy link
Member Author

dsblank commented Feb 14, 2025

I'm going to propose some changes to earlier version of Gramps that we check the version number before trying to read the rest of the metadata. Currently gramps5.2 , it checks the version AFTER it reads in a bunch of data. Let's move the check up before that, and release new versions.

@Nick-Hall
Copy link
Member

Nick-Hall commented Feb 14, 2025

Do we really want to release updates to old versions? How far back would we go?

People probably wouldn't upgrade and would still get the errors.

Can we add pickled empty lists to the rows still causing a problem?

@dsblank
Copy link
Member Author

dsblank commented Feb 14, 2025

Can we add pickled empty lists to the rows still causing a problem?

I can try. I'll look at that this weekend.

@Nick-Hall
Copy link
Member

@dsblank Don't spend too much time on this one. It mainly affects developers and doesn't corrupt the database.

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

Successfully merging this pull request may close these issues.

2 participants