Http://www.cnblogs.com/stevenhqq/archive/2013/04/18/3028350.html
Solution for multi-project data migration, you need to write the full path name.
Pm> enable-migrations-contexttypename "Huasuda.IntelligenceCommunity.Model.EntityContext"- ProjectName "Huasuda.IntelligenceCommunity.Model"-startupprojectname " Huasuda.IntelligenceCommunity.MVC"-connectionstringname" DefaultConnection "-verbose
pm> add-migration-name "1"-projectname "Huasuda.IntelligenceCommunity.Model"-startupprojectname " Huasuda.IntelligenceCommunity.MVC"-connectionstringname"defaultconnection"-verbose
Pm>update-database-projectname "Huasuda.IntelligenceCommunity.Model"-startupprojectname " Huasuda.IntelligenceCommunity.MVC"-connectionstringname"defaultconnection"-verbose
name Enable-migrations Digest enables Code first migrations in a project. Grammar enable-migrations [-contexttypename<String>] [-enableautomaticmigrations] [-projectname<String>] [-startupprojectname<String>] [-conne ctionstringname<String>] [-force] [<commonparameters>] enable-migrations [-contexttypename<String>] [-enableautomaticmigrations] [-projectname<String>] [-startupprojectname<String>]-connec tionstring<String>-connectionprovidername<String>[-force] [<commonparameters>] Description enables migrations by scaffolding a migrations configuration class in the project. If The target database is created by a initializer, an initial migration would be created (unless automatic migrati ONS is enabled via the Enableautomaticmigrations parameter). Parameter-contexttypename<String>Specifies the context to use. If omitted, migrations would attempt to locate a single context type in the target project. Is it necessary? False position? Named does the default value accept pipeline input? False to accept wildcard characters? false-enableautomaticmigrations [<Switchparameter>] Specifies whether automatic migrations is enabled in the scaffolded migrations configuration. If ommitted, automatic migrations'll be disabled. Is it necessary? False position? Named Default value False whether to accept pipeline input? False to accept wildcard characters? False-projectname<String>Specifies the project that the scaffolded migrations configuration class would be is added to. If omitted, the default project selected in Package Manager console is used. Is it necessary? False position? Named does the default value accept pipeline input? False to accept wildcard characters? False-startupprojectname<String>Specifies the configuration file to use for named connection strings. If omitted, the specified project ' s configuration file is used. Is it necessary? False position? Named does the default value accept pipeline input? False to accept wildcard characters? False-connectionstringname<String>Specifies the name of a connection string to use from the application ' s configuration file. Is it necessary? False position? Named does the default value accept pipeline input? False to accept wildcard characters? False-connectionstring<String>Specifies the the connection string to use. If omitted, the context ' s default connection would be used. Is it necessary? True location? Named does the default value accept pipeline input? False to accept wildcard characters? False-connectionprovidername<String>Specifies the provider invariant name of the connection string. Is it necessary? True location? Named does the default value accept pipeline input? False to accept wildcard characters? False-force [<Switchparameter>] Specifies that the migrations configuration is overwritten when running more than once for a given pro Ject. Is it necessary? False position? Named Default value False whether to accept pipeline input? False to accept wildcard characters? False<commonparameters>this Cmdlet supports common parameters: Verbose, Debug, ErrorAction, errorvariable, Warningaction, warningvariable, Outbuff Er, pipelinevariable and outvariable. For more information, see About_commonparameters (http://go.microsoft.com/fwlink/?LinkID=113216).
EF Data Migration