I deleted a table directly from the database, I ran the update-database command in the PackManager Console, but the table was not created again. Which command should I use to recreate this table?
I deleted a table directly from the database, I ran the update-database command in the PackManager Console, but the table was not created again. Which command should I use to recreate this table?
This is not the correct way to do this. The correct would be to reverse the migration using the command:
Update-Database -TargetMigration:NomeDeUmaMigracaoAnteriorSemOPontoCS
If you want to revert everything, use:
Update-Database -TargetMigration:0
Note that rollback executes all Down
methods of Migrations
selected for rollback. Therefore, it may be that not only the table in question is deleted, but other changes as well.