Affecto.Database.Migrator.DatabaseMigrationApplication.Execute C# (CSharp) Method

Execute() private method

private Execute ( ) : void
return void
        private void Execute()
        {
            var connectionStringName = GetConnectionStringName();
            var direction = GetDirection();
            long? targetVersion = GetTargetVersion(direction);

            List<string> migrationTags = GetMigrationTags();

            IDatabaseMigrator runner;

            if (direction.Equals(DirectionUp))
            {
                string runPopuleateScriptsTag = GetRunPopulateScripts();
                if (runPopuleateScriptsTag != null)
                {
                    migrationTags.Add(runPopuleateScriptsTag);
                }

                runner = GetRunnerProperties(connectionStringName, migrationTags);

                if (targetVersion.HasValue)
                {
                    runner.MigrateUp(targetVersion.Value);
                }
                else
                {
                    runner.MigrateUp();
                }
            }

            else if (direction.Equals(DirectionDown))
            {
                runner = GetRunnerProperties(connectionStringName, migrationTags);

                runner.MigrateDown(targetVersion.Value);
            }
        }