Skip to main content

Use:

CLI

> dotnet ef database update <previous-migration-name>

Package Manager Console

PM> Update-Database <previous-migration-name>

Example:

PM> Update-Database MyInitialMigration

Then try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

If using PMC, Try: PM> update-database 0 This will wipe the database and allow you to remove the Migration Snapshot on your Solution

Use:

CLI

> dotnet ef database update <previous-migration-name>

Package Manager Console

PM> Update-Database <previous-migration-name>

Example:

PM> Update-Database MyInitialMigration

Then try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

Use:

CLI

> dotnet ef database update <previous-migration-name>

Package Manager Console

PM> Update-Database <previous-migration-name>

Example:

PM> Update-Database MyInitialMigration

Then try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

If using PMC, Try: PM> update-database 0 This will wipe the database and allow you to remove the Migration Snapshot on your Solution

Added Package Manager Console code example
Source Link
JohnB
  • 19.1k
  • 17
  • 102
  • 114

Use  :

CLI

> dotnet ef database update <previous-migration-name>

Package Manager Console

PM> Update-Database <previous-migration-name>

Example:

PM> Update-Database MyInitialMigration

Then try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

Use  dotnet ef database update <previous-migration-name>

Then try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

Use:

CLI

> dotnet ef database update <previous-migration-name>

Package Manager Console

PM> Update-Database <previous-migration-name>

Example:

PM> Update-Database MyInitialMigration

Then try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

added a sentence
Source Link
adem caglin
  • 24.5k
  • 10
  • 65
  • 80

Use dotnet ef database update <previous-migration-name>

removingThen try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

Use dotnet ef database update <previous-migration-name>

removing migration doesn't work because you applied changes to database.

Use dotnet ef database update <previous-migration-name>

Then try to remove last migration.

Removing migration without database update doesn't work because you applied changes to database.

Source Link
adem caglin
  • 24.5k
  • 10
  • 65
  • 80
Loading