none
Entity Framework Code-Based Migration - Visual Studio Lockup on Update-Database -Script RRS feed

  • Question

  • Using EF 4.3.1 code-based migrations. I have added a new migration (after the initial) and done an update-database. Now I want to generate a database script file so I run:

    Update-Database -Script -SourceMigration:$InitialDatabase

    When I do that, Visual Studio locks up. I see 2 new tabs: SqlQuery_1.sql and tmp5003.sql

    Any idea what is causing this and how to get past it?

    Thursday, March 15, 2012 9:25 PM

Answers

  • Hi Mark,

    Update-Database command parameter are here:

    SYNTAX
        Update-Database [-SourceMigration <String>] [-TargetMigration <String>] [-Script] [-Force] [-ProjectName <String>] [-StartUpProjectName <String>]
         [-ConfigurationTypeName <String>] [-ConnectionStringName <String>] [<CommonParameters>]
        
        Update-Database [-SourceMigration <String>] [-TargetMigration <String>] [-Script] [-Force] [-ProjectName <String>] [-StartUpProjectName <String>]
         [-ConfigurationTypeName <String>] -ConnectionString <String> -ConnectionProviderName <String> [<CommonParameters>]

    You can use "get-help update-database -full" to get the detail information.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 19, 2012 7:30 AM
    Moderator