I'm using DB-first approach. On every deployment I need to upgrade my the production DB with the new columns or changes to the existing columns.
I was looking at ways to generate a generic SQL script according to the EDMX the problem is that all script generation\ migration capabilities of Entity-Framework are for Code-First approach
Is there a way to create a SQL Script that would follow the following logic:
-
if table not exist create the table (with no columns) if column X
-
in table Y not exist add the column
- if column exist check if types are the same if not alter the type (i know this can cause problems i'm still thinking on how to tackle that)
-
if foreign key not exist create.
-
if foreign key exist but should not drop it
any suggestion ?
Aucun commentaire:
Enregistrer un commentaire