Skip to content

feat: add automatic event journal migration system#8

Merged
guillaumebadin merged 1 commit intomainfrom
purrfect-cesium
Apr 2, 2026
Merged

feat: add automatic event journal migration system#8
guillaumebadin merged 1 commit intomainfrom
purrfect-cesium

Conversation

@guillaumebadin
Copy link
Copy Markdown

Summary

  • Add EventMigration abstraction with typed factory for compile-time exhaustivity checking on sealed enum event types
  • Add SkunkMigrations and DoobieMigrations runners that automatically track and apply pending migrations on startup (Flyway-like migrations table)
  • Add migrations table DDL to PGSchema.eventsourcing() output
  • Add full working example (MigrationExample.scala) showing V1→V2→V3 event evolution
  • Add tutorial (docs/tutorials/5_migrations.md) covering schema evolution, compile-time safety, and best practices

Test plan

  • sbt postgresJVM/compile skunkBackendJVM/compile doobieBackendJVM/compile examplesJVM/compile — all pass
  • sbt scalafmtAll — formatted
  • sbt headerCheckAll — license headers verified
  • Integration test with Docker PostgreSQL: insert V1 events, run migrations, verify V3 format and idempotency

🤖 Generated with Claude Code

Add Flyway-like event migration support that automatically tracks and
applies pending migrations on startup. Migrations transform journal
payloads in-place with compile-time exhaustivity checking via Scala 3
sealed enum pattern matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@guillaumebadin guillaumebadin merged commit cc00290 into main Apr 2, 2026
12 of 20 checks passed
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.

2 participants