Upgrade / upgrade your SQL database to a new version of the schema, keeping as much old data as possible

I have not used to work with SQL, and I almost do not know any DDL scripts. I am using ADO.NET Entity Framework 4 in Visual Studio 2010 with an EDMX designer and self-employment generator. This does the hard work for me, and I get a DDL-script that will be used to create the database when it does not exist. Everything goes fine ... Then I make changes to my EDMX model, possibly adding a property to the entity, and I get a new DDL to create a new database. But what about the old one? This database now contains some data, and of course I would like to move it to a new version. Ideally, I would like some tool to generate UPGRADE-DDL from my old CREATE-DDL to my new CREATE-DDL, while saving as much data as possible from the old database. But I can not find such a function in VS2010,and I can’t find any resources about this when searching on the net, which seems strange because it must be a very common problem, right? Or am I missing something? I can make many changes and additions to my schema using the EDMX constructor, and I do not want to manually write the DDL script update. Im not good enough with DDL to do this ... How does everyone do it? I'm confused...

+3
source share
2 answers

The Entity Designer Database Generator Power Supply seems to be the solution! It can generate update scripts for edmx schemas. Fine!

+1
source

Ok, welcome the limitations of automatic db generation. Learn to live with them. Automatically generating a circuit from an O / R device will never work well.

-4
source

Source: https://habr.com/ru/post/1767916/


All Articles