Permalink
Browse files

Automatically Upgrading on Application Startup

  • Loading branch information...
ajtowf committed Apr 7, 2014
1 parent 410753e commit 8be3b31b24ebb3bd8d67d0e921f80bf72f922054
Showing with 6 additions and 0 deletions.
  1. +6 −0 meetometer/Global.asax.cs
@@ -1,5 +1,8 @@
using System;
+using System.Data.Entity;
using System.Web.Http;
+using meetometer.Migrations;
+using meetometer.Repository;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
@@ -16,6 +19,9 @@ protected void Application_Start(object sender, EventArgs e)
var settings = jsonFormatter.SerializerSettings;
settings.Formatting = Formatting.Indented;
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
+
+ Database.SetInitializer(
+ new MigrateDatabaseToLatestVersion<AppDbContext, Configuration>());
}
}
}

0 comments on commit 8be3b31

Please sign in to comment.