Пример #1
0
        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);
            }
        }
Пример #3
0
        public void ApplyMaintenance(MigrationStage stage)
        {
            IList <IMigration> migrations;

            if (!_maintenance.TryGetValue(stage, out migrations))
            {
                return;
            }

            foreach (var migration in migrations)
            {
                _runner.Up(migration);
            }
        }
Пример #4
0
        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;
        }
Пример #5
0
            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");
                        }
                    }
                }
            }
Пример #6
0
        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);
        }
Пример #7
0
 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)
 {
 }
Пример #10
0
 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 MaintenanceAttribute(MigrationStage stage, TransactionBehavior transactionBehavior)
 {
     this.Stage = stage;
     this.TransactionBehavior = transactionBehavior;
 }
 public MaintenanceAttribute(MigrationStage stage) : this(stage, TransactionBehavior.Default)
 {
 }
Пример #13
0
 public AppMaintenanceAttribute(MigrationStage stage) : base(stage, AppMigrationRunner.Options.Preview ? TransactionBehavior.None : TransactionBehavior.Default)
 {
 }
Пример #14
0
 public void ApplyMaintenance(MigrationStage stage)
 {
     MaintenanceLoader.ApplyMaintenance(stage);
 }
Пример #15
0
 public MaintenanceAttribute(MigrationStage stage)
 {
     this.Stage = stage;
 }
 public MaintenanceAttribute(MigrationStage stage)
 {
     this.Stage = stage;
 }