Details
Description
Between 7.9.X and 8.9.1, several database migrations drop primary keys (mainly to migrate from auto-generated id to java-generated UUID).
In Oracle database, auto-generated IDs are implemented with triggers. When dropping a PK, SonarQube assume that the trigger is named column_name_IDT but that's not always the case: when the database has been backup & restore, for example, triggers can have different names.
In this situation, the database migration fails, and users have two possible workarounds:
- Create / Rename the trigger to match what's expected by SonarQube
- Perform the migration step manually and force the migration
To ease migrations, the solution seems to look into the database metadata for the trigger name (on the table+column), instead of relying on a naming convention.
Note: This bug only applies to SonarQube between 7.9 and 8.9, and won't happen after that: After 8.9, SonarQube doesn't use database-generated IDs, so there are no triggers to delete anymore.