`Remove-Migration` command not removing migrations from TFS Pending Changes
See original GitHub issueCurrent Behvaior
After applying a Migration using the Add-Migration <MigrationName>
command. A new migration is added; however, if I decide to revert those changes and use Remove-Migration
, the latest migration is removed from the project, but is still registered as a pending [add]
change in TFS.
I was expecting that if the migration was removed through the PM Console that the changes would also be undone. These files have to manually have their changes undone from the Pending Changes panel.
Steps to reproduce
- Add a migration with
Add-Migration "MyFancyMigration"
- See that the
MyFancyMigration.cs
andMyFancyMigration.Designer.cs
are listed as adds in Pending Changes. - Try to remove the migration with the
Remove-Migration
command - Note that the migration has not been removed from the Pending Changes
- Try to check in and you should receive a message similar to this:
Could not find file 'C:\<local_path>\Migrations\20180323193556_MyFancyMigration.cs'.
Further technical details
EF Core version: 2.1.3-preview1-final (occurred also on 2.0.2) Database Provider: Microsoft.EntityFrameworkCore.SqlServer Operating system: Windows 10 IDE: VS 2017 15.6.4 Source Control: TFS/VSTS
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:26 (23 by maintainers)
Top Results From Across the Web
Entity-Framework Core Remove-Migration (after add ...
Then, I run an "Remove-Migration" command in the Package Manager Console. ... show as needing to be added in the "Pending changes" window....
Read more >EF Migrations not able to remove migration
I have 5 migrations, but the 5th has been created on accident. It doesn't hold any changes ( Up and Down methods are...
Read more >Managing Migrations - EF Core
Adding, removing and otherwise managing database schema migrations with Entity Framework Core.
Read more >Resetting Entity Framework Migrations to a clean Slate
This post describes the steps on how to remove existing migrations and create a new initial migration from the current schema.
Read more >Entity Framework Core Migrations
Removing A Migration ... The following command removes a migration: ... You will use this command to remove the latest migration. This will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
UPDATE: This is fully functioning as of VS 2019 Preview 1. So I think I’ll close this now, because it can’t be an EF Core problem.
Cool, I will see what I can do then. So is the original intent to have the
Remove-Migration
command take a step back on the Snapshot and remove the latest migration from the project while not removing it from the disk?