SQL Server versioning integrated with the Entity Framework

1

In the company I worked with, I opted to create the templates from the database with Entity Power Tools .

We have an online version of our application and sites for testing and development.

When it is necessary to change something in the models, we change it in the database and generate the models again ... until then, we use versioning and everyone gets the same models.

The problem is the changes in the database, for example:

  

A field VALUE_NOTA was double now turned into decimal

So we have to make this change in SQL for all machines.

Is there a way to do a versioning of a table structure in SQL Server?

    
asked by anonymous 02.09.2014 / 20:58

1 answer

1

The best thing would be to use Migrations , but as the questioner asked it to be not possible, I'll suggest a workaround.

When generating your Migrations , execute a Update-Database immediately with the following command:

Update-Database -Verbose

This will cause the executed SQL to be shown in the Console. Save this Log to any directory in the project with the .sql extension.

When publishing your project, run Migrations in order. The result should be very similar to that of the automated Entity Framework.

    
03.09.2014 / 01:15