use of org.sonar.server.platform.db.migration.MigrationConfigurationModule in project sonarqube by SonarSource.
the class SQDatabase method executeDbMigrations.
private void executeDbMigrations(NoopDatabase noopDatabase) {
SpringComponentContainer container = new SpringComponentContainer();
container.add(noopDatabase);
MigrationConfigurationModule migrationConfigurationModule = new MigrationConfigurationModule();
migrationConfigurationModule.configure(container);
// dependencies required by DB migrations
container.add(SonarRuntimeImpl.forSonarQube(Version.create(8, 0), SonarQubeSide.SERVER, SonarEdition.COMMUNITY));
container.add(UuidFactoryFast.getInstance());
container.add(System2.INSTANCE);
container.add(MapSettings.class);
container.startComponents();
MigrationContainer migrationContainer = new MigrationContainerImpl(container, H2StepExecutor.class);
MigrationSteps migrationSteps = migrationContainer.getComponentByType(MigrationSteps.class);
MigrationStepsExecutor executor = migrationContainer.getComponentByType(MigrationStepsExecutor.class);
executor.execute(migrationSteps.readAll());
}
use of org.sonar.server.platform.db.migration.MigrationConfigurationModule in project sonarqube by SonarSource.
the class PlatformLevel2 method configureLevel.
@Override
protected void configureLevel() {
add(new MigrationConfigurationModule(), DatabaseVersion.class, DatabaseServerCompatibility.class, MigrationEsClientImpl.class, new StartupMetadataProvider(), DefaultServerUpgradeStatus.class, Durations.class, // index.html cache
WebPagesCache.class, // plugins
PluginJarLoader.class, ServerPluginRepository.class, ServerPluginManager.class, ServerPluginJarExploder.class, PluginClassLoader.class, PluginCompressor.class, PluginClassloaderFactory.class, InstalledPluginReferentialFactory.class, WebServerExtensionInstaller.class, // depends on plugins
ServerI18n.class, OfficialDistribution.class);
// Migration state must be kept at level2 to survive moving in and then out of safe mode
// ExecutorService must be kept at level2 because stopping it when stopping safe mode level causes error making SQ fail
add(DatabaseMigrationStateImpl.class, DatabaseMigrationExecutorServiceImpl.class);
addIfStartupLeader(DatabaseCharsetChecker.class, CheckDatabaseCharsetAtStartup.class);
}
Aggregations