简体   繁体   中英

Update database schema from entities (without using entity framework migration) in .net core

I'm looking for a tools (library or a nuget package) that gives me the difference script (in SQL server script format (as string or as a file) ) between my entities and my database tables (SQL server) and have the capability to automatically run change script against database or give the change script to user and let the user decide what to do with that.

The most important thing to me is change script (between entities and tables) but I'd be double happy if it has the capability of manual and automatic running of the change script against database

EF core migration does this, however I don't want to use EF core migration for this purpose, I don't want to use EF core complex migration structure, All I need is just a change script that's all,so I'm looking for another alternative .net core friendly tools (I mean rather than EF Core) that satisfy my needs

Although I see that you find EF Migrations Too complex, the only parameters you need to use is From and To . You can use the command below in order to create Output Script .

dotnet ef migrations script | out-file ./mig-script.sql

or

Script-Migration -From <PreviousMigration> -To <LastMigration>

You should use a database project, and let it find and publish schema changes. You can then use EF Core Power Tools to generate the DbContext and Poco classes

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