]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3090 Remove DUPLICATIONS_INDEX.ID
authorEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 19 Dec 2011 12:07:56 +0000 (16:07 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 19 Dec 2011 15:32:53 +0000 (19:32 +0400)
In order to do this - remove entity DuplicationBlock and use native
query in PurgeUtils.

15 files changed:
plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/api/PurgeUtils.java
plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
sonar-core/src/main/java/org/sonar/jpa/entity/DuplicationBlock.java [deleted file]
sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
sonar-core/src/main/java/org/sonar/persistence/duplication/DuplicationUnitDto.java
sonar-core/src/main/resources/META-INF/persistence.xml
sonar-core/src/main/resources/org/sonar/persistence/duplication/DuplicationMapper-mssql.xml
sonar-core/src/main/resources/org/sonar/persistence/duplication/DuplicationMapper-oracle.xml
sonar-core/src/main/resources/org/sonar/persistence/rows-derby.sql
sonar-core/src/main/resources/org/sonar/persistence/schema-derby.ddl
sonar-core/src/test/java/org/sonar/persistence/duplication/DuplicationDaoTest.java
sonar-core/src/test/resources/org/sonar/persistence/duplication/DuplicationDaoTest/shouldGetByHash.xml
sonar-core/src/test/resources/org/sonar/persistence/duplication/DuplicationDaoTest/shouldInsert-result.xml
sonar-server/src/main/webapp/WEB-INF/db/migrate/239_delete_duplications_id.rb [new file with mode: 0644]

index 20bcb0f6241fbb0f54070054461699182794eca9..d6598a62619657a3df46c1ec069f65715abca3a3 100644 (file)
@@ -33,7 +33,6 @@ import org.sonar.api.database.model.Snapshot;
 import org.sonar.api.database.model.SnapshotSource;
 import org.sonar.api.design.DependencyDto;
 import org.sonar.api.utils.TimeProfiler;
-import org.sonar.jpa.entity.DuplicationBlock;
 
 /**
  * @since 2.5
@@ -70,7 +69,7 @@ public final class PurgeUtils {
     deleteSnapshots(session, snapshotIds);
   }
 
-  public static  void deleteDependencies(DatabaseSession session, List<Integer> snapshotIds) {
+  public static void deleteDependencies(DatabaseSession session, List<Integer> snapshotIds) {
     executeQuery(session, "delete dependencies", snapshotIds, "delete from " + DependencyDto.class.getSimpleName() + " d where d.fromSnapshotId in (:ids)");
     executeQuery(session, "delete dependencies", snapshotIds, "delete from " + DependencyDto.class.getSimpleName() + " d where d.toSnapshotId in (:ids)");
   }
@@ -78,7 +77,7 @@ public final class PurgeUtils {
   /**
    * Delete all measures, including MEASURE_DATA
    */
-  public static  void deleteMeasuresBySnapshotId(DatabaseSession session, List<Integer> snapshotIds) {
+  public static void deleteMeasuresBySnapshotId(DatabaseSession session, List<Integer> snapshotIds) {
     executeQuery(session, "delete measures by snapshot id", snapshotIds, "delete from " + MeasureData.class.getSimpleName() + " m where m.snapshotId in (:ids)");
     executeQuery(session, "delete measures by snapshot id", snapshotIds, "delete from " + MeasureModel.class.getSimpleName() + " m where m.snapshotId in (:ids)");
   }
@@ -86,7 +85,7 @@ public final class PurgeUtils {
   /**
    * Delete all measures, including MEASURE_DATA
    */
-  public static  void deleteMeasuresById(DatabaseSession session, List<Integer> measureIds) {
+  public static void deleteMeasuresById(DatabaseSession session, List<Integer> measureIds) {
     executeQuery(session, "delete measures by id", measureIds, "delete from " + MeasureData.class.getSimpleName() + " m where m.measure.id in (:ids)");
     executeQuery(session, "delete measures by id", measureIds, "delete from " + MeasureModel.class.getSimpleName() + " m where m.id in (:ids)");
   }
@@ -94,58 +93,73 @@ public final class PurgeUtils {
   /**
    * Delete SNAPSHOT_SOURCES table
    */
-  public static  void deleteSources(DatabaseSession session, List<Integer> snapshotIds) {
+  public static void deleteSources(DatabaseSession session, List<Integer> snapshotIds) {
     executeQuery(session, "delete sources", snapshotIds, "delete from " + SnapshotSource.class.getSimpleName() + " e where e.snapshotId in (:ids)");
   }
 
   /**
    * Delete violations (RULE_FAILURES table)
    */
-  public static  void deleteViolations(DatabaseSession session, List<Integer> snapshotIds) {
+  public static void deleteViolations(DatabaseSession session, List<Integer> snapshotIds) {
     executeQuery(session, "delete violations", snapshotIds, "delete from " + RuleFailureModel.class.getSimpleName() + " e where e.snapshotId in (:ids)");
   }
 
   /**
+   * Delete DUPLICATIONS_INDEX table
+   * 
    * @since 2.11
    */
   private static void deleteDuplicationBlocks(DatabaseSession session, List<Integer> snapshotIds) {
-    executeQuery(session, "delete duplication blocks", snapshotIds, "delete from " + DuplicationBlock.class.getSimpleName() + " e where e.snapshotId in (:ids)");
+    executeNativeQuery(session, "delete duplication blocks", snapshotIds, "delete from duplications_index e where e.snapshot_id in (:ids)");
   }
 
   /**
    * Delete EVENTS table
    */
-  public static  void deleteEvents(DatabaseSession session, List<Integer> snapshotIds) {
+  public static void deleteEvents(DatabaseSession session, List<Integer> snapshotIds) {
     executeQuery(session, "delete events", snapshotIds, "delete from " + Event.class.getSimpleName() + " e where e.snapshot.id in (:ids)");
   }
 
   /**
    * Delete SNAPSHOTS table
    */
-  public static  void deleteSnapshots(DatabaseSession session, List<Integer> snapshotIds) {
+  public static void deleteSnapshots(DatabaseSession session, List<Integer> snapshotIds) {
     executeQuery(session, "delete snapshots", snapshotIds, "delete from " + Snapshot.class.getSimpleName() + " s where s.id in (:ids)");
   }
 
   /**
    * Paginate execution of SQL requests to avoid exceeding size of rollback segment
    */
-  public static  void executeQuery(DatabaseSession session, String description, List<Integer> ids, String hql) {
+  public static void executeQuery(DatabaseSession session, String description, List<Integer> ids, String hql) {
     if (ids == null || ids.isEmpty()) {
       return;
     }
+    executeQuery(session, description, ids, session.createQuery(hql));
+  }
 
-    TimeProfiler profiler = new TimeProfiler().setLevelToDebug().start("Execute " + description);
+  /**
+   * @since 2.13
+   */
+  private static void executeNativeQuery(DatabaseSession session, String description, List<Integer> ids, String sql) {
+    if (ids == null || ids.isEmpty()) {
+      return;
+    }
+    executeQuery(session, description, ids, session.createNativeQuery(sql));
+  }
 
+  /**
+   * @since 2.13
+   */
+  private static void executeQuery(DatabaseSession session, String description, List<Integer> ids, Query query) {
+    TimeProfiler profiler = new TimeProfiler().setLevelToDebug().start("Execute " + description);
     int index = 0;
     while (index < ids.size()) {
-      Query query = session.createQuery(hql);
       List<Integer> paginedSids = ids.subList(index, Math.min(ids.size(), index + MAX_IN_ELEMENTS));
       query.setParameter("ids", paginedSids);
       query.executeUpdate();
       index += MAX_IN_ELEMENTS;
       session.commit();
     }
-
     profiler.stop();
   }
 
index cc74ed382d40c22a71b1a953004101bc67543a14..767062ce46a5fc32f472c984cee87ab69c282b57 100644 (file)
   <!--parent_dependency_id="[null]" project_snapshot_id="1"-->
   <!--dep_usage="INHERITS" dep_weight="1" from_scope="FIL" to_scope="FIL"/>-->
 
-  <!--<duplications_index id="1" project_snapshot_id="1" snapshot_id="3" hash="bb" index_in_file="0" start_line="0" end_line="0" />-->
-  <!--<duplications_index id="2" project_snapshot_id="1" snapshot_id="4" hash="bb" index_in_file="0" start_line="0" end_line="0" />-->
+  <!--<duplications_index project_snapshot_id="1" snapshot_id="3" hash="bb" index_in_file="0" start_line="0" end_line="0" />-->
+  <!--<duplications_index project_snapshot_id="1" snapshot_id="4" hash="bb" index_in_file="0" start_line="0" end_line="0" />-->
 
   <events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]" event_date="2008-12-02 13:58:00.00" CREATED_AT="[null]"/>
   <!--events id="2" name="Version 2.0" resource_id="3" snapshot_id="3" category="VERSION" description="[null]" event_date="2008-12-02 13:58:00.00" CREATED_AT="[null]"/-->
index 09e1ecd3edf8097605e3f75587c4c3f09ed93ce6..4e2999bcb46abb730445fa09c19b41b2a10715e3 100644 (file)
                 parent_dependency_id="[null]" project_snapshot_id="1"
                 dep_usage="INHERITS" dep_weight="1" from_scope="FIL" to_scope="FIL"/>
 
-  <duplications_index id="1" project_snapshot_id="1" snapshot_id="3" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
-  <duplications_index id="2" project_snapshot_id="1" snapshot_id="4" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
+  <duplications_index project_snapshot_id="1" snapshot_id="3" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
+  <duplications_index project_snapshot_id="1" snapshot_id="4" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
 
   <events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]" event_date="2008-12-02 13:58:00.00" CREATED_AT="[null]"/>
   <events id="2" name="Version 2.0" resource_id="3" snapshot_id="3" category="VERSION" description="[null]" event_date="2008-12-02 13:58:00.00" CREATED_AT="[null]"/>
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/DuplicationBlock.java b/sonar-core/src/main/java/org/sonar/jpa/entity/DuplicationBlock.java
deleted file mode 100644 (file)
index 4e4ea87..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.jpa.entity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * @since 2.11
- */
-@Entity
-@Table(name = "duplications_index")
-public class DuplicationBlock {
-
-  public static final int BLOCK_HASH_SIZE = 50;
-
-  @Id
-  @Column(name = "id")
-  @GeneratedValue
-  private Integer id;
-
-  @Column(name = "snapshot_id", updatable = false, nullable = false)
-  private Integer snapshotId;
-
-  @Column(name = "project_snapshot_id", updatable = false, nullable = false)
-  private Integer projectSnapshotId;
-
-  @Column(name = "hash", updatable = false, nullable = false, length = BLOCK_HASH_SIZE)
-  private String hash;
-
-  @Column(name = "index_in_file", updatable = false, nullable = false)
-  private Integer indexInFile;
-
-  @Column(name = "start_line", updatable = false, nullable = false)
-  private Integer startLine;
-
-  @Column(name = "end_line", updatable = false, nullable = false)
-  private Integer endLine;
-
-  public DuplicationBlock() {
-  }
-
-  public DuplicationBlock(Integer projectSnapshotId, Integer snapshotId, String hash, Integer indexInFile, Integer startLine, Integer endLine) {
-    this.projectSnapshotId = projectSnapshotId;
-    this.snapshotId = snapshotId;
-    this.hash = hash;
-    this.indexInFile = indexInFile;
-    this.startLine = startLine;
-    this.endLine = endLine;
-  }
-
-  public Integer getId() {
-    return id;
-  }
-
-  public Integer getSnapshotId() {
-    return snapshotId;
-  }
-
-  public Integer getProjectSnapshotId() {
-    return projectSnapshotId;
-  }
-
-  public String getHash() {
-    return hash;
-  }
-
-  public Integer getIndexInFile() {
-    return indexInFile;
-  }
-
-  public Integer getStartLine() {
-    return startLine;
-  }
-
-  public Integer getEndLine() {
-    return endLine;
-  }
-
-}
index a6e83a345f1f488d7f7906a80fd60456402d0c6e..67661c1ce0203e8bf168c79e80bb6e36e1eba2a1 100644 (file)
@@ -42,7 +42,7 @@ public class SchemaMigration {
       - complete the Derby DDL file used for unit tests : sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl
 
    */
-  public static final int LAST_VERSION = 238;
+  public static final int LAST_VERSION = 239;
 
   public final static String TABLE_NAME = "schema_migrations";
 
index 94f5d05fda26023ed73d4e4bd6d3beb57ee4b19b..868c66c43c6978b3faf9d38c8445a8328cc0d734 100644 (file)
@@ -24,8 +24,6 @@ package org.sonar.persistence.duplication;
  */
 public final class DuplicationUnitDto {
 
-  private Long id;
-
   private Integer snapshotId;
   private Integer projectSnapshotId;
 
@@ -48,14 +46,6 @@ public final class DuplicationUnitDto {
     this.endLine = endLine;
   }
 
-  public Long getId() {
-    return id;
-  }
-
-  public void setId(Long id) {
-    this.id = id;
-  }
-
   public Integer getSnapshotId() {
     return snapshotId;
   }
index 2d427ffec0411049407c2d7ae4847da4d686e398..17940cd5f5b06671839697df177a745f6f55f004 100644 (file)
@@ -36,7 +36,6 @@
     <class>org.sonar.api.rules.ActiveRuleParamChange</class>
     <class>org.sonar.jpa.entity.Review</class>
     <class>org.sonar.jpa.entity.NotificationQueueElement</class>
-    <class>org.sonar.jpa.entity.DuplicationBlock</class>
 
     <properties>
       <property name="hibernate.current_session_context_class" value="thread"/>
index ff100644a9ced85525a726a30c256a0193b78ee5..c2577c58ef8d55fb86119679aead8af12dd4e0cb 100644 (file)
@@ -16,7 +16,7 @@
     </if>
   </select>
 
-  <insert id="batchInsert" parameterType="DuplicationUnit" keyColumn="id" useGeneratedKeys="false">
+  <insert id="batchInsert" parameterType="DuplicationUnit" useGeneratedKeys="false">
     INSERT INTO duplications_index (snapshot_id, project_snapshot_id, hash, index_in_file, start_line, end_line)
     VALUES (#{snapshotId}, #{projectSnapshotId}, #{hash}, #{indexInFile}, #{startLine}, #{endLine})
   </insert>
index 98520444a07567264a1b4e9f86d5648803f7092c..c2577c58ef8d55fb86119679aead8af12dd4e0cb 100644 (file)
@@ -16,9 +16,9 @@
     </if>
   </select>
 
-  <insert id="batchInsert" parameterType="DuplicationUnit" keyColumn="id" useGeneratedKeys="false">
-    INSERT INTO duplications_index (id, snapshot_id, project_snapshot_id, hash, index_in_file, start_line, end_line)
-    VALUES (duplications_index_seq.NEXTVAL, #{snapshotId}, #{projectSnapshotId}, #{hash}, #{indexInFile}, #{startLine}, #{endLine})
+  <insert id="batchInsert" parameterType="DuplicationUnit" useGeneratedKeys="false">
+    INSERT INTO duplications_index (snapshot_id, project_snapshot_id, hash, index_in_file, start_line, end_line)
+    VALUES (#{snapshotId}, #{projectSnapshotId}, #{hash}, #{indexInFile}, #{startLine}, #{endLine})
   </insert>
 
 </mapper>
index d7e195a9acef42faa47d1b2aa2dfb6d714a669a9..2be852b3d1c63eb40f36200ec6c0673343ff47dd 100644 (file)
@@ -167,6 +167,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('235');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('236');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('237');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('238');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('239');
 
 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 693b15d635c965f9dc23ce1c5d54d65e5ba84cc3..02ae63063d2349d9769f9a0d91b5ae550f9d8934 100644 (file)
@@ -223,7 +223,6 @@ CREATE TABLE "PROJECT_LINKS" (
 );
 
 CREATE TABLE "DUPLICATIONS_INDEX" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
   "PROJECT_SNAPSHOT_ID" INTEGER NOT NULL,
   "SNAPSHOT_ID" INTEGER NOT NULL,
   "HASH" VARCHAR(50) NOT NULL,
@@ -591,8 +590,6 @@ ALTER TABLE "RULES" ADD CONSTRAINT "SQL110927104437080" PRIMARY KEY ("ID");
 
 ALTER TABLE "USER_ROLES" ADD CONSTRAINT "SQL110927104437940" PRIMARY KEY ("ID");
 
-ALTER TABLE "DUPLICATIONS_INDEX" ADD CONSTRAINT "SQL110927104441080" PRIMARY KEY ("ID");
-
 ALTER TABLE "SNAPSHOT_SOURCES" ADD CONSTRAINT "SQL110927104437590" PRIMARY KEY ("ID");
 
 ALTER TABLE "NOTIFICATIONS" ADD CONSTRAINT "SQL110927104441030" PRIMARY KEY ("ID");
index 9621999dc85df482251171bb9e3dbc3b3f5c9321..88632baf0a1c69d8bbd44037135b519609692de0 100644 (file)
@@ -20,7 +20,6 @@
 package org.sonar.persistence.duplication;
 
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
 import static org.junit.Assert.assertThat;
 
 import java.util.Arrays;
@@ -28,13 +27,10 @@ import java.util.List;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.sonar.jpa.test.AbstractDbUnitTestCase;
 import org.sonar.persistence.DaoTestCase;
 import org.sonar.persistence.duplication.DuplicationDao;
 import org.sonar.persistence.duplication.DuplicationUnitDto;
 
-import com.google.common.collect.Lists;
-
 public class DuplicationDaoTest extends DaoTestCase {
 
   private DuplicationDao dao;
@@ -72,18 +68,4 @@ public class DuplicationDaoTest extends DaoTestCase {
     checkTables("shouldInsert", "duplications_index");
   }
 
-  @Test
-  public void testBatchInsert() {
-    List<DuplicationUnitDto> duplications = Lists.newArrayList();
-    for (int i = 0; i < 50; i++) {
-      duplications.add(new DuplicationUnitDto(i, i, "hash", 2, 30, 40));
-    }
-    dao.insert(duplications);
-
-    for (DuplicationUnitDto duplication : duplications) {
-      // batch insert : faster but generated ids are not returned
-      assertThat(duplication.getId(), nullValue());
-    }
-  }
-
 }
index 8edbe99067bc3e5029ed00d0bcce3c9e22a77386..4f821a44e311bfa112b01801acab64eb8faae79e 100644 (file)
 
   <!-- Old snapshot of another project -->
   <!-- bar-old -->
-  <duplications_index id="1" project_snapshot_id="1" snapshot_id="2" hash="bb" index_in_file="0" start_line="0" end_line="0" />
+  <duplications_index project_snapshot_id="1" snapshot_id="2" hash="bb" index_in_file="0" start_line="0" end_line="0" />
 
   <!-- Last snapshot of another project -->
   <!-- bar-last -->
-  <duplications_index id="2" project_snapshot_id="3" snapshot_id="4" hash="aa" index_in_file="0" start_line="1" end_line="2" />
+  <duplications_index project_snapshot_id="3" snapshot_id="4" hash="aa" index_in_file="0" start_line="1" end_line="2" />
 
   <!-- Old snapshot of current project -->
   <!-- foo-old -->
-  <duplications_index id="3" project_snapshot_id="5" snapshot_id="6" hash="bb" index_in_file="0" start_line="0" end_line="0" />
+  <duplications_index project_snapshot_id="5" snapshot_id="6" hash="bb" index_in_file="0" start_line="0" end_line="0" />
 
   <!-- Last snapshot of current project -->
   <!-- foo-last -->
-  <duplications_index id="4" project_snapshot_id="7" snapshot_id="8" hash="aa" index_in_file="0" start_line="0" end_line="0" />
+  <duplications_index project_snapshot_id="7" snapshot_id="8" hash="aa" index_in_file="0" start_line="0" end_line="0" />
 
   <!-- New snapshot of current project -->
   <!-- foo -->
-  <duplications_index id="5" project_snapshot_id="9" snapshot_id="10" hash="aa" index_in_file="0" start_line="0" end_line="0" />
+  <duplications_index project_snapshot_id="9" snapshot_id="10" hash="aa" index_in_file="0" start_line="0" end_line="0" />
 
   <!-- Note that there is two blocks with same hash for current analysis to verify that we use "SELECT DISTINCT", -->
   <!-- without "DISTINCT" we will select block from "bar-last" two times. -->
-  <duplications_index id="6" project_snapshot_id="9" snapshot_id="10" hash="aa" index_in_file="1" start_line="1" end_line="1" />
+  <duplications_index project_snapshot_id="9" snapshot_id="10" hash="aa" index_in_file="1" start_line="1" end_line="1" />
 
 </dataset>
index 619646c18219153112312c493732fd54e0049ba7..7149a08ee8c853aedfe1d0a2f14360f20d438b08 100644 (file)
@@ -4,6 +4,6 @@
   <snapshots id="2" status="U" islast="0" project_id="1" />
   <projects id="1" kee="foo" enabled="1" scope="FIL" qualifier="CLA" />
 
-  <duplications_index id="1" project_snapshot_id="1" snapshot_id="2" hash="bb" index_in_file="0" start_line="1" end_line="2" />
+  <duplications_index project_snapshot_id="1" snapshot_id="2" hash="bb" index_in_file="0" start_line="1" end_line="2" />
 
 </dataset>
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/239_delete_duplications_id.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/239_delete_duplications_id.rb
new file mode 100644 (file)
index 0000000..96eeaab
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2011 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar 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.
+#
+# Sonar 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 Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+#
+
+#
+# Sonar 2.13
+#
+class DeleteDuplicationsId < ActiveRecord::Migration
+
+  def self.up
+    begin
+      remove_column('duplications_index', 'id')
+    end
+  end
+
+end