From 01056ae8db1ba68f563ee36b385f8eaf24fa0562 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 22 Aug 2016 23:42:57 +0200 Subject: [PATCH] SONAR-7903 merge db migrations No need to rename the table CE_TASK_DATA to CE_TASK_INPUT. It can be directly created with the correct name. --- ....rb => 1302_create_table_ce_task_input.rb} | 6 ++-- .../1305_drop_index_ce_task_data_uuid.rb | 33 ------------------- ...06_rename_ce_task_data_to_ce_task_input.rb | 30 ----------------- .../org/sonar/db/version/rows-h2.sql | 1 - 4 files changed, 3 insertions(+), 67 deletions(-) rename server/sonar-web/src/main/webapp/WEB-INF/db/migrate/{1302_create_table_ce_task_data.rb => 1302_create_table_ce_task_input.rb} (85%) delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1305_drop_index_ce_task_data_uuid.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1306_rename_ce_task_data_to_ce_task_input.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1302_create_table_ce_task_data.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1302_create_table_ce_task_input.rb similarity index 85% rename from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1302_create_table_ce_task_data.rb rename to server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1302_create_table_ce_task_input.rb index 73038de8329..b1288272ea0 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1302_create_table_ce_task_data.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1302_create_table_ce_task_input.rb @@ -21,15 +21,15 @@ # # SonarQube 6.1 # -class CreateTableCeTaskData < ActiveRecord::Migration +class CreateTableCeTaskInput < ActiveRecord::Migration def self.up - create_table 'ce_task_data', :id => false do |t| + create_table 'ce_task_input', :id => false do |t| t.column 'task_uuid', :string, :limit => 40, :null => false t.column 'data', :binary, :null => true t.column 'created_at', :big_integer, :null => false t.column 'updated_at', :big_integer, :null => false end - add_index 'ce_task_data', 'task_uuid', :name => 'ce_task_data_uuid', :unique => true + add_index 'ce_task_input', 'task_uuid', :name => 'ce_task_input_uuid', :unique => true end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1305_drop_index_ce_task_data_uuid.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1305_drop_index_ce_task_data_uuid.rb deleted file mode 100644 index 9071519dc36..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1305_drop_index_ce_task_data_uuid.rb +++ /dev/null @@ -1,33 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -# -# SonarQube 6.1 -# -class DropIndexCeTaskDataUuid < ActiveRecord::Migration - - def self.up - begin - remove_index :ce_task_data, :name => 'ce_task_data_uuid' - rescue - #ignore - end - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1306_rename_ce_task_data_to_ce_task_input.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1306_rename_ce_task_data_to_ce_task_input.rb deleted file mode 100644 index 59f5eff810f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1306_rename_ce_task_data_to_ce_task_input.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -# -# SonarQube 6.1 -# -class RenameCeTaskDataToCeTaskInput < ActiveRecord::Migration - - def self.up - rename_table 'ce_task_data', 'ce_task_input' - add_index 'ce_task_input', 'task_uuid', :name => 'ce_task_input_uuid', :unique => true - end -end diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql index 805e21cd2b2..9070689515f 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql +++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql @@ -491,7 +491,6 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1301'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1302'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1303'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1304'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1305'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1306'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1307'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1308'); -- 2.39.5