C# Class DatabaseMigraine.Managers.MigrationManager

Inheritance: DbScriptFolderManager
Afficher le fichier Open project: 7digital/DatabaseMigraine Class Usage Examples

Méthodes publiques

Méthode Description
GenerateMigrations ( DirectoryInfo dbScriptsPath, string dbname, Server server, DirectoryInfo outPath ) : int
GenerateMigrationsContentsToDisk ( IEnumerable scripts, DirectoryInfo outPath, string dbname ) : int
GetMigrationId ( string scriptFileNameWithoutExtension ) : int
GetMigrationsRunInDb ( DirectoryInfo dbScriptsPath, Server dbServer, string dbname ) : IEnumerable
GetNonRetiredMigrationsRunInDb ( DirectoryInfo dbScriptsPath, Server dbServer, string dbname ) : IEnumerable
GetSqlSriptsIn ( string dbScriptsPath ) : IEnumerable
RunScripts ( Server disposableDbServer, string dbScriptsPath, string dbname, string originalDbName, IEnumerable scriptFileNameWhiteList ) : int

Méthodes protégées

Méthode Description
CheckContentViolationRules ( string>.Dictionary elementNameToScriptContents, string originalDbName ) : void
RetrieveContentsWhileCheckConventions ( string originalDbName, IEnumerable scripts ) : string>.IDictionary
RunScript ( string>.KeyValuePair script, string dbname ) : void

Private Methods

Méthode Description
CheckForRiskyBatchStatementGO ( string>.IDictionary scriptsWithContents ) : void
CheckIfDatabaseChangeLogTableExists ( Database database ) : void
EscapeSql ( string content ) : string
FileNameToTransactionName ( string scriptFileNameWithoutExtension ) : string
GenerateHash ( string scriptContents ) : string
GenerateMigration ( string scriptFileNameWithoutExtension, string scriptContents ) : GeneratedMigration
GenerateMigrationFor ( SqlExecutor executor, string scriptFileNameWithoutExtension, string scriptContents, string dbname ) : GeneratedMigration
GetInsertStatementForMigration ( FileInfo script ) : string
GetInsertStatementForMigration ( int migrationId, string scriptFileNameWithoutExtension, string hash ) : string
MigrationAlreadyRun ( SqlExecutor executor, string hash, string dbname ) : bool

Method Details

CheckContentViolationRules() protected méthode

protected CheckContentViolationRules ( string>.Dictionary elementNameToScriptContents, string originalDbName ) : void
elementNameToScriptContents string>.Dictionary
originalDbName string
Résultat void

GenerateMigrations() public méthode

public GenerateMigrations ( DirectoryInfo dbScriptsPath, string dbname, Server server, DirectoryInfo outPath ) : int
dbScriptsPath System.IO.DirectoryInfo
dbname string
server Server
outPath System.IO.DirectoryInfo
Résultat int

GenerateMigrationsContentsToDisk() public méthode

public GenerateMigrationsContentsToDisk ( IEnumerable scripts, DirectoryInfo outPath, string dbname ) : int
scripts IEnumerable
outPath System.IO.DirectoryInfo
dbname string
Résultat int

GetMigrationId() public static méthode

public static GetMigrationId ( string scriptFileNameWithoutExtension ) : int
scriptFileNameWithoutExtension string
Résultat int

GetMigrationsRunInDb() public méthode

public GetMigrationsRunInDb ( DirectoryInfo dbScriptsPath, Server dbServer, string dbname ) : IEnumerable
dbScriptsPath System.IO.DirectoryInfo
dbServer Server
dbname string
Résultat IEnumerable

GetNonRetiredMigrationsRunInDb() public méthode

public GetNonRetiredMigrationsRunInDb ( DirectoryInfo dbScriptsPath, Server dbServer, string dbname ) : IEnumerable
dbScriptsPath System.IO.DirectoryInfo
dbServer Server
dbname string
Résultat IEnumerable

GetSqlSriptsIn() public méthode

public GetSqlSriptsIn ( string dbScriptsPath ) : IEnumerable
dbScriptsPath string
Résultat IEnumerable

RetrieveContentsWhileCheckConventions() protected méthode

protected RetrieveContentsWhileCheckConventions ( string originalDbName, IEnumerable scripts ) : string>.IDictionary
originalDbName string
scripts IEnumerable
Résultat string>.IDictionary

RunScript() protected méthode

protected RunScript ( string>.KeyValuePair script, string dbname ) : void
script string>.KeyValuePair
dbname string
Résultat void

RunScripts() public méthode

public RunScripts ( Server disposableDbServer, string dbScriptsPath, string dbname, string originalDbName, IEnumerable scriptFileNameWhiteList ) : int
disposableDbServer Server
dbScriptsPath string
dbname string
originalDbName string
scriptFileNameWhiteList IEnumerable
Résultat int