From 931c34cc394b28e86e62f59b4017bb09133b6c65 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 30 Aug 2017 11:51:04 +0200 Subject: SONAR-9763 drop Oracle columns with SET UNUSED --- .../platform/db/migration/sql/DropColumnsBuilder.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'server/sonar-db-migration/src/main/java/org/sonar') diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/DropColumnsBuilder.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/DropColumnsBuilder.java index 4680aff0dd7..ac606967869 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/DropColumnsBuilder.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/sql/DropColumnsBuilder.java @@ -67,18 +67,18 @@ public class DropColumnsBuilder { } private String getOracleStatement() { - StringBuilder sql2 = new StringBuilder().append(ALTER_TABLE).append(tableName).append(" "); - sql2.append("DROP ("); - dropColumns(sql2, "", columns); - sql2.append(")"); - return sql2.toString(); + StringBuilder sql = new StringBuilder().append(ALTER_TABLE).append(tableName).append(" "); + sql.append("SET UNUSED ("); + dropColumns(sql, "", columns); + sql.append(")"); + return sql.toString(); } private String getMsSQLStatement(String... columnNames) { - StringBuilder sql1 = new StringBuilder().append(ALTER_TABLE).append(tableName).append(" "); - sql1.append("DROP COLUMN "); - dropColumns(sql1, "", columnNames); - return sql1.toString(); + StringBuilder sql = new StringBuilder().append(ALTER_TABLE).append(tableName).append(" "); + sql.append("DROP COLUMN "); + dropColumns(sql, "", columnNames); + return sql.toString(); } private static void dropColumns(StringBuilder sql, String columnPrefix, String... columnNames) { -- cgit v1.2.3