Class DatabaseVersionValidator
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Validates the database version against the supported assembly version.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Data.SchemaUpdates.Internal
Assembly: EPiServer.Data.dll
Version: 11.20.7Syntax
[ServiceConfiguration(typeof(ISchemaUpdater))]
public class DatabaseVersionValidator : ISchemaUpdater
Constructors
DatabaseVersionValidator(IDatabaseExecutor, IDatabaseConnectionResolver, ScriptExecutor)
Declaration
public DatabaseVersionValidator(IDatabaseExecutor databaseHandler, IDatabaseConnectionResolver databaseConnectionResolver, ScriptExecutor scriptExecutor)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseExecutor | databaseHandler | |
IDatabaseConnectionResolver | databaseConnectionResolver | |
ScriptExecutor | scriptExecutor |
Methods
GetDatabaseVersion()
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the database version.
Declaration
public virtual Version GetDatabaseVersion()
Returns
Type | Description |
---|---|
System.Version |
GetStatus(IEnumerable<ConnectionStringOptions>)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.
Declaration
public SchemaStatus GetStatus(IEnumerable<ConnectionStringOptions> connectionStrings)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ConnectionStringOptions> | connectionStrings |
Returns
Type | Description |
---|---|
SchemaStatus | The handled database and the current version of the database. |
ThrowUpdateCodeException(Version, Version)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Throws an NotSupportedException exception saying that packages needs to be updated.
Declaration
public virtual void ThrowUpdateCodeException(Version databaseVersion, Version codeVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Version | databaseVersion | The database version |
System.Version | codeVersion | The .NET code version |
ThrowUpdateDatabaseException(Version, Version)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Throws an NotSupportedException exception saying that database needs to be updated.
Declaration
public virtual void ThrowUpdateDatabaseException(Version databaseVersion, Version codeVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Version | databaseVersion | The database version |
System.Version | codeVersion | The .NET code version |
Update(ConnectionStringOptions)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.
Declaration
public void Update(ConnectionStringOptions connectionStringSettings)
Parameters
Type | Name | Description |
---|---|---|
ConnectionStringOptions | connectionStringSettings |
Remarks
An update is considered to be required if the DatabaseVersion is undefined and
createDatabaseSchema attribute on episerver.framework element is true
OR
if the DatabaseVersion is lower than ApplicationRequiredVersion.
and updateDatabaseSchema attribute on episerver.framework element is true
AND
no ISchemaValidator implemenations return false
from method
IsDatabaseUpdateAllowed(ConnectionStringOptions).
ValidateDatabaseVersion(Version)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Validates the database version.
Declaration
public virtual void ValidateDatabaseVersion(Version supportedVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Version | supportedVersion |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Will be thrown if the database version not maches the supported version. |