Skip to content

Conversation

@CyanVoxel
Copy link
Member

Summary

This PR starts storing the DB version inside of a new versions table instead of the ill-named preferences table.

  • Deprecates the preferences table, set to be removed in a future TagStudio version
  • Introduces the versions table
    • Has a string key column and an int value column
    • The key column stores one of two values: 'INITIAL' and 'CURRENT'
    • 'INITIAL' stores the database version number in which in was created
      • Pre-existing databases set this number to 100
    • 'CURRENT' stores the current database version number
  • Bump version to 101 (minor)
  • Docstring tweaks to existing methods
  • Prepended all DB migration methods with dunders to signify that they're private
image

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.5.4 milestone Aug 25, 2025
@CyanVoxel CyanVoxel added the Type: Refactor Code that needs to be restructured or cleaned up label Aug 25, 2025
@CyanVoxel CyanVoxel added TagStudio: Library Relating to the TagStudio library system Priority: High An important issue requiring attention Status: Review Needed A review of this is needed labels Aug 25, 2025
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development Aug 25, 2025
@Computerdores
Copy link
Collaborator

What do you think about also storing when a migration happens? This would give us some debug info if we ever encounter a library with weird artefacts caused by a faulty migration

@CyanVoxel
Copy link
Member Author

What do you think about also storing when a migration happens? This would give us some debug info if we ever encounter a library with weird artefacts caused by a faulty migration

That would be valuable information, but I don't think would work in this versions table specifically due to the data shape. There could be a new table called something like migration_history with an integer "version" column and a datetime "date" column that just keeps an ongoing log of when migrations happen. Outside of the scope of this PR, though

@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label Aug 28, 2025
@CyanVoxel CyanVoxel moved this from 🏓 Ready for Review to 🍃 Pending Merge in TagStudio Development Aug 28, 2025
@CyanVoxel CyanVoxel merged commit 12e074b into main Aug 28, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from 🍃 Pending Merge to ✅ Done in TagStudio Development Aug 28, 2025
@CyanVoxel CyanVoxel deleted the versions-table branch August 28, 2025 19:59
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: Refactor Code that needs to be restructured or cleaned up

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants