I have created a code -first entity framework migration and applied to the database, is there a way I can rename this migration ?
You cannot rename after applying a migration to Database. But you can delete and add another migration with same name or other name.
First reset the migration to last migration
PM> update-database -TargetMigration:{lastmigrationname}
If this is the first migration then
PM> update-database -TargetMigration:0
Delete the existing migration and relevant files from the source code
Add the migration using the name you want
PM> add-migration {MigrationName}
Then update the database with new migration created
PM> update-database {MigrationName}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With