summaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-04-09 10:03:20 +0200
committerJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>2013-04-09 10:03:20 +0200
commit5fee326983c1b11c1ce95fc9582b11fcf578ee53 (patch)
treedbf0c3225317e13515f7f762072a1655d3c7d672 /sonar-server
parent2a0843355942ed03672048cb36b2eec25f8e410b (diff)
downloadsonarqube-5fee326983c1b11c1ce95fc9582b11fcf578ee53.tar.gz
sonarqube-5fee326983c1b11c1ce95fc9582b11fcf578ee53.zip
(SONAR-3893) Improve the highlighter API to not depend on sonar-channel and allow to work on multi-line tokens - Added new table SNAPSHOT_DATA to store the highlighting data
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/snapshot_data.rb31
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/387_create_snapshot_data.rb44
2 files changed, 75 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot_data.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot_data.rb
new file mode 100644
index 00000000000..5ec309e06a3
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot_data.rb
@@ -0,0 +1,31 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2012 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 3.6
+#
+
+class SnapshotData < ActiveRecord::Base
+
+ set_table_name :snapshot_data
+
+ belongs_to :snapshot
+
+end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/387_create_snapshot_data.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/387_create_snapshot_data.rb
new file mode 100644
index 00000000000..466bf99fa0a
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/387_create_snapshot_data.rb
@@ -0,0 +1,44 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2012 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 3.6
+#
+
+class CreateSnapshotData :: ActiveRecord::Migration
+
+ def self.up
+ create_table :snapshot_data do |t|
+ t.column :snapshot_id, :integer, :null => true
+ t.column :resource_id, :integer, :null => true
+ t.column :data, :text, :null => true
+ t.column :data_type, :string, :null => true, :limit => 50
+ t.timestamps
+ end
+
+ begin
+ add_index :snapshot_data, :snapshot_id, :name => 'snapshot_data_snapshot_id'
+ rescue
+ #ignore already existing index
+ end
+ end
+
+
+end \ No newline at end of file