Commit dec9416 1 parent 246d8bd commit dec9416 Copy full SHA for dec9416
File tree 1 file changed +7
-1
lines changed
src/main/java/org/dependencytrack/upgrade/v360
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public class v360Updater extends AbstractUpgradeItem {
33
33
34
34
private static final Logger LOGGER = Logger .getLogger (v360Updater .class );
35
35
private static final String STMT_1 = "UPDATE \" PROJECT\" SET \" ACTIVE\" = TRUE WHERE \" ACTIVE\" IS NULL" ;
36
+ private static final String STMT_1_ALT = "UPDATE \" PROJECT\" SET \" ACTIVE\" = 1 WHERE \" ACTIVE\" IS NULL" ;
36
37
private static final String STMT_2 = "DELETE FROM \" CONFIGPROPERTY\" WHERE \" GROUPNAME\" = 'scanner' AND \" PROPERTYNAME\" = 'dependencycheck.enabled'" ;
37
38
38
39
public String getSchemaVersion () {
@@ -41,7 +42,12 @@ public String getSchemaVersion() {
41
42
42
43
public void executeUpgrade (AlpineQueryManager aqm , Connection connection ) throws SQLException {
43
44
LOGGER .info ("Updating project active status. Setting all projects to active" );
44
- DbUtil .executeUpdate (connection , STMT_1 );
45
+ try {
46
+ DbUtil .executeUpdate (connection , STMT_1 );
47
+ } catch (Exception e ) {
48
+ LOGGER .info ("Active field is likely not boolean. Attempting project active status update assuming bit field" );
49
+ DbUtil .executeUpdate (connection , STMT_1_ALT );
50
+ }
45
51
46
52
LOGGER .info ("Removing legacy Dependency-Check configuration settings" );
47
53
DbUtil .executeUpdate (connection , STMT_2 );
You can’t perform that action at this time.
0 commit comments