fix: no-op redundant AddExternalLoginsUserForeignKey migration#938
fix: no-op redundant AddExternalLoginsUserForeignKey migration#938Chris0Jeky merged 1 commit intomainfrom
Conversation
Adversarial Self-Review1. Is the no-op approach safe for databases that already ran this migration?Yes. Databases that already ran 2. Is the no-op approach safe for fresh databases that haven't run it yet?Yes. Fresh databases will run all migrations in order:
3. Did I accidentally modify the model snapshot?No. 4. Is the comment accurate about which earlier migration added the FK?Yes. Verified that 5. Could this break EF Core's migration state tracking?No. EF Core tracks migrations by their ID (the VerdictNo issues found. The change is safe for all database states (fresh, existing, and rollback scenarios). |
There was a problem hiding this comment.
Code Review
This pull request modifies the AddExternalLoginsUserForeignKey migration to be a no-op, as the foreign key was already established in a previous migration. This ensures database consistency without causing errors during migration execution. I have no feedback to provide.
Independent Adversarial ReviewVerdict: APPROVED -- no issues found.Migration Redundancy VerificationI independently confirmed the FK duplication:
The second migration was entirely redundant. Diff Correctness
Scenario Analysis
CI Status
Bot FindingsNo bot review comments or inline findings to address. One COMMENTED review with no feedback. ConclusionThe change is minimal, correct, and safe for all database states. No fixes needed. |
FK_ExternalLogins_Users_UserId was already added in migration 20260402230822_AddTokenInvalidatedAt. The later migration 20260422183834_AddExternalLoginsUserForeignKey redundantly re-added the same FK, causing unnecessary table rebuilds on SQLite and potential failures on stricter providers. Replace the Up/Down bodies with empty no-ops so existing databases that already recorded this migration in __EFMigrationsHistory remain valid, while fresh databases simply skip the duplicate operation.
35b0af9 to
aa7ef08
Compare
Adversarial Review (post-rebase)Reviewer: Rebased onto current Diff Verification
FK Duplication ConfirmedIndependently verified the redundancy:
Up() SafetyEmpty body with explanatory comment. No residual code that could execute. Correct. Down() SafetyEmpty body -- this is the critical check. The original Scenario Matrix
Bot CommentsGemini: "no feedback to provide" -- nothing to address. CIAll checks re-triggered after rebase onto main. Pending. Pre-existing API Integration failures (CORS/HSTS tests due to missing VerdictAPPROVED. The change is minimal, correct, and safe for all database states. The no-op Down() is actually an improvement over the original, which would have erroneously dropped a FK owned by an earlier migration. |
Summary
20260422183834_AddExternalLoginsUserForeignKeymigration whoseUp/Downbodies redundantly re-addedFK_ExternalLogins_Users_UserId, which was already added in20260402230822_AddTokenInvalidatedAt__EFMigrationsHistoryon existing databasesAddForeignKey/DropForeignKeycallsCloses #932
Test plan
dotnet build backend/Taskdeck.sln -c Release-- 0 errorsdotnet test backend/Taskdeck.sln -c Release -m:1-- all test suites pass (5 pre-existing env-specific failures in CORS/HSTS/MCP telemetry tests are unrelated).csmigration file changed; Designer file and model snapshot are untouched20260402230822_AddTokenInvalidatedAt.cs(lines 20-26)