public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ProjectConfigItem projectConfig = (processContext as CommonProcessContext).ProjectConfig; DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext; ValidationsGroup validationsGroup = new ValidationsGroup(false); NewProjectValidator newProjectValidator = new NewProjectValidator(_dbCommandsFactory, projectConfig.DevEnvironment, projectConfig.DBConnectionInfo, dbVersionsProcessContext.ScriptFilesState); validationsGroup.Add(newProjectValidator); SystemTablesValidator systemTablesValidator = new SystemTablesValidator(_dbCommandsFactory, projectConfig.DevEnvironment, projectConfig.DBConnectionInfo); validationsGroup.Add(systemTablesValidator); return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ValidationsGroup validationsGroup = new ValidationsGroup(true); string Id; if (processContext.ProcessArgs is ProjectConfigProcessArgs) { Id = (processContext.ProcessArgs as ProjectConfigProcessArgs).Id; } else if (processContext.ProcessArgs is ChangeIdProcessArgs) { Id = (processContext.ProcessArgs as ChangeIdProcessArgs).Id; } else { throw new Exception("Invalid 'ProcessArgs' type"); } IdMandatory idNotEmpty = new IdMandatory(Id); validationsGroup.Add(idNotEmpty); IdExistValidator projectNameValidator = new IdExistValidator(Id, _projectConfigsStorage); validationsGroup.Add(projectNameValidator); return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ValidationsGroup validationsGroup = new ValidationsGroup(true); DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext; DBVersionsProcessArgs dbVersionsProcessArgs = dbVersionsProcessContext.ProcessArgs as DBVersionsProcessArgs; TargetStateScriptFileExistValidator targetStateScriptFileExistValidatorInc = new TargetStateScriptFileExistValidator(dbVersionsProcessContext.ScriptFilesState.IncrementalScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.IncScriptFileName); validationsGroup.Add(targetStateScriptFileExistValidatorInc); TargetScriptFileAlreadyExecutedValidator isTargetScriptFiletAlreadyExecutedValidatorInc = new TargetScriptFileAlreadyExecutedValidator(dbVersionsProcessContext.ScriptFilesState.IncrementalScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.IncScriptFileName); validationsGroup.Add(isTargetScriptFiletAlreadyExecutedValidatorInc); //if (dbVersionsProcessContext.ProjectConfig.DevEnvironment) //{ // TargetStateScriptFileExistValidator targetStateScriptFileExistValidatorDDD = new TargetStateScriptFileExistValidator(dbVersionsProcessContext.ScriptFilesState.DevDummyDataScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.DDDScriptFileName); // validationsGroup.Add(targetStateScriptFileExistValidatorDDD); // TargetScriptFileAlreadyExecutedValidator isTargetScriptFiletAlreadyExecutedValidatorDDD = // new TargetScriptFileAlreadyExecutedValidator(dbVersionsProcessContext.ScriptFilesState.DevDummyDataScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.DDDScriptFileName); // validationsGroup.Add(isTargetScriptFiletAlreadyExecutedValidatorDDD); //} return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ValidationsGroup validationsGroup = new ValidationsGroup(true); string id = (processContext.ProcessArgs as DBVersionsProcessArgs).Id; IdMandatory idNotEmpty = new IdMandatory(id); validationsGroup.Add(idNotEmpty); IdExistValidator projectNameValidator = new IdExistValidator(id, _projectConfigsStorage); validationsGroup.Add(projectNameValidator); return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ValidationsGroup validationsGroup = new ValidationsGroup(false); DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext; HistoryExecutedFilesChangedValidator isHistoryExecutedFilesChangedValidatorInc = new HistoryExecutedFilesChangedValidator(dbVersionsProcessContext.ScriptFilesState.IncrementalScriptFilesComparer); validationsGroup.Add(isHistoryExecutedFilesChangedValidatorInc); if (dbVersionsProcessContext.ProjectConfig.DevEnvironment) { HistoryExecutedFilesChangedValidator isHistoryExecutedFilesChangedValidatorDDD = new HistoryExecutedFilesChangedValidator(dbVersionsProcessContext.ScriptFilesState.DevDummyDataScriptFilesComparer); validationsGroup.Add(isHistoryExecutedFilesChangedValidatorDDD); } return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ProjectConfigItem projectConfig = (processContext as CommonProcessContext).ProjectConfig; ValidationsGroup validationsGroup = new ValidationsGroup(false); CheckDeliveryEnvValidator checkDeliveryEnvValidator = new CheckDeliveryEnvValidator(projectConfig.DevEnvironment); validationsGroup.Add(checkDeliveryEnvValidator); return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ProjectConfigItem projectConfig = (processContext as CommonProcessContext).ProjectConfig; ValidationsGroup validationsGroup = new ValidationsGroup(false); ArtifactFileValidator artifactFileValidator = new ArtifactFileValidator(projectConfig.DevEnvironment, projectConfig.DeliveryArtifactFolderPath); validationsGroup.Add(artifactFileValidator); return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext; DBVersionsProcessArgs dbVersionsProcessArgs = dbVersionsProcessContext.ProcessArgs as DBVersionsProcessArgs; ValidationsGroup validationsGroup = new ValidationsGroup(false); NextScriptFileNameValidator nextScriptFileNameValidator = new NextScriptFileNameValidator(dbVersionsProcessContext.ScriptFilesState.ScriptFilesComparers[_scriptFileType.FileTypeCode], dbVersionsProcessArgs.NewScriptName); validationsGroup.Add(nextScriptFileNameValidator); return(validationsGroup); }
public override ValidationsGroup Create(ProcessContext processContext) { processContext.ThrowIfNull(nameof(processContext)); ProjectConfigItem projectConfig = (processContext as CommonProcessContext).ProjectConfig; ValidationsGroup validationsGroup = new ValidationsGroup(true); IdMandatory projectIdValidator = new IdMandatory(projectConfig.Id); validationsGroup.Add(projectIdValidator); DBTypeValidator dbTypeValidator = new DBTypeValidator(projectConfig.DBConnectionInfo.DBType, _dbCommandsFactory); validationsGroup.Add(dbTypeValidator); DBNameValidator dbNameValidator = new DBNameValidator(projectConfig.DBConnectionInfo.DBName); validationsGroup.Add(dbNameValidator); ConnectionStringValidator connectionStringValidator = new ConnectionStringValidator(projectConfig.DBConnectionInfo, _dbCommandsFactory); validationsGroup.Add(connectionStringValidator); AdminConnectionStringValidator adminConnectionStringValidator = new AdminConnectionStringValidator(projectConfig.DBConnectionInfo, _dbCommandsFactory); validationsGroup.Add(adminConnectionStringValidator); DBBackupFolderValidator dbBackupBaseFolderValidator = new DBBackupFolderValidator(projectConfig.BackupFolderPath); validationsGroup.Add(dbBackupBaseFolderValidator); if (projectConfig.DevEnvironment) { DevScriptsBaseFolderPathValidator scriptsRootFolderPathValidator = new DevScriptsBaseFolderPathValidator(projectConfig.DevEnvironment, projectConfig.DevScriptsBaseFolderPath); validationsGroup.Add(scriptsRootFolderPathValidator); if (!string.IsNullOrWhiteSpace(projectConfig.DevScriptsBaseFolderPath)) { ScriptsFolderPathValidator incrementalScriptsFolderPathValidator = new ScriptsFolderPathValidator(nameof(projectConfig.IncrementalScriptsFolderPath), projectConfig.IncrementalScriptsFolderPath); validationsGroup.Add(incrementalScriptsFolderPathValidator); ScriptsFolderPathValidator repeatableScriptsFolderPathValidator = new ScriptsFolderPathValidator(nameof(projectConfig.RepeatableScriptsFolderPath), projectConfig.RepeatableScriptsFolderPath); validationsGroup.Add(repeatableScriptsFolderPathValidator); ScriptsFolderPathValidator devDummyDataScriptsFolderPathValidator = new ScriptsFolderPathValidator(nameof(projectConfig.DevDummyDataScriptsFolderPath), projectConfig.DevDummyDataScriptsFolderPath); validationsGroup.Add(devDummyDataScriptsFolderPathValidator); } DeployArtifactFolderPathValidator deployArtifactFolderPathValidator = new DeployArtifactFolderPathValidator(projectConfig.DeployArtifactFolderPath); validationsGroup.Add(deployArtifactFolderPathValidator); } else { DeliveryArtifactFolderPathValidator deliveryArtifactFolderPathValidator = new DeliveryArtifactFolderPathValidator(projectConfig.DeliveryArtifactFolderPath); validationsGroup.Add(deliveryArtifactFolderPathValidator); } return(validationsGroup); }