Method | Description | |
---|---|---|
AcquireAdvisoryLock ( ) : void |
Acquires an advisory lock using Connection
|
|
BeginOperation ( ) : |
Called when SimpleMigrator{TConnection, TMigrationBase}.MigrateTo(long) or SimpleMigrator{TConnection, TMigrationBase}.Baseline(long) is invoked, before any migrations are run. This invokes AcquireAdvisoryLock to acquire the advisory lock.
|
|
DatabaseProviderBaseWithAdvisoryLock ( |
Initialises a new instance of the DatabaseProviderBaseWithAdvisoryLock class
|
|
EndOperation ( ) : void |
Called after migrations are run, this invokes ReleaseAdvisoryLock to release the advisory lock.
|
|
EnsureCreatedAndGetCurrentVersion ( ) : long |
Ensures that the version table is created, and returns the current version. This is not surrounded by calls to BeginOperation or EndOperation, so it should do whatever locking is appropriate to guard against concurrent migrators. If the version table is empty, this should return 0. |
|
GetCurrentVersion ( ) : long |
Fetch the current database schema version, or 0. This method is always invoked after a call to BeginOperation, but before a call to EndOperation. Therefore the advisory lock has already been acquired. |
|
ReleaseAdvisoryLock ( ) : void |
Releases the advisory lock held on Connection
|
|
UpdateVersion ( long oldVersion, long newVersion, string newDescription ) : void |
Update the VersionInfo table to indicate that the given migration was successfully applied. This is always invoked after a call to BeginOperation but before a call to EndOperation, Therefore the advisory lock has already been acquired. |
public abstract AcquireAdvisoryLock ( ) : void | ||
return | void |
public BeginOperation ( ) : |
||
return |
public DatabaseProviderBaseWithAdvisoryLock ( |
||
connection | Database connection to use for all operations | |
return | System |
public EnsureCreatedAndGetCurrentVersion ( ) : long | ||
return | long |
public abstract ReleaseAdvisoryLock ( ) : void | ||
return | void |
public UpdateVersion ( long oldVersion, long newVersion, string newDescription ) : void | ||
oldVersion | long | The previous version of the database schema |
newVersion | long | The version of the new database schema |
newDescription | string | The description of the migration which was applied |
return | void |