Update Database with Migrations CLI on VS for Mac (DotNet Core 2) Update Database with Migrations CLI on VS for Mac (DotNet Core 2) database database

Update Database with Migrations CLI on VS for Mac (DotNet Core 2)


I found the solution. It seems that on VS 2017 for Windows, when you add a Migration, it is automatically added on the solution. But, on VS for Mac, that doesn't happen. You need to manually add the each new migration to the solution. I created the InitialMigration migration and update it to the database. For some reason I don't know why, I removed the migration from the solution and I created the new SecondMigration migration. That's the reason that all the tables that were on InitialMigration were on SecondMigration too.


If you just run update database it will also try to update with previous migration. (which is why its complains about adding whats already there). You can run an update just for one single migration by adding the name of the migration you want to run after the command.