refactor(database): replace deprecated MikroORM methods #155

Merged
jonas.hanisch merged 2 commits from refactor/149-mikro-orm-deprecated-methods into main 2026-01-24 12:21:41 +00:00
Owner

Summary

Replace deprecated persistAndFlush and removeAndFlush methods with separate persist/remove + flush calls in all MikroORM repository files.

Files Updated (7 repositories):

  • SessionRepository.ts
  • UserPromptRepository.ts
  • ClaudeMdRepository.ts
  • ObservationRepository.ts
  • TaskRepository.ts
  • DocumentRepository.ts
  • SummaryRepository.ts

Changes:

// Before (deprecated)
await this.em.persistAndFlush(entity);
await this.em.removeAndFlush(entity);

// After (recommended)
this.em.persist(entity);
await this.em.flush();

this.em.remove(entity);
await this.em.flush();

This is the recommended pattern per MikroORM documentation and resolves TS6385 deprecation warnings.

Closes #149

## Summary Replace deprecated `persistAndFlush` and `removeAndFlush` methods with separate `persist`/`remove` + `flush` calls in all MikroORM repository files. ### Files Updated (7 repositories): - SessionRepository.ts - UserPromptRepository.ts - ClaudeMdRepository.ts - ObservationRepository.ts - TaskRepository.ts - DocumentRepository.ts - SummaryRepository.ts ### Changes: ```typescript // Before (deprecated) await this.em.persistAndFlush(entity); await this.em.removeAndFlush(entity); // After (recommended) this.em.persist(entity); await this.em.flush(); this.em.remove(entity); await this.em.flush(); ``` This is the recommended pattern per MikroORM documentation and resolves TS6385 deprecation warnings. Closes #149
refactor(database): replace deprecated MikroORM methods
All checks were successful
CI / check (pull_request) Successful in 0s
CI / build (pull_request) Successful in 42s
CI / validate-plugin (pull_request) Successful in 36s
05119a79aa
Replace deprecated persistAndFlush/removeAndFlush with persist/remove + flush
in all 7 MikroORM repository files:
- SessionRepository.ts
- UserPromptRepository.ts
- ClaudeMdRepository.ts
- ObservationRepository.ts
- TaskRepository.ts
- DocumentRepository.ts
- SummaryRepository.ts

The separate persist/remove + flush pattern is the recommended approach
per MikroORM documentation.

Closes #149

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merge branch 'main' into refactor/149-mikro-orm-deprecated-methods
All checks were successful
CI / build (pull_request) Successful in 47s
f5819bde74
jonas.hanisch deleted branch refactor/149-mikro-orm-deprecated-methods 2026-01-24 12:21:41 +00:00
Sign in to join this conversation.
No description provided.