Skip to content

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

@CyanVoxel

Description

@CyanVoxel

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

TagStudio Version

Alpha 9.5.7 (main branch)

Operating System & Version

macOS 15

Description

If a library was migrated from a DB version earlier than 200, then fields can not be added to entries due to a NOT NULL constraint on the legacy type_key column that was left in due to it being difficult to remove because of a FOREIGN KEY constraint. Caused by #1354.

Removing the now-unused type_key column entirely as described here should resolve this issue as well.

Expected Behavior

Fields should be able to be added to entries in all libraries, regardless of the version they were created in.

Steps to Reproduce

  1. Have a library that was created before DB version 200 (9.5.7 will do, not on the main branch)
  2. Try adding a field to a file entry
  3. Observe that you can not

Logs

2026-05-12 23:06:56 [error    ] (sqlite3.IntegrityError) NOT NULL constraint failed: text_fields.type_key
[SQL: INSERT INTO text_fields (value, is_multiline, name, entry_id) VALUES (?, ?, ?, ?)]
[parameters: (None, 0, 'Title', 230)]
(Background on this error at: https://sqlalche.me/e/20/gkpj)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: CriticalAn issue that requires immediate attentionTagStudio: LibraryRelating to the TagStudio library systemType: BugSomething isn't working as intended

    Type

    Projects

    Status

    🛠 Ready for Development

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions