Skip to content

fix: unblock migrations of v9.5.6 libraries that somehow got v9.6.2 tables - #1518

Open
CyanVoxel wants to merge 1 commit into
mainfrom
fix/1500
Open

CyanVoxel wants to merge 1 commit into
mainfrom
fix/1500

Conversation

@CyanVoxel

Copy link
Copy Markdown
Member

Summary

This PR (attempts to) fix #1500 by adding IF NOT EXISTS to the CREATE TABLE statements for the field template tables in the DB 200 migration. While I'm not 100% of the circumstances around #1500, I was able to replicate the error by doing the following:

  1. Create a library in v9.5.6 (DB 102)
  2. Open that library in v9.6.2 (DB 300)
  3. Take the backup library file from that migration and attempt to open it in v9.6.3 (DB 300)

This replication worked because the backups of the libraries weren't done properly at the time and got the new tables before the backups were saved. In any case, adding IF NOT EXISTS to the SQL CREATE TABLE statements should allow any database that got in that state to safely migrate forward. I've also added a new text fixture to help prevent future regressions.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added this to the Alpha v9.6.4 milestone Sep 28, 2026
@CyanVoxel CyanVoxel added Type: Bug Something isn't working as intended Type: Tests Tests or testing related TagStudio: Library Relating to the TagStudio library system Priority: High An important issue requiring attention labels Sep 28, 2026
@Thecreatre

Copy link
Copy Markdown

While I'm not 100% of the circumstances around #1500, I was able to replicate the error by doing the following:

Create a library in v9.5.6 (DB 102)
Open that library in v9.6.2 (DB 300)
Take the backup library file from that migration and attempt to open it in v9.6.3 (DB 300)

hey well your in luck that is basically what i did tho i didnt realize the backup was from the 9.6.2 duping it but mangling the DB
well hope ur fix works as ive added exclusive information to the library with the bug so id kinda like to keep using it :p

This branch has not been deployed

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

Labels

Priority: High An important issue requiring attention TagStudio: Library Relating to the TagStudio library system Type: Bug Something isn't working as intended Type: Tests Tests or testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tagstudio failing to upgrade library file to new iteration

2 participants