public void ApplyMaintenance(MigrationStage stage, bool useAutomaticTransactionManagement) { var maintenanceMigrations = MaintenanceLoader.LoadMaintenance(stage); foreach (var maintenanceMigration in maintenanceMigrations) { ApplyMigrationUp(maintenanceMigration, useAutomaticTransactionManagement && maintenanceMigration.TransactionBehavior == TransactionBehavior.Default); } }
public void ApplyMaintenance(MigrationStage stage) { IList<IMigration> migrations; if (!_maintenance.TryGetValue(stage, out migrations)) return; foreach (var migration in migrations) { _runner.Up(migration); } }
public void ApplyMaintenance(MigrationStage stage) { IList <IMigration> migrations; if (!_maintenance.TryGetValue(stage, out migrations)) { return; } foreach (var migration in migrations) { _runner.Up(migration); } }
public IList<IMigrationInfo> LoadMaintenance(MigrationStage stage) { IList<IMigration> migrations; IList<IMigrationInfo> migrationInfos = new List<IMigrationInfo>(); if (!_maintenance.TryGetValue(stage, out migrations)) return migrationInfos; foreach (var migration in migrations) { var transactionBehavior = migration.GetType().GetOneAttribute<MaintenanceAttribute>().TransactionBehavior; migrationInfos.Add(new NonAttributedMigrationToMigrationInfoAdapter(migration, transactionBehavior)); } return migrationInfos; }
public void SetInitialMigrationStage(string queueName, string holdingQueueName, IConnection connection) { SetBrokerState(queueName, holdingQueueName, connection); if (mainQueueIsQuorum) { if (holdingQueueHasMessages) { CurrentStage = MigrationStage.QuorumQueueCreated; } else if (holdingQueueExists) { CurrentStage = MigrationStage.MessagesMovedToQuorumQueue; } else { CurrentStage = MigrationStage.CleanUpCompleted; } } else { if (mainQueueHasMessages) { CurrentStage = MigrationStage.Starting; } else if (holdingQueueHasMessages && mainQueueExists) { CurrentStage = MigrationStage.MessagesMovedToHoldingQueue; } else if (holdingQueueHasMessages) { CurrentStage = MigrationStage.ClassicQueueDeleted; } else { if (mainQueueExists) { CurrentStage = MigrationStage.Starting; } else { throw new Exception($"Queue '{queueName}' was not found"); } } } }
public IList <IMigrationInfo> LoadMaintenance(MigrationStage stage) { IList <IMigrationInfo> migrationInfos = new List <IMigrationInfo>(); if (!_maintenance.TryGetValue(stage, out var migrations)) { return(migrationInfos); } foreach (var migration in migrations) { var transactionBehavior = migration.GetType().GetOneAttribute <MaintenanceAttribute>().TransactionBehavior; migrationInfos.Add(new NonAttributedMigrationToMigrationInfoAdapter(migration, transactionBehavior)); } return(migrationInfos); }
public void ApplyMaintenance(MigrationStage stage) { MaintenanceLoader.ApplyMaintenance(stage); }
public MaintenanceAttribute(MigrationStage stage, TransactionBehavior transactionBehavior) { this.Stage = stage; this.TransactionBehavior = transactionBehavior; }
public MaintenanceAttribute(MigrationStage stage) : this(stage, TransactionBehavior.Default) { }
public AppMaintenanceAttribute(MigrationStage stage) : base(stage, AppMigrationRunner.Options.Preview ? TransactionBehavior.None : TransactionBehavior.Default) { }
public MaintenanceAttribute(MigrationStage stage) { this.Stage = stage; }