Visual Studio has the option when doing a web deploy to "Execute Code First Migrations (runs on application_start)". When you select that check box, Visual Studio configures the destination web site so that Entity Framework automatically deploys the database or updates it by running the MigrateDatabaseToLatestVersion initializer on application start, as explained in this VS web deployment tutorial.
My question is... How does it configure the site so Entity Framework automatically deploys the database or updates. What is Visual Studio actually doing to the publish to accomplish this?