EF Data Migration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.