Skip to content

Fix EventTagTable and NaturalKeyTable FK with UseArchivedStreamPartitioning#4194

Merged
jeremydmiller merged 1 commit intomasterfrom
fix/4190-archived-stream-partitioning-fk
Mar 23, 2026
Merged

Fix EventTagTable and NaturalKeyTable FK with UseArchivedStreamPartitioning#4194
jeremydmiller merged 1 commit intomasterfrom
fix/4190-archived-stream-partitioning-fk

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Fixes Failed to create db schema with strongly-typed Id and UseArchivedStreamPartitioning since v8.24.0 #4190 - InvalidForeignKeyException when using strongly-typed IDs with UseArchivedStreamPartitioning = true
  • When UseArchivedStreamPartitioning is enabled, mt_events is list-partitioned by is_archived, adding it to the primary key. EventTagTable and NaturalKeyTable must include is_archived in their FK references and have the column present
  • EventTagTable: adds is_archived column with list partitioning and includes it in the FK to mt_events when partitioning is enabled
  • NaturalKeyTable: includes is_archived in the FK to mt_streams when partitioning is enabled (it already had the column)

Test plan

  • Added Bug_4190_archived_partitioning_with_strong_typed_id tests verifying schema creation, FK correctness, and idempotency
  • All existing partitioning tests pass (30 in CoreTests)
  • All tag-related event sourcing tests pass (41 in EventSourcingTests)
  • CI should validate full test matrix

🤖 Generated with Claude Code

…ioning (#4190)

When UseArchivedStreamPartitioning is enabled, mt_events is partitioned by
is_archived which adds it to the primary key. EventTagTable and NaturalKeyTable
must include is_archived in their FK references and have the column themselves.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Failed to create db schema with strongly-typed Id and UseArchivedStreamPartitioning since v8.24.0

1 participant