Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

EntityFramework CodeFirst Database Initialize Failing

I'm using the new EntityFramework CodeFirst stuff in my project at http://mvcnews.apphb.com.

However, I'm getting a weird error when trying to run after deploying (on my local side I use a standard SQL Server 2010 connection string)

CREATE DATABASE permission denied in database 'master'.

Has anyone had any experience with EntityFramework Code First and AppHarbor?

I've also tried to connect to the DB using SQL Server Management studio but get a "Cannot open default database for user" error.

Thanks,

Jacob

  1. Yeah, I think there's a workaround. EF code first tends to drop and re-create the database which won't work on AppHarbor.

  2. friism closed this discussion on 31 Mar, 2011 01:13 AM.

  3. jacob.gable re-opened this discussion on 31 Mar, 2011 02:50 AM

  4. Thanks, that looks like it's getting me closer, but now I'm getting a login failed error

    http://mvcnews.apphb.com
    Cannot open database "db1634" requested by the login. The login failed.
    Login failed for user 'db1634'.
    My server is db002

    I got the same thing when I tried to log in with Management Studio.

  5. Yeah, EF dropped the dB. Can you delete, and create a fresh one?

    On 30/03/2011, at 19.50, "jacob.gable"
    <[email blocked]>
    wrote:

  6. Aww yeah... that was it. I had an explicit call to Database.Delete. Now I'm looking good. Thanks for the help.

  7. friism closed this discussion on 31 Mar, 2011 03:15 PM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac