From: Julien Lancelot Date: Wed, 24 Apr 2013 09:19:01 +0000 (+0200) Subject: Move issues db migration X-Git-Tag: 3.6~569 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=131af346c37cc3179b027c69f66258ba4b269144;p=sonarqube.git Move issues db migration --- diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java index 6d218221d06..aa818a4f8c6 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java @@ -32,7 +32,7 @@ import java.util.List; */ public class DatabaseVersion implements BatchComponent, ServerComponent { - public static final int LAST_VERSION = 388; + public static final int LAST_VERSION = 390; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql index 094c00226aa..3c89c36d704 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql @@ -155,10 +155,10 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('381'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('382'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('383'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('384'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('385'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('386'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('387'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('388'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('389'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('390'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/385_create_issues.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/385_create_issues.rb deleted file mode 100644 index 51635e96e02..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/385_create_issues.rb +++ /dev/null @@ -1,54 +0,0 @@ -# -# Sonar, entreprise quality control tool. -# Copyright (C) 2008-2013 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. -# - -# -# Sonar 3.6 -# -class CreateIssues < ActiveRecord::Migration - - def self.up - create_table :issues do |t| - t.column :kee, :string, :null => false, :limit => 36 - t.column :resource_id, :integer, :null => false - t.column :rule_id, :integer, :null => false - t.column :severity, :string, :null => true, :limit => 10 - t.column :manual_severity, :boolean, :null => false - t.column :manual_issue, :boolean, :null => false - t.column :description, :string, :null => true, :limit => 4000 - t.column :line, :integer, :null => true - t.column :cost, :decimal, :null => true, :precision => 30, :scale => 20 - t.column :status, :string , :null => true, :limit => 10 - t.column :resolution, :string , :null => true, :limit => 200 - t.column :checksum, :string , :null => true, :limit => 1000 - t.column :user_login, :string, :null => true, :limit => 40 - t.column :assignee_login, :string, :null => true, :limit => 40 - t.column :author_login, :string, :null => true, :limit => 100 - t.column :attributes, :string, :null => true, :limit => 1000 - t.column :created_at, :datetime, :null => true - t.column :updated_at, :datetime, :null => true - t.column :closed_at, :datetime, :null => true - end - - #add_index :issues, :resource_id, :name => 'issues_resource_id' - #add_index :issues, :rule_id, :name => 'issues_rule_id' - end - -end - diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/386_create_issue_changes.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/386_create_issue_changes.rb deleted file mode 100644 index 436e51350f9..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/386_create_issue_changes.rb +++ /dev/null @@ -1,39 +0,0 @@ -# -# Sonar, entreprise quality control tool. -# Copyright (C) 2008-2013 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. -# - -# -# Sonar 3.6 -# -class CreateIssueChanges < ActiveRecord::Migration - - def self.up - create_table :issue_changes do |t| - t.column :issue_key, :string, :null => false, :limit => 36 - t.column :user_login, :string, :null => true, :limit => 40 - t.column :change_type, :string, :null => true, :limit => 50 - t.column :change_data, :string, :null => true, :limit => 4000 - t.column :message, :text, :null => true - t.column :created_at, :datetime, :null => true - t.column :updated_at, :datetime, :null => true - end - end - -end - diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/389_create_issues.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/389_create_issues.rb new file mode 100644 index 00000000000..51635e96e02 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/389_create_issues.rb @@ -0,0 +1,54 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2013 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. +# + +# +# Sonar 3.6 +# +class CreateIssues < ActiveRecord::Migration + + def self.up + create_table :issues do |t| + t.column :kee, :string, :null => false, :limit => 36 + t.column :resource_id, :integer, :null => false + t.column :rule_id, :integer, :null => false + t.column :severity, :string, :null => true, :limit => 10 + t.column :manual_severity, :boolean, :null => false + t.column :manual_issue, :boolean, :null => false + t.column :description, :string, :null => true, :limit => 4000 + t.column :line, :integer, :null => true + t.column :cost, :decimal, :null => true, :precision => 30, :scale => 20 + t.column :status, :string , :null => true, :limit => 10 + t.column :resolution, :string , :null => true, :limit => 200 + t.column :checksum, :string , :null => true, :limit => 1000 + t.column :user_login, :string, :null => true, :limit => 40 + t.column :assignee_login, :string, :null => true, :limit => 40 + t.column :author_login, :string, :null => true, :limit => 100 + t.column :attributes, :string, :null => true, :limit => 1000 + t.column :created_at, :datetime, :null => true + t.column :updated_at, :datetime, :null => true + t.column :closed_at, :datetime, :null => true + end + + #add_index :issues, :resource_id, :name => 'issues_resource_id' + #add_index :issues, :rule_id, :name => 'issues_rule_id' + end + +end + diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/390_create_issue_changes.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/390_create_issue_changes.rb new file mode 100644 index 00000000000..436e51350f9 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/390_create_issue_changes.rb @@ -0,0 +1,39 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2013 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. +# + +# +# Sonar 3.6 +# +class CreateIssueChanges < ActiveRecord::Migration + + def self.up + create_table :issue_changes do |t| + t.column :issue_key, :string, :null => false, :limit => 36 + t.column :user_login, :string, :null => true, :limit => 40 + t.column :change_type, :string, :null => true, :limit => 50 + t.column :change_data, :string, :null => true, :limit => 4000 + t.column :message, :text, :null => true + t.column :created_at, :datetime, :null => true + t.column :updated_at, :datetime, :null => true + end + end + +end +