From 28b75501815bd4707421cba55e26aacdc1e929c5 Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 8 May 2020 15:01:39 +0200 Subject: [PATCH] SONAR-13221 drop `order by id asc` statement --- .../version/v84/activerules/PopulateActiveRulesUuid.java | 2 +- .../v84/duplicationsindex/PopulateDuplicationsIndexUuid.java | 2 +- .../version/v84/filesources/PopulateFileSourcesUuid.java | 2 +- .../version/v84/grouproles/PopulateGroupRolesUuid.java | 2 +- .../db/migration/version/v84/groups/PopulateGroupsUuid.java | 2 +- .../version/v84/issuechanges/PopulateIssueChangesUuid.java | 2 +- .../db/migration/version/v84/metrics/PopulateMetricsUuid.java | 2 +- .../v84/notifications/PopulateNotificationUuidAndCreatedAt.java | 2 +- .../permtemplatesgroups/PopulatePermTemplatesGroupsUuid.java | 2 +- .../v84/permtemplatesusers/PopulatePermTemplatesUsersUuid.java | 2 +- .../PopulatePermTplCharacteristicsUuid.java | 2 +- .../version/v84/properties/PopulatePropertiesUuid.java | 2 +- .../PopulateQualityGateConditionsUuid.java | 2 +- .../qualitygates/PopulateQGateUuidColumnForQGateConditions.java | 2 +- .../migration/version/v84/userroles/PopulateUserRolesUuid.java | 2 +- .../version/v84/usertokens/PopulateUserTokensUuid.java | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/activerules/PopulateActiveRulesUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/activerules/PopulateActiveRulesUuid.java index 053eb4d369f..50e8a49109d 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/activerules/PopulateActiveRulesUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/activerules/PopulateActiveRulesUuid.java @@ -38,7 +38,7 @@ public class PopulateActiveRulesUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from active_rules where uuid is null order by id asc"); + massUpdate.select("select id from active_rules where uuid is null"); massUpdate.update("update active_rules set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/duplicationsindex/PopulateDuplicationsIndexUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/duplicationsindex/PopulateDuplicationsIndexUuid.java index 8542aae54c9..8cb3edc85db 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/duplicationsindex/PopulateDuplicationsIndexUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/duplicationsindex/PopulateDuplicationsIndexUuid.java @@ -38,7 +38,7 @@ public class PopulateDuplicationsIndexUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from duplications_index where uuid is null order by id asc"); + massUpdate.select("select id from duplications_index where uuid is null"); massUpdate.update("update duplications_index set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/filesources/PopulateFileSourcesUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/filesources/PopulateFileSourcesUuid.java index 673ad4b6a23..436af8de682 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/filesources/PopulateFileSourcesUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/filesources/PopulateFileSourcesUuid.java @@ -38,7 +38,7 @@ public class PopulateFileSourcesUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from file_sources where uuid is null order by id asc"); + massUpdate.select("select id from file_sources where uuid is null"); massUpdate.update("update file_sources set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/grouproles/PopulateGroupRolesUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/grouproles/PopulateGroupRolesUuid.java index 5f10b60501d..17be44a1dd0 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/grouproles/PopulateGroupRolesUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/grouproles/PopulateGroupRolesUuid.java @@ -38,7 +38,7 @@ public class PopulateGroupRolesUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from group_roles where uuid is null order by id asc"); + massUpdate.select("select id from group_roles where uuid is null"); massUpdate.update("update group_roles set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/groups/PopulateGroupsUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/groups/PopulateGroupsUuid.java index 2614b8fe46f..228425c62e9 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/groups/PopulateGroupsUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/groups/PopulateGroupsUuid.java @@ -38,7 +38,7 @@ public class PopulateGroupsUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from groups where uuid is null order by id asc"); + massUpdate.select("select id from groups where uuid is null"); massUpdate.update("update groups set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/issuechanges/PopulateIssueChangesUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/issuechanges/PopulateIssueChangesUuid.java index b52f665023c..d965a14170e 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/issuechanges/PopulateIssueChangesUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/issuechanges/PopulateIssueChangesUuid.java @@ -38,7 +38,7 @@ public class PopulateIssueChangesUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from issue_changes where uuid is null order by id asc"); + massUpdate.select("select id from issue_changes where uuid is null"); massUpdate.update("update issue_changes set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/metrics/PopulateMetricsUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/metrics/PopulateMetricsUuid.java index 12f1d628cdf..55579431c54 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/metrics/PopulateMetricsUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/metrics/PopulateMetricsUuid.java @@ -38,7 +38,7 @@ public class PopulateMetricsUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from metrics where uuid is null order by id asc"); + massUpdate.select("select id from metrics where uuid is null"); massUpdate.update("update metrics set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/notifications/PopulateNotificationUuidAndCreatedAt.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/notifications/PopulateNotificationUuidAndCreatedAt.java index 9bca79f546d..d9abdabcb12 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/notifications/PopulateNotificationUuidAndCreatedAt.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/notifications/PopulateNotificationUuidAndCreatedAt.java @@ -42,7 +42,7 @@ public class PopulateNotificationUuidAndCreatedAt extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from notifications where uuid is null order by id asc"); + massUpdate.select("select id from notifications where uuid is null"); massUpdate.update("update notifications set uuid = ?, created_at = ? where id = ?"); // now - 7 days, to have previous notification in the past diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesgroups/PopulatePermTemplatesGroupsUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesgroups/PopulatePermTemplatesGroupsUuid.java index 8bf86f8f47d..7f148b8cafe 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesgroups/PopulatePermTemplatesGroupsUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesgroups/PopulatePermTemplatesGroupsUuid.java @@ -38,7 +38,7 @@ public class PopulatePermTemplatesGroupsUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from perm_templates_groups where uuid is null order by id asc"); + massUpdate.select("select id from perm_templates_groups where uuid is null"); massUpdate.update("update perm_templates_groups set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesusers/PopulatePermTemplatesUsersUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesusers/PopulatePermTemplatesUsersUuid.java index d56b6fe2652..9cdb8791fac 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesusers/PopulatePermTemplatesUsersUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtemplatesusers/PopulatePermTemplatesUsersUuid.java @@ -38,7 +38,7 @@ public class PopulatePermTemplatesUsersUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from perm_templates_users where uuid is null order by id asc"); + massUpdate.select("select id from perm_templates_users where uuid is null"); massUpdate.update("update perm_templates_users set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtplcharacteristics/PopulatePermTplCharacteristicsUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtplcharacteristics/PopulatePermTplCharacteristicsUuid.java index d688c947c3f..4f6e1a7e633 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtplcharacteristics/PopulatePermTplCharacteristicsUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/permtplcharacteristics/PopulatePermTplCharacteristicsUuid.java @@ -38,7 +38,7 @@ public class PopulatePermTplCharacteristicsUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from perm_tpl_characteristics where uuid is null order by id asc"); + massUpdate.select("select id from perm_tpl_characteristics where uuid is null"); massUpdate.update("update perm_tpl_characteristics set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/properties/PopulatePropertiesUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/properties/PopulatePropertiesUuid.java index 6498f329b51..042f400b0f5 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/properties/PopulatePropertiesUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/properties/PopulatePropertiesUuid.java @@ -38,7 +38,7 @@ public class PopulatePropertiesUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from properties where uuid is null order by id asc"); + massUpdate.select("select id from properties where uuid is null"); massUpdate.update("update properties set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygateconditions/PopulateQualityGateConditionsUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygateconditions/PopulateQualityGateConditionsUuid.java index 06561eb6e48..81066a67239 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygateconditions/PopulateQualityGateConditionsUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygateconditions/PopulateQualityGateConditionsUuid.java @@ -38,7 +38,7 @@ public class PopulateQualityGateConditionsUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from quality_gate_conditions where uuid is null order by id asc"); + massUpdate.select("select id from quality_gate_conditions where uuid is null"); massUpdate.update("update quality_gate_conditions set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygates/PopulateQGateUuidColumnForQGateConditions.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygates/PopulateQGateUuidColumnForQGateConditions.java index 3b33aa2e3a1..dfbcfae1245 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygates/PopulateQGateUuidColumnForQGateConditions.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/qualitygates/PopulateQGateUuidColumnForQGateConditions.java @@ -34,7 +34,7 @@ public class PopulateQGateUuidColumnForQGateConditions extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select uuid, id from quality_gates order by id asc"); + massUpdate.select("select uuid, id from quality_gates"); massUpdate.update("update quality_gate_conditions set qgate_uuid = ? where qgate_id = ? and qgate_uuid is null"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/userroles/PopulateUserRolesUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/userroles/PopulateUserRolesUuid.java index ecf7a4090d4..e034e6f0d75 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/userroles/PopulateUserRolesUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/userroles/PopulateUserRolesUuid.java @@ -38,7 +38,7 @@ public class PopulateUserRolesUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from user_roles where uuid is null order by id asc"); + massUpdate.select("select id from user_roles where uuid is null"); massUpdate.update("update user_roles set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/usertokens/PopulateUserTokensUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/usertokens/PopulateUserTokensUuid.java index 0cb73f14d91..54f385cc77f 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/usertokens/PopulateUserTokensUuid.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/usertokens/PopulateUserTokensUuid.java @@ -38,7 +38,7 @@ public class PopulateUserTokensUuid extends DataChange { protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from user_tokens where uuid is null order by id asc"); + massUpdate.select("select id from user_tokens where uuid is null"); massUpdate.update("update user_tokens set uuid = ? where id = ?"); massUpdate.execute((row, update) -> { -- 2.39.5