Hi,
just a hint for other users that might hit this problem and to relieve the Sonarsource support a little bit.
Our Sonarqube instance runs on Windows Server 2019 with a MSSQL 2017 database.
We’ve started with Sonarqube Enterprise 5.6 in 2016, then updated to the first
Sonarqube 6.x LTS and afterwards switched to always use latest with Sonarqube 7.x onwards.
The update from Sonarqube Enterprise 9.7.1 to 9.8.0 ran into a db migration error.
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #6703 'Drop project measure variation column' failed
...
Caused by: java.lang.IllegalStateException: Fail to execute ALTER TABLE project_measures DROP COLUMN variation_value_1
...
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Objekt "DF_project_m_ varia_4D94879B" ist von Spalte "variation_value_1" abhängig.
We’ve hit similar db migration errors with an early Sonarqube 8.x version, this only affected users with MSSQL and a longer upgrade path.
The Sonarsource support recommended to run this query
select d.name as consraint_name, t.name as table_name, c.name as column_name
from sys.all_columns c
join sys.tables t on t.object_id = c.object_id
join sys.schemas s on s.schema_id = t.schema_id
join sys.default_constraints d on c.default_object_id = d.object_id where d.name like '%DF__project_m__varia__4D94879B%'
then delete the constraint manually via
ALTER TABLE dbo.project_measures
DROP CONSTRAINT DF_project_m_varia_4D94879B;
GO
and try the update again.
This worked, not clear if a patched Sonarqube 9.8.x will be released.
Gilbert