]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5097 Drop alerts table
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 17 Mar 2014 11:06:14 +0000 (12:06 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 17 Mar 2014 13:43:43 +0000 (14:43 +0100)
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database.xml
sonar-server/src/main/webapp/WEB-INF/db/migrate/522_drop_alerts.rb [new file with mode: 0644]

index ec82ef2498bcee1496c7aac11f6c81d04e76be36..7d920dacaf21aca3f093414010f1582b63f73b76 100644 (file)
@@ -33,7 +33,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 521;
+  public static final int LAST_VERSION = 522;
 
   public static enum Status {
     UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
@@ -51,7 +51,6 @@ public class DatabaseVersion implements BatchComponent, ServerComponent {
     "active_rule_changes",
     "active_rule_parameters",
     "active_rule_param_changes",
-    "alerts",
     "authors",
     "characteristics",
     "dashboards",
index 27f5e70073692d8b6fd71f2a1007960270bc5a42..916e8ece9b5017b2b71fd996cd82402b1d187fba 100644 (file)
@@ -220,6 +220,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('518');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('519');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('520');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('521');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('522');
 
 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;
index 7292b42d6d9760ca956d3fd562b6731fced4b6c2..1af58ad3af37dd086d8a0d691b61cfd39bb619ca 100644 (file)
@@ -198,16 +198,6 @@ CREATE TABLE "EVENTS" (
   "DESCRIPTION" VARCHAR(4000)
 );
 
-CREATE TABLE "ALERTS" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
-  "PROFILE_ID" INTEGER,
-  "METRIC_ID" INTEGER,
-  "OPERATOR" VARCHAR(3),
-  "VALUE_ERROR" VARCHAR(64),
-  "VALUE_WARNING" VARCHAR(64),
-  "PERIOD" INTEGER,
-);
-
 CREATE TABLE "QUALITY_GATES" (
   "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
   "NAME" VARCHAR(100) NOT NULL,
index 2f1133bc01a4615e4b490f0f04537116bfb4d9a7..c787ef6e2007c8076f3ff10a54d101b604bff1d8 100644 (file)
@@ -21,8 +21,6 @@
              created_at="2013-01-25 02:04:06.00" build_date="2013-01-25 02:04:06.00"
              version="1.0" status="P" islast="[true]"/>
 
-  <alerts id="1" profile_id="1" metric_id="1" operator="lt" value_error="5" value_warning="" period="[null]"/>
-
   <project_measures id="1" value="10" metric_id="1" snapshot_id="1000" />
 
   <events id="1" name="1.0-SNAPSHOT" resource_id="123" />
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/522_drop_alerts.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/522_drop_alerts.rb
new file mode 100644 (file)
index 0000000..6b04037
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# 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 4.3
+#
+class DropAlerts < ActiveRecord::Migration
+
+  def self.up
+    drop_table(:alerts)
+  end
+
+end
\ No newline at end of file