Update HasTrigger XML documentation - #38706
Merged
Merged
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update HasTrigger XML documentation
Update HasTrigger XML documentation and warn when trigger DDL is missing from migration
Jul 27, 2026
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
AndriySvyryd
marked this pull request as ready for review
July 27, 2026 19:55
AndriySvyryd
enabled auto-merge (squash)
July 27, 2026 19:56
There was a problem hiding this comment.
Pull request overview
Updates the XML documentation for HasTrigger on relational table builder APIs to clarify that the method only records trigger metadata in the EF model and does not generate trigger DDL via migrations—helping prevent a false sense of schema enforcement.
Changes:
- Expanded
<remarks>onHasTriggerto explicitly state no trigger is created in the database. - Added guidance that trigger DDL must be created separately (currently referenced via
migrationBuilder.Sql).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/EFCore.Relational/Metadata/Builders/TableBuilder.cs | Clarifies HasTrigger is model-only and points to manual DDL creation. |
| src/EFCore.Relational/Metadata/Builders/SplitTableBuilder.cs | Same clarification for split-table mapping builder API. |
| src/EFCore.Relational/Metadata/Builders/OwnedNavigationTableBuilder.cs | Same clarification for owned navigation table mapping builder API. |
| src/EFCore.Relational/Metadata/Builders/OwnedNavigationSplitTableBuilder.cs | Same clarification for owned navigation split-table mapping builder API. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
72
to
76
| /// <summary> | ||
| /// Configures a database trigger on the table. | ||
| /// </summary> | ||
| /// <param name="modelName">The name of the trigger.</param> | ||
| /// <returns>A builder that can be used to configure the database trigger.</returns> |
Comment on lines
83
to
87
| /// <summary> | ||
| /// Configures a database trigger on the table. | ||
| /// </summary> | ||
| /// <param name="modelName">The name of the trigger.</param> | ||
| /// <returns>A builder that can be used to configure the database trigger.</returns> |
Comment on lines
72
to
76
| /// <summary> | ||
| /// Configures a database trigger on the table. | ||
| /// </summary> | ||
| /// <param name="modelName">The name of the trigger.</param> | ||
| /// <returns>A builder that can be used to configure the database trigger.</returns> |
Comment on lines
83
to
87
| /// <summary> | ||
| /// Configures a database trigger on the table. | ||
| /// </summary> | ||
| /// <param name="modelName">The name of the trigger.</param> | ||
| /// <returns>A builder that can be used to configure the database trigger.</returns> |
cincuranet
approved these changes
Jul 28, 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.
HasTriggeronly registers the trigger annotation in the EF model — it never creates the trigger in the database.MigrationsModelDifferemits no trigger operations, so a migration can apply cleanly while a trigger the model declares never exists, with no indication of the gap.Changes
TableBuilder,SplitTableBuilder,OwnedNavigationTableBuilder,OwnedNavigationSplitTableBuilder): Expanded<remarks>to state explicitly thatHasTriggerdoes not create the trigger and that DDL must be added manually viamigrationBuilder.Sql.