Add IEventStoreOptions.IgnoreIndex(name)#4342
Merged
jeremydmiller merged 3 commits intoMay 8, 2026
Merged
Conversation
Mirrors DocumentMapping.IgnoreIndex for the event-store tables. The new ignore list is consulted by EventsTable, StreamsTable, and EventProgressionTable so external mechanisms (e.g. a custom IFeatureSchema declaring a GIN index on mt_events.headers) can register indexes Marten's schema sync should leave alone.
This was referenced May 11, 2026
Merged
This was referenced May 14, 2026
This was referenced May 25, 2026
This was referenced Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4341.
What
Adds
IEventStoreOptions.IgnoreIndex(string indexName), mirroring the existingDocumentMapping.IgnoreIndex(string indexName)for document tables. The ignore list is consulted by all three event-store tables (mt_events,mt_streams,mt_event_progression) so a singleIgnoreIndex("foo")covers any of them.Why
If you add an index on a Marten-managed event-store table outside Marten's own schema (e.g. a custom
IFeatureSchemadeclaringCREATE INDEX ... ON mt_events USING GIN (headers jsonb_path_ops)), the schema diff sees an unmanaged index on a managed table and drops it on the nextApplyAllDatabaseChangesOnStartup(). The same gap was already solved for documents — this PR brings the event-store side to parity.Usage
Changes
IEventStoreOptions: newIgnoreIndex(string)method +IReadOnlyList<string> IgnoredIndexes { get; }.IReadOnlyEventStoreOptions: sameIgnoredIndexesproperty.EventGraph: backing list + idempotent add + null/whitespace guard.EventsTable,StreamsTable,EventProgressionTable: copyevents.IgnoredIndexesonto the Weasel baseTable.IgnoredIndexes(mirrorsDocumentTable.cs:25-26).src/EventSourcingTests/ignoring_indexes_on_event_store_tables.cs(7 tests, all passing on net8/9/10 — no DB required).docs/events/configuration.md.Opened as draft per the discussion in #4341 — happy to adjust scope or naming.