Interface ISchemaUpdater

Signature for component that gets called during startup where the component can detect if the database has correct version as application and possibly execute update scripts.

Namespace: EPiServer.Data.SchemaUpdates
Assembly: EPiServer.Data.dll
Version: 11.20.7
Syntax
public interface ISchemaUpdater

Methods

GetStatus(IEnumerable<ConnectionStringOptions>)

Called during startup to collect status of the databases.

Declaration
SchemaStatus GetStatus(IEnumerable<ConnectionStringOptions> connectionStringOptions)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ConnectionStringOptions> connectionStringOptions

The current configured connection strings.

Returns
Type Description
SchemaStatus

The handled database and the current version of the database.

Update(ConnectionStringOptions)

Called during startup if result from GetStatus(IEnumerable<ConnectionStringOptions>) indicates that an update is required.

Declaration
void Update(ConnectionStringOptions connectionStringOptions)
Parameters
Type Name Description
ConnectionStringOptions connectionStringOptions

The connection string settings returned from GetStatus(IEnumerable<ConnectionStringOptions>)

Remarks

An update is considered to be required if the DatabaseVersion is undefined and createDatabaseSchema attribute on episerver.framework element is trueOR if the DatabaseVersion is lower than ApplicationRequiredVersion. and updateDatabaseSchema attribute on episerver.framework element is trueAND no ISchemaValidator implemenations return false from method IsDatabaseUpdateAllowed(ConnectionStringOptions).

Extension Methods