Skip to content

Add -NoBuild support to PMC Update-Database#38681

Merged
AndriySvyryd merged 3 commits into
mainfrom
copilot/fix-update-database-warning-nu1902
Jul 21, 2026
Merged

Add -NoBuild support to PMC Update-Database#38681
AndriySvyryd merged 3 commits into
mainfrom
copilot/fix-update-database-warning-nu1902

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #38677

Update-Database in Package Manager Console always triggers a build, which can cause the command to stop on NuGet vulnerability warnings like NU1902 even when users only need to apply migrations. This aligns Update-Database with the existing Add-Migration -NoBuild escape hatch.

  • PMC command surface

    • Added NoBuild switch parameter to Update-Database in EntityFrameworkCore.psm1.
    • Forwarded the flag to the shared execution path via -skipBuild:$NoBuild.
  • Help text

    • Documented NoBuild in both scripts for Update-Database.
# New usage to bypass build-time NU1902 blocking in PMC
Update-Database -NoBuild

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Add-Migration and Update-Database commands failing due to NU1902 Add -NoBuild support to PMC Update-Database Jul 21, 2026
Copilot AI requested a review from AndriySvyryd July 21, 2026 03:00
@AndriySvyryd
AndriySvyryd requested a review from Copilot July 21, 2026 03:01
Comment thread src/EFCore.Tools/tools/EntityFrameworkCore.PS2.psm1 Outdated
@AndriySvyryd
AndriySvyryd marked this pull request as ready for review July 21, 2026 03:03
@AndriySvyryd
AndriySvyryd requested a review from a team as a code owner July 21, 2026 03:03

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

Adds a -NoBuild escape hatch to the Package Manager Console Update-Database command so users can apply migrations without triggering a build (e.g., avoiding NU1902 build blocking), aligning with the existing Add-Migration -NoBuild behavior.

Changes:

  • Added NoBuild switch and help text to Update-Database in the primary PMC module.
  • Forwarded -NoBuild to the shared execution path via -skipBuild:$NoBuild.
  • Updated the legacy PS2 module signature/help to keep parameter binding consistent across module variants.

Reviewed changes

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

File Description
src/EFCore.Tools/tools/EntityFrameworkCore.psm1 Adds Update-Database -NoBuild and wires it to the shared EF helper via -skipBuild.
src/EFCore.Tools/tools/EntityFrameworkCore.PS2.psm1 Adds NoBuild to the Update-Database signature/help for compatibility with the PS2 variant.

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 03:08

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.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI requested a review from AndriySvyryd July 21, 2026 03:08
@AndriySvyryd
AndriySvyryd requested a review from cincuranet July 21, 2026 04:50
@AndriySvyryd
AndriySvyryd enabled auto-merge (squash) July 21, 2026 04:51
@AndriySvyryd
AndriySvyryd merged commit 8b6e6c2 into main Jul 21, 2026
16 checks passed
@AndriySvyryd
AndriySvyryd deleted the copilot/fix-update-database-warning-nu1902 branch July 21, 2026 12:28
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.

Add-Migration and Update-Database fail with warning NU1902

4 participants