C# 클래스 Insight.Database.Schema.SchemaInstaller

파일 보기 프로젝트 열기: jonwagner/Insight.Database.Schema 1 사용 예제들

공개 메소드들

메소드 설명
CreateDatabase ( string connectionString ) : bool

Create a database on the specified connection if it does not exist.

DatabaseExists ( string connectionString ) : bool

Check to see if the database exists

Diff ( string schemaGroup, SchemaObjectCollection schema ) : bool

Determine if the given schema has differences with the current schema.

DropDatabase ( string connectionString ) : bool

Drop a database if it exists.

SchemaInstaller ( DbConnection connection ) : System

Initialize the SchemaInstaller to work with a given SqlConnection.

ScriptChanges ( string schemaGroup, SchemaObjectCollection schema ) : string

Script the changes that would be applied to the database.

Uninstall ( string schemaGroup ) : void

Uninstall a schema group from the database.

This is a transactional operation

비공개 메소드들

메소드 설명
AddObjects ( InstallContext context ) : void

Add all of the objects that need to be added.

CompareByInstallOrder ( Insight.Database.Schema.SchemaObject o1, Insight.Database.Schema.SchemaObject o2 ) : int

Compares two schema objects to determine the appropriate installation order.

CompareByInstallOrder ( Insight.Database.Schema.SchemaRegistryEntry e1, Insight.Database.Schema.SchemaRegistryEntry e2 ) : int

Compares two registry entry objects to determine the appropriate installation order.

DropObjects ( IEnumerable dropObjects ) : void

Drop objects that need to be dropped.

GetColumnDefinition ( dynamic column ) : string
GetColumnsForTable ( string tableName ) : IEnumerable

Get the columns for a table.

GetDefaultDefinition ( dynamic def ) : string

Output the definition of a default.

GetMasterConnectionString ( string connectionString ) : string

Gets the connection string needed to connect to the master database. This is used when creating/dropping databases.

Install ( string schemaGroup, SchemaObjectCollection schema ) : void
OpenMasterConnection ( string connectionString ) : SqlConnection

Opens a connection needed to connect to the master database. This is used when creating/dropping databases.

ScriptColumnsAndConstraints ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject, string oldTableName, string newTableName ) : void
ScriptForeignKeys ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject ) : void
ScriptIndexes ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject, string columnName = null ) : void
ScriptPermissions ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject ) : void

Script the permissions on an object and save the script to add the permissions back later

ScriptStandardDependencies ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject ) : void

Script the standard dependencies such as stored procs and triggers.

ScriptTableUpdate ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject ) : void

Script the update of a table.

ScriptUpdate ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject ) : void

Schedule an update by adding the appropriate delete, update and add records

ScriptXmlIndexes ( InstallContext context, Insight.Database.Schema.SchemaObject schemaObject ) : void
VerifyObjects ( List schemaObjects ) : void

Verify that all of the objects that are supposed to be there really are...

메소드 상세

CreateDatabase() 공개 정적인 메소드

Create a database on the specified connection if it does not exist.
If the database name is invalid.
public static CreateDatabase ( string connectionString ) : bool
connectionString string
리턴 bool

DatabaseExists() 공개 정적인 메소드

Check to see if the database exists
public static DatabaseExists ( string connectionString ) : bool
connectionString string The connection string for the database to connect to.
리턴 bool

Diff() 공개 메소드

Determine if the given schema has differences with the current schema.
public Diff ( string schemaGroup, SchemaObjectCollection schema ) : bool
schemaGroup string The schema group to compare.
schema SchemaObjectCollection The schema to compare with.
리턴 bool

DropDatabase() 공개 정적인 메소드

Drop a database if it exists.
If the database name is invalid or cannot be dropped.
public static DropDatabase ( string connectionString ) : bool
connectionString string
리턴 bool

SchemaInstaller() 공개 메소드

Initialize the SchemaInstaller to work with a given SqlConnection.
public SchemaInstaller ( DbConnection connection ) : System
connection System.Data.Common.DbConnection The SqlConnection to work with.
리턴 System

ScriptChanges() 공개 메소드

Script the changes that would be applied to the database.
public ScriptChanges ( string schemaGroup, SchemaObjectCollection schema ) : string
schemaGroup string The name of the schemaGroup.
schema SchemaObjectCollection The schema to install.
리턴 string

Uninstall() 공개 메소드

Uninstall a schema group from the database.
This is a transactional operation
If schemaGroup is null If any object fails to uninstall
public Uninstall ( string schemaGroup ) : void
schemaGroup string The group to uninstall
리턴 void