I have a project that I am working on. While I have been coding it I have created the database on the Local SQL lite on my machine. Now, I need to put it into production and I cannot get the migrations to create anything that is not blank.
Here is my old connection String:
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=helpdesk;Integrated Security=True" providerName="System.Data.SqlClient" />
I changed it into this:
<add name="DefaultConnection" connectionString="Server=SQL50;Database=HelpDesk;Trusted_Connection=true;" providerName="System.Data.SqlClient" />
I have tried from this thread (Reset Entity-Framework Migrations):
- Delete the migrations folder in your project
- Delete the __MigrationHistory table in your database (may be under system tables) - However this one doesn't make sense because this is a new database and therefore has no migrations yet.
Whenever I try to create a new migration this is what I get:
public partial class Initial : DbMigration
{
public override void Up()
{
}
public override void Down()
{
}
}
I found this link about Initializers as suggested by Steve Greene Below (http://www.codeguru.com/csharp/article.php/c19999/Understanding-Database-Initializers-in-Entity-Framework-Code-First.htm)
and it suggests using this line of code:
Database.SetInitializer(new DropCreateDatabaseAlways<BlogContext>());
In the main method. However, I do not have a main method or any method similar to that at all.