Skip to content

refactor: align SwiftData migration and API-shaped models#533

Merged
everpcpc merged 4 commits intomainfrom
codex/swiftdata
Feb 21, 2026
Merged

refactor: align SwiftData migration and API-shaped models#533
everpcpc merged 4 commits intomainfrom
codex/swiftdata

Conversation

@everpcpc
Copy link
Copy Markdown
Owner

Summary

  • migrate SwiftData bootstrapping to SchemaMigrationPlan with explicit V1/V2 schemas
  • move KomgaBook/KomgaSeries to API-aligned structured fields plus offline metadata index fields
  • add snapshot-based V1->V2 migration and refresh query fields during migration
  • replace fragile raw wrapper naming, add .empty helpers, and harden UI/store reads for optional migrated fields
  • bump CURRENT_PROJECT_VERSION from 307 to 308

Testing

  • make format
  • make build
  • make run-ios-sim

Issue

Migrate KomgaBook and KomgaSeries to API-aligned structured media/metadata storage plus offline query index fields.

Introduce SchemaMigrationPlan v1->v2 with snapshot-based data transfer and update stores/views to consume indexed metadata and structured fields safely.

Refs #410
Detect logs.date storage kind and bind timestamp values as INTEGER or REAL accordingly to avoid NSStrict table insert failures.

Keep compatibility with existing log schemas while preserving query and cleanup behavior.

Refs #410
Treat logs schema as strict and drop/recreate the logs table whenever the existing columns or types differ from the expected REAL timestamp schema.

Removes legacy INTEGER timestamp compatibility path so schema mismatch is resolved by reset.

Refs #410
@everpcpc everpcpc merged commit 255d66b into main Feb 21, 2026
3 checks passed
@everpcpc everpcpc deleted the codex/swiftdata branch February 21, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant