Q:

Deploy MVC 3 app and generate Database (IIS 7, SQL Server 2008)

I'm trying to deploy an MVC app to a server which is running IIS 7 and has SQL Server 2008 R2. I have set up web config transformations so that I can dev on my local machine with Sql Server CE and added a connection string in the Release config so that it points to a new (empty) database I created on the server. The application is written code first.
How do I generate the required tables for the application on the server? I have tried to deploy my app through VS publish using File System as the publish method but this does not do anything on the database side. Do I need to use Web Deploy as the publish method (would this make a difference)? A database initalise strategy such as CreateDatabaseIfNotExists?
Completely at a loss here so any tips or links to walkthroughs would be appreciated.

A:

As Scott Gu explains it in this blog post, in addition to web config transformations you could also perform database deployments during the publishing process:

VS 2010 allows you to optionally deploy a database, along with your
  web application files, when are using the “Web Deploy” option as your
  deployment mechanism. Databases deployed this way can include both
  schema and data, and can optionally also include change scripts to
  update existing databases.
ASP.NET Web Projects in VS 2010 have a special page within their the
  “project properties” settings to configure database deployments:

