How to re-create table in sql by Entityframework

1

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?

    
asked by anonymous 14.01.2016 / 00:44

1 answer

1

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.

    
14.01.2016 / 03:42