How to re-create table in sql by Entityframework

Asked

Viewed 363 times

1

I deleted a table directly in the database, performed the update-database command in Packmanager Console but the table was not created again. Which command should I use to recreate this table?

1 answer

1

This is not the correct way to perform this procedure. The correct way would be to reverse the migration using the command:

Update-Database -TargetMigration:NomeDeUmaMigracaoAnteriorSemOPontoCS

If you want to reverse everything, use:

Update-Database -TargetMigration:0

Note that the reversal executes all methods Down of Migrations selected for reversal. Therefore, it may be that not only the table in question is deleted, but other changes as well.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.