Skip to content

fix: drop type_key column from text_fields and datetime_fields tables#1370

Merged
CyanVoxel merged 3 commits into
mainfrom
fix-1367
May 14, 2026
Merged

fix: drop type_key column from text_fields and datetime_fields tables#1370
CyanVoxel merged 3 commits into
mainfrom
fix-1367

Conversation

@CyanVoxel
Copy link
Copy Markdown
Member

Summary

This PR fixes #1367 by dropping the leftover type_key columns from the text_fields and datetime_fields tables. Because SQLite does not allow for the removal of columns with foreign key constraints, I've had to create new versions of these tables without the columns and copy the data from the old tables to the new ones, as outlined in the SQLite documentation.

I've also made a related change to enforce the ordering of columns inside of both of these tables. SQLAlchemy by default orders these columns strangely as it combines fields from the base fields definition, and I did not wish to canonize that ordering in raw SQL statements for the migration.

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.0 milestone May 13, 2026
@CyanVoxel CyanVoxel added the Priority: Critical An issue that requires immediate attention label May 13, 2026
@CyanVoxel CyanVoxel added TagStudio: Library Relating to the TagStudio library system Status: Review Needed A review of this is needed Type: Fix A fix for a bug, typo, or other issue labels May 13, 2026
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development May 13, 2026
Copy link
Copy Markdown
Collaborator

@Computerdores Computerdores left a comment

Choose a reason for hiding this comment

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

haven't tested so far but found one major issue

Comment thread src/tagstudio/core/library/alchemy/library.py Outdated
@Computerdores Computerdores moved this from 🏓 Ready for Review to 👀 In review in TagStudio Development May 14, 2026
@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label May 14, 2026
@CyanVoxel CyanVoxel merged commit 38da7bb into main May 14, 2026
14 checks passed
@CyanVoxel CyanVoxel deleted the fix-1367 branch May 14, 2026 20:38
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in TagStudio Development May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Critical An issue that requires immediate attention TagStudio: Library Relating to the TagStudio library system Type: Fix A fix for a bug, typo, or other issue

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Can't Add Fields to Entries in Migrated Libraries

2 participants