I’m wondering for a sonarqube scan approach in case of a migration-based database deployment.
I’m referring to known framework like Liquibase or Flyway that are promoting this kind of approach for database changeset deployment. Nowaday the migration-based deployment is the most common and used approach for database devops.
In this scenario the developer is working only a changeset that should reflect the “new code” only in sonarqube.
What’s the approach to have scan from SonarQube pov?
migration-based database deployment is promoting a way to deliver changeset of SQL (let’s take the simplest scenario). The developer create a new file for every new change that is having all SQL commands to modify the datamodel. All changeset are submitted to the framework for deployment and only “new ones” are executed against the existing datamodel. Once executed the same will never be executed anymore in the future.
How can we have the scan on these changeset? just new ones o all?
Let’s consider that if old changeset goes under scan the same cannot be fixed for any issue anymore as already executed against the datamodel. The approach is to “go always forward” also if you have an issue in datamodel with a new changeset that fixes it