ZZZ Code AI
Report Issues
Suggest Features
Login
EF Core Tools
Chat
Code Explain
More Tools
How to reset all migrations and create a new clean database in EF Core?
<p>With Package Manager Console:</p> <ol> <li><strong>Delete your database</strong>: <code>drop-database</code></li> <li><strong>Delete your migrations</strong>: Delete all migrations manually in your project.</li> <li><strong>Update connection string</strong>: Change your connection string if needed (if you use a new database name)</li> <li><strong>Add the first migration</strong>: <code>add-migration [name]</code></li> </ol> <p>With Command Line:</p> <ol> <li><strong>dotnet ef database drop</strong>: <code>drop-database</code></li> <li><strong>Delete your migrations</strong>: Delete all migrations manually in your project.</li> <li><strong>Update connection string</strong>: Change your connection string if needed (if you use a new database name)</li> <li><strong>Add the first migration</strong>: <code>dotnet ef migrations add [name]</code></li> </ol>
Sponsored by
Entity Framework Extensions
This field is required
A text with a minimum of 10 characters is required
Send
Legal & Licensing
Answer generated by AI may produce inaccurate information about code, people, facts, and more.
Advertising Break!
5
seconds left
Did you know...
That you can now sponsor this project on
GitHub
?