Hello,
Between 8.9 and 9.7, we dropped the column user_managed from the metrics table. This process is handled automatically by SonarQube and in the case of Microsoft SQL server, we need to drop constraints of the column before. This is done by introspecting the schema to find the default constraints placed on this column and attempting to drop them, this should not generate an error.
I’m not sure why it’s not working in your case, do you use a supported version of Microsoft SQL server?
Are you able to validate the existence of DF__metrics__user_ma__084B3915 as a constraint on the metrics table?
SonarQube uses the following script to find the constraint to drop (use the correct default schema):
SELECT d.name FROM sys.tables t
JOIN sys.default_constraints d ON d.parent_object_id = t.object_id
JOIN sys.columns c ON c.object_id = t.object_id AND c.column_id = d.parent_column_id
WHERE t.name = 'metrics' AND c.name in ('user_managed');
If you have more information about your issue, let me know so I can try to help you further.