简体   繁体   中英

Is there an EF Core Package Manager Console command that performs the same function as the Add-Migration <name> -IgnoreChanges command in EF6

I often target existing databases, I have all the tables mapped but the program thinks it is out of agreement with SQL Server. In EF6 I would add a migration using ignore changes then call update-database and that always worked for me. I like using this method as my understanding was the EF would not push any actual changes to the database (for example if the tables mapped weird, I had a situation where EF would completely whiff on the foreign key connections).

My question is there a similar ability in EF Core using the package manager console.

Alternatively, if the ignorechanges parameter has been deprecated, is there anyway to sync the C# models (ie some parameter within update-database maybe?) with the SQL Server database that guarantees no modifications from C# can be pushed to the production tables, but down stream changes can be received?

You can manually edit the generated migration C# code and comment out the contents of the Up() method to get the same effect on EF Core.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM