I developed a fairly simple web application using entity code first. I realized after several hours of frustration that, although localdb is SQL Server Express, it is not really intended to be used to create a publish (publish wizard). FYI I am using EF 6.1.3, SQL Server 2014, VS 2013 and IIS 7.
If I understand correctly when you click publish from localdb, all you really do is copy the localdb database to your IIS 7 server. I couldnโt understand why, when I updated my lodaldb database through VS migrations, what The base of my production server was not updated. I understand (and believe that now) that these are actually two different instances of localdb and therefore not the same data.
OK, whatever I do - I did with localdb, and I created a real SQL Server 2014 db on my machine. I googled for many hours and can't figure out what to do now. I have a few questions:
How to manage this new database using EF? For example, suppose I want to add a new column. First I add it to my localdb, do some tests and do the migration using Add-Migration blah, then Update-Database ... Should I then generate a SQL script using VS, and then manually run it in the production database server?
I know that this is not very convenient, but instead of using a local database with an entity infrastructure, can I just bind EF to a real SQL Server intermediate test database and skip all this localdb bull *** *? Then could I control it with the first transfer codes and keep everything in sync?
Should I use Initializer? I read conflicting posts about whether to use these or not for production db (like this one)
public class PricedNotesInitializer: MigrateDatabaseToLatestVersion <...,... > {
}
, - , . , .
.