Skip to content

Update HasTrigger XML documentation - #38706

Merged
AndriySvyryd merged 4 commits into
mainfrom
copilot/update-hastrigger-xml-documentation
Jul 28, 2026
Merged

Update HasTrigger XML documentation#38706
AndriySvyryd merged 4 commits into
mainfrom
copilot/update-hastrigger-xml-documentation

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

HasTrigger only registers the trigger annotation in the EF model — it never creates the trigger in the database. MigrationsModelDiffer emits no trigger operations, so a migration can apply cleanly while a trigger the model declares never exists, with no indication of the gap.

Changes

  • XML docs (TableBuilder, SplitTableBuilder, OwnedNavigationTableBuilder, OwnedNavigationSplitTableBuilder): Expanded <remarks> to state explicitly that HasTrigger does not create the trigger and that DDL must be added manually via migrationBuilder.Sql.

Copilot AI linked an issue Jul 27, 2026 that may be closed by this pull request
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
Copilot AI requested a review from AndriySvyryd July 27, 2026 19:48
Comment thread src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs Outdated
@AndriySvyryd AndriySvyryd changed the title Update HasTrigger XML documentation and warn when trigger DDL is missing from migration Update HasTrigger XML documentation Jul 27, 2026
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI requested a review from AndriySvyryd July 27, 2026 19:54
@AndriySvyryd
AndriySvyryd requested a review from Copilot July 27, 2026 19:55
@AndriySvyryd
AndriySvyryd marked this pull request as ready for review July 27, 2026 19:55
@AndriySvyryd
AndriySvyryd requested a review from a team as a code owner July 27, 2026 19:55
@AndriySvyryd
AndriySvyryd requested a review from cincuranet July 27, 2026 19:56
@AndriySvyryd
AndriySvyryd enabled auto-merge (squash) July 27, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> on HasTrigger to 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.

Comment thread src/EFCore.Relational/Metadata/Builders/TableBuilder.cs Outdated
Comment thread src/EFCore.Relational/Metadata/Builders/SplitTableBuilder.cs Outdated
Comment thread src/EFCore.Relational/Metadata/Builders/OwnedNavigationTableBuilder.cs Outdated
Comment thread src/EFCore.Relational/Metadata/Builders/OwnedNavigationSplitTableBuilder.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 23:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

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>
@AndriySvyryd
AndriySvyryd merged commit 37bef29 into main Jul 28, 2026
16 checks passed
@AndriySvyryd
AndriySvyryd deleted the copilot/update-hastrigger-xml-documentation branch July 28, 2026 06:37
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 29, 2026
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.

Update HasTrigger XML documentation

4 participants