C# Class SimpleMigrations.DatabaseProvider.MysqlDatabaseProvider

Class which can read from / write to a version table in an MySQL database
MySQL supports advisory locks, so these are used to guard against concurrent migrators.
Inheritance: DatabaseProviderBaseWithAdvisoryLock
ファイルを表示 Open project: canton7/SimpleMigrations

Public Methods

Method Description
AcquireAdvisoryLock ( ) : void

Acquires an advisory lock using Connection

GetCreateVersionTableSql ( ) : string

Returns SQL to create the version table

GetCurrentVersionSql ( ) : string

Returns SQL to fetch the current version from the version table

GetSetVersionSql ( ) : string

Returns SQL to update the current version in the version table

MysqlDatabaseProvider ( DbConnection connection ) : System

Initialises a new instance of the MysqlDatabaseProvider class

ReleaseAdvisoryLock ( ) : void

Releases the advisory lock held on Connection

Method Details

AcquireAdvisoryLock() public method

Acquires an advisory lock using Connection
public AcquireAdvisoryLock ( ) : void
return void

GetCreateVersionTableSql() public method

Returns SQL to create the version table
public GetCreateVersionTableSql ( ) : string
return string

GetCurrentVersionSql() public method

Returns SQL to fetch the current version from the version table
public GetCurrentVersionSql ( ) : string
return string

GetSetVersionSql() public method

Returns SQL to update the current version in the version table
public GetSetVersionSql ( ) : string
return string

MysqlDatabaseProvider() public method

Initialises a new instance of the MysqlDatabaseProvider class
public MysqlDatabaseProvider ( DbConnection connection ) : System
connection System.Data.Common.DbConnection Connection to use to run migrations. The caller is responsible for closing this.
return System

ReleaseAdvisoryLock() public method

Releases the advisory lock held on Connection
public ReleaseAdvisoryLock ( ) : void
return void