DbProviderServices.CreateDatabaseScript(String, StoreItemCollection) Method

Definition

Generates a data definition language (DDL script that creates schema objects (tables, primary keys, foreign keys) based on the contents of the StoreItemCollection parameter and targeted for the version of the database corresponding to the provider manifest token.

public string CreateDatabaseScript (string providerManifestToken, System.Data.Entity.Core.Metadata.Edm.StoreItemCollection storeItemCollection);
member this.CreateDatabaseScript : string * System.Data.Entity.Core.Metadata.Edm.StoreItemCollection -> string

Parameters

providerManifestToken
String

The provider manifest token identifying the target version.

storeItemCollection
StoreItemCollection

The structure of the database.

Returns

A DDL script that creates schema objects based on the contents of the StoreItemCollection parameter and targeted for the version of the database corresponding to the provider manifest token.

Remarks

Individual statements should be separated using database-specific DDL command separator. It is expected that the generated script would be executed in the context of existing database with sufficient permissions, and it should not include commands to create the database, but it may include commands to create schemas and other auxiliary objects such as sequences, etc.

Applies to