]> source.dussan.org Git - sonarqube.git/commitdiff
Move issues db migration
authorJulien Lancelot <julien.lancelot@gmail.com>
Wed, 24 Apr 2013 09:19:01 +0000 (11:19 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Wed, 24 Apr 2013 09:19:01 +0000 (11:19 +0200)
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
sonar-server/src/main/webapp/WEB-INF/db/migrate/385_create_issues.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/386_create_issue_changes.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/db/migrate/389_create_issues.rb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/db/migrate/390_create_issue_changes.rb [new file with mode: 0644]

index 6d218221d063e9f82009e59d78dd25c2b2d35b4b..aa818a4f8c64403431c4c451208a1e7ad4d3d716 100644 (file)
@@ -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
index 094c00226aab77bb7af62f1413e5012c8d2af1ee..3c89c36d704e180b48d1ae6c21d532c84a6a6be4 100644 (file)
@@ -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 (file)
index 51635e9..0000000
+++ /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 (file)
index 436e513..0000000
+++ /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 (file)
index 0000000..51635e9
--- /dev/null
@@ -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 (file)
index 0000000..436e513
--- /dev/null
@@ -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
+