Alter a view in EntityFramework CF with migration files

c# ef-code-first ef-migrations entity-framework-6 sql

Question

We are using the Entity Framework (Version 6) and a code-first database for our project. As a result, we create a migration file in a class to update the database whenever we wish to alter a function or a table.Update-Database ( the window for Paket-Manager).

We alter the migration file, which, as an example, would look something like this if we wish to update anything that didn't get a class (such as a view or a procedure):

public override void Up()
{
  //Some other code... 

  Sql("ALTER VIEW ExampleView AS Select [Endless Lines of code]");
}

With larger vistas, things quickly get disorganised.

My inquiry is

Is there a "smart" method to make minor updates to a process or even a view (such as altering anything in theFROM without generating a lengthy SQL query that counts several rows only to achieve that?

1
0
5/30/2017 9:41:00 AM

Accepted Answer

ZZZ_tmp
0
5/30/2017 9:54:22 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow