Skip to content

refactor: sql migrations#1295

Merged
CyanVoxel merged 10 commits into
TagStudioDev:mainfrom
Computerdores:refactor/sql_migrations
May 9, 2026
Merged

refactor: sql migrations#1295
CyanVoxel merged 10 commits into
TagStudioDev:mainfrom
Computerdores:refactor/sql_migrations

Conversation

@Computerdores
Copy link
Copy Markdown
Collaborator

@Computerdores Computerdores commented Jan 18, 2026

Summary

This PR refactors the SQL migrations for old DB versions. Previously these migrations happened out of order and were split between schema changes and data updates. This was done because some SQLAlchemy read operations would otherwise fail due to an incompatible schema1. This refactor rearranges these migrations into chronological order. This was done, because

  • the code was very entangled thus hard to understand und verify,
  • the chronological step-wise way is the typical way of migrating DBs,
  • and because this way, new migrations can be added easily and with confidence that none of the previous steps will interfere or be interfered with

Note for reviewers: The changes were intentionally split into small commits that should be easily verifiable individually, because they make small changes that should change nothing about the correctness of the migration steps.

Note for reviewers 2: This is based on #1294.

Tasks Completed

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

Footnotes

  1. this was fixed in f28adfd

@Computerdores Computerdores moved this to 🏓 Ready for Review in TagStudio Development Jan 18, 2026
@Computerdores Computerdores added Type: Refactor Code that needs to be restructured or cleaned up TagStudio: Library Relating to the TagStudio library system labels Jan 18, 2026
@Computerdores Computerdores mentioned this pull request Jan 21, 2026
8 tasks
@Computerdores Computerdores added the Status: Review Needed A review of this is needed label Jan 22, 2026
@CyanVoxel CyanVoxel moved this from 🏓 Ready for Review to 👀 In review in TagStudio Development May 9, 2026
@CyanVoxel CyanVoxel added this to the Alpha v9.6.0 milestone May 9, 2026
Copy link
Copy Markdown
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this all looks good, thank you so much for your work on this!

@CyanVoxel CyanVoxel merged commit b0decac into TagStudioDev:main May 9, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in TagStudio Development May 9, 2026
@Computerdores Computerdores deleted the refactor/sql_migrations branch May 12, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed A review of this is needed 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.

2 participants