Methods to handle schema migration operations.
Methods
ApplyCorrections
(MigrationOperation) Method
ApplyCorrections (MigrationOperation migrationOperation)
Set required properties on the migrationOperation to appropriate default values, based on other values set by the migration script and/or the database type.
ApplyCorrections
(AddColumnOperation) Method
ApplyCorrections (AddColumnOperation operation)
Apply corrections for an AddColumnOperation, which could be standalone, or part of a create table operation.
CheckDatabaseSchema
CheckDatabaseSchema ()
Compare the value matching the SchemaName property with the versions of available scripts, and apply any schema updates which have not already been applied.
ExecuteCommand
(DatabaseSchemaScript, String) Method
ExecuteCommand (DatabaseSchemaScript script, String command)
Execute the command specified as string in command.
ExecuteCommand
(DatabaseSchemaScript, MigrationOperation) Method
ExecuteCommand (DatabaseSchemaScript script, MigrationOperation operation)
Execute the command represented as a MigrationOperation object in operation.
GetSchemaVersion
(String) Method
GetSchemaVersion (String schemaName)
Retrieve the version number of the latest schema update that has been applied for the specified schema name.
RunDatabaseScripts
(String, Version, IList<DatabaseSchemaScript>) Method
RunDatabaseScripts (String schemaName, Version currentSchemaVersion, IList<DatabaseSchemaScript> scripts)
Execute all scripts which have a version greater than the current schema version.
Parameters
| Name |
Type |
|
schemaName
|
String
|
|
currentSchemaVersion
|
Version
|
|
scripts
|
System.Collections.Generic.IList<Nucleus.Data.Common.DatabaseSchemaScript>
|
RunScript
(String, DatabaseSchemaScript) Method
RunScript (String schemaName, DatabaseSchemaScript script)
Execute the commands in the script file. Commands are separated by "GO", followed by CRLF, LR or CR.
SchemaTableExists
SchemaTableExists ()
Check whether the Schema table exists in a database-agnostic way by quering it.
UpdateSchemaVersion
(String, Version) Method
UpdateSchemaVersion (String schemaName, Version version)
Add or update a record in the schema table with the specified schema name and version.