import org.sonar.core.issue.workflow.IssueWorkflow;
import java.util.Collection;
+import java.util.Map;
@DependedUpon(DecoratorBarriers.END_OF_ISSUES_UPDATES)
public class IssueTrackingDecorator implements Decorator {
// fields to update with current values
if (ref.isManualSeverity()) {
issue.setManualSeverity(true);
- issue.setSeverity(ref.getSeverityLabel());
+ issue.setSeverity(ref.getSeverity());
} else {
// Emulate change of severity in the current scan.
String severity = issue.severity();
- issue.setSeverity(ref.getSeverityLabel());
+ issue.setSeverity(ref.getSeverity());
updater.setSeverity(issue, severity, changeContext);
}
Integer line = issue.line();
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.rule.RuleKey;
-import org.sonar.api.rule.Severity;
import org.sonar.api.utils.KeyValueFormat;
import org.sonar.core.issue.DefaultIssue;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-
import java.util.Date;
/**
private String kee;
private Integer resourceId;
private Integer ruleId;
- private Integer severity;
+ private String severity;
private boolean manualSeverity;
private String message;
private Integer line;
}
@CheckForNull
- public Integer getSeverity() {
+ public String getSeverity() {
return severity;
}
- public IssueDto setSeverity(@Nullable Integer severity) {
+ public IssueDto setSeverity(@Nullable String severity) {
this.severity = severity;
return this;
}
return componentKey;
}
- @CheckForNull
- public String getSeverityLabel() {
- return severity != null ? Severity.ALL.get(severity - 1) : null;
- }
-
/**
* Only for unit tests
*/
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
- private static Integer toSeverityIndex(final String severity){
- if (severity != null) {
- return Iterables.indexOf(Severity.ALL, new Predicate<String>() {
- @Override
- public boolean apply(String currentSeverity) {
- return currentSeverity.equals(severity);
- }
- }) + 1;
- }
- return null;
- }
-
public static IssueDto toDtoForInsert(DefaultIssue issue, Integer componentId, Integer ruleId, Date now) {
return new IssueDto()
.setKee(issue.key())
.setEffortToFix(issue.effortToFix())
.setResolution(issue.resolution())
.setStatus(issue.status())
- .setSeverity(toSeverityIndex(issue.severity()))
+ .setSeverity(issue.severity())
.setChecksum(issue.getChecksum())
.setManualSeverity(issue.manualSeverity())
.setReporter(issue.reporter())
.setEffortToFix(issue.effortToFix())
.setResolution(issue.resolution())
.setStatus(issue.status())
- .setSeverity(toSeverityIndex(issue.severity()))
+ .setSeverity(issue.severity())
.setChecksum(issue.getChecksum())
.setManualSeverity(issue.manualSeverity())
.setReporter(issue.reporter())
issue.setMessage(message);
issue.setEffortToFix(effortToFix);
issue.setLine(line);
- issue.setSeverity(getSeverityLabel());
+ issue.setSeverity(severity);
issue.setReporter(reporter);
issue.setAssignee(assignee);
issue.setAttributes(KeyValueFormat.parse(Objects.firstNonNull(attributes, "")));
*/
public class DatabaseVersion implements BatchComponent, ServerComponent {
- public static final int LAST_VERSION = 399;
+ public static final int LAST_VERSION = 397;
public static enum Status {
UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
<foreach item="key" index="index" collection="issueKeys" open="(" separator="," close=")">#{key}
</foreach>
</if>
- <if test="severitiesIndexSql != null">
+ <if test="severities != null">
and i.severity in
- <foreach item="severity" index="index" collection="severitiesIndexSql" open="(" separator="," close=")">#{severity}
+ <foreach item="severity" index="index" collection="severities" open="(" separator="," close=")">#{severity}
</foreach>
</if>
<if test="statuses != null">
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('391');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('392');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('394');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('395');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('396');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('397');
-INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('398');
-INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('399');
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;
"KEE" VARCHAR(50) UNIQUE NOT NULL,
"RESOURCE_ID" INTEGER NOT NULL,
"RULE_ID" INTEGER,
- "SEVERITY" INTEGER,
+ "SEVERITY" VARCHAR(10),
"MANUAL_SEVERITY" BOOLEAN NOT NULL,
"MESSAGE" VARCHAR(4000),
"LINE" INTEGER,
assertThat(issue.getId()).isEqualTo(100L);
assertThat(issue.getResourceId()).isEqualTo(401);
assertThat(issue.getRuleId()).isEqualTo(500);
- assertThat(issue.getSeverity()).isEqualTo(5);
+ assertThat(issue.getSeverity()).isEqualTo("BLOCKER");
assertThat(issue.isManualSeverity()).isFalse();
assertThat(issue.getMessage()).isNull();
assertThat(issue.getLine()).isEqualTo(200);
IssueQuery query = IssueQuery.builder().sort(IssueQuery.Sort.SEVERITY).asc(true).build();
List<IssueDto> results = newArrayList(dao.select(query));
assertThat(results).hasSize(3);
- assertThat(results.get(0).getSeverityLabel()).isEqualTo("MINOR");
- assertThat(results.get(1).getSeverityLabel()).isEqualTo("MAJOR");
- assertThat(results.get(2).getSeverityLabel()).isEqualTo("BLOCKER");
+ assertThat(results.get(0).getSeverity()).isEqualTo("BLOCKER");
+ assertThat(results.get(1).getSeverity()).isEqualTo("MAJOR");
+ assertThat(results.get(2).getSeverity()).isEqualTo("MINOR");
}
@Test
.setResolution(Issue.RESOLUTION_FALSE_POSITIVE)
.setEffortToFix(15.0)
.setLine(6)
- .setSeverity(5)
+ .setSeverity("BLOCKER")
.setMessage("message")
.setManualSeverity(true)
.setReporter("arthur")
dto.setEffortToFix(3.14);
dto.setResolution("FIXED");
dto.setStatus("RESOLVED");
- dto.setSeverity(5);
+ dto.setSeverity("BLOCKER");
dto.setReporter("emmerik");
dto.setAuthorLogin("morgan");
dto.setAssignee("karadoc");
dto.setEffortToFix(3.14);
dto.setResolution("FIXED");
dto.setStatus("RESOLVED");
- dto.setSeverity(5);
+ dto.setSeverity("BLOCKER");
dto.setReporter("emmerik");
dto.setAuthorLogin("morgan");
dto.setAssignee("karadoc");
kee="ABCDE"
resource_id="400"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDF"
resource_id="400"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDG"
resource_id="400"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
resource_id="401"
rule_id="500"
action_plan_key="ABC"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
resource_id="401"
rule_id="500"
action_plan_key="ABC"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
resource_id="401"
rule_id="501"
action_plan_key="DEF"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="100"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="101"
resource_id="402"
rule_id="501"
- severity="3"
+ severity="MAJOR"
manual_severity="[false]"
message="[null]"
line="120"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
resource_id="401"
rule_id="500"
action_plan_key="ABC"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
resource_id="401"
rule_id="500"
action_plan_key="ABC"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
resource_id="401"
rule_id="501"
action_plan_key="[null]"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="100"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="101"
resource_id="402"
rule_id="501"
- severity="3"
+ severity="MAJOR"
manual_severity="[false]"
message="[null]"
line="120"
kee="102"
resource_id="402"
rule_id="501"
- severity="3"
+ severity="MAJOR"
manual_severity="[false]"
message="[null]"
line="120"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="2"
+ severity="MINOR"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="3"
+ severity="MAJOR"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-1"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-2"
resource_id="401"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE-3"
resource_id="401"
rule_id="501"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="ABCDE"
resource_id="123"
rule_id="200"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="the message"
line="500"
kee="ABCDE"
resource_id="123"
rule_id="200"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="the message"
line="500"
kee="ABCDE"
resource_id="123"
rule_id="200"
- severity="1"
+ severity="INFO"
manual_severity="[false]"
message="old"
line="[null]"
<dataset>
- <issues id="1" kee="ABCDE" resolution="OPEN" status="OPEN" severity="5" manual_severity="[false]"
+ <issues id="1" kee="ABCDE" resolution="OPEN" status="OPEN" severity="BLOCKER" manual_severity="[false]"
assignee="[null]"
author_login="[null]"
checksum="[null]"
kee="ABCDE"
resolution="FIXED"
status="RESOLVED"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
assignee="loic"
author_login="simon"
kee="ABCDE"
resolution="OPEN"
status="OPEN"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
assignee="loic"
author_login="simon"
kee="100"
resource_id="400"
rule_id="500"
- severity="5"
+ severity="BLOCKER"
manual_severity="[false]"
message="[null]"
line="200"
kee="101"
resource_id="401"
rule_id="501"
- severity="3"
+ severity="MAJOR"
manual_severity="[false]"
message="[null]"
line="120"
<review_comments id="1" created_at="[null]" updated_at="[null]" review_id="1" user_id="1223" review_text="abc"/>
- <issues id="1" kee="ABCDE" resource_id="1" status="CLOSED" resolution="[null]" line="200" severity="5"
+ <issues id="1" kee="ABCDE" resource_id="1" status="CLOSED" resolution="[null]" line="200" severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"
manual_severity="[false]"
message="[null]"
<review_comments id="1" created_at="[null]" updated_at="[null]" review_id="2" user_id="1223" review_text="abc"/>
- <issues id="1" kee="ABCDE" resource_id="1" status="CLOSED" resolution="[null]" line="200" severity="5"
+ <issues id="1" kee="ABCDE" resource_id="1" status="CLOSED" resolution="[null]" line="200" severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"
manual_severity="[false]"
message="[null]"
issue_close_date="2013-04-16"
/>
- <issues id="2" kee="ABCDF" resource_id="1" status="CLOSED" resolution="[null]" line="200" severity="5"
+ <issues id="2" kee="ABCDF" resource_id="1" status="CLOSED" resolution="[null]" line="200" severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"
manual_severity="[false]"
message="[null]"
*/
package org.sonar.api.issue;
-import com.google.common.base.Function;
import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.sonar.api.rule.RuleKey;
-import org.sonar.api.rule.Severity;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Date;
-import static com.google.common.collect.Lists.newArrayList;
-
/**
* @since 3.6
*/
// index of selected page. Start with 1.
private final int pageIndex;
- // for internal use in MyBatis
- protected final Collection<Integer> severitiesIndexSql;
-
private IssueQuery(Builder builder) {
this.issueKeys = builder.issueKeys;
this.severities = builder.severities;
this.pageSize = builder.pageSize;
this.pageIndex = builder.pageIndex;
this.requiredRole = builder.requiredRole;
-
- this.severitiesIndexSql = severitiesIndexSql(severities);
}
public Collection<String> issueKeys() {
return new Builder();
}
- private Collection<Integer> severitiesIndexSql(@Nullable Collection<String> severities) {
- if (severities != null) {
- return newArrayList(Iterables.transform(severities, new Function<String, Integer>() {
- @Override
- public Integer apply(final String currentSeverity) {
- return Iterables.indexOf(Severity.ALL, new Predicate<String>() {
- @Override
- public boolean apply(String severity) {
- return severity.equals(currentSeverity);
- }
- }) + 1;
- };
- }));
- }
- return null;
- }
-
public static class Builder {
private Collection<String> issueKeys;
private Collection<String> severities;
assertThat(query.pageSize()).isEqualTo(10);
assertThat(query.pageIndex()).isEqualTo(2);
assertThat(query.requiredRole()).isEqualTo(UserRole.CODEVIEWER);
- assertThat(query.severitiesIndexSql).containsOnly(5);
}
@Test
--- /dev/null
+#
+# 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 => 50
+ t.column :resource_id, :integer, :null => false
+ t.column :rule_id, :integer, :null => true
+ t.column :severity, :string, :null => true, :limit => 10
+ t.column :manual_severity, :boolean, :null => false
+ t.column :message, :string, :null => true, :limit => 4000
+ t.column :line, :integer, :null => true
+ t.column :effort_to_fix, :decimal, :null => true, :precision => 30, :scale => 20
+ t.column :status, :string , :null => true, :limit => 20
+ t.column :resolution, :string , :null => true, :limit => 20
+ t.column :checksum, :string , :null => true, :limit => 1000
+ t.column :reporter, :string, :null => true, :limit => 40
+ t.column :assignee, :string, :null => true, :limit => 40
+ t.column :author_login, :string, :null => true, :limit => 100
+ t.column :action_plan_key, :string, :null => true, :limit => 50
+ t.column :attributes, :string, :null => true, :limit => 4000
+
+ # functional dates
+ t.column :issue_creation_date, :datetime, :null => true
+ t.column :issue_close_date, :datetime, :null => true
+ t.column :issue_update_date, :datetime, :null => true
+
+ # technical dates
+ t.column :created_at, :datetime, :null => true
+ t.column :updated_at, :datetime, :null => true
+ end
+
+ add_index :issues, :kee, :name => 'issues_kee', :unique => true
+ add_index :issues, :resource_id, :name => 'issues_resource_id'
+ add_index :issues, :rule_id, :name => 'issues_rule_id'
+ add_index :issues, :severity, :name => 'issues_severity'
+ add_index :issues, :status, :name => 'issues_status'
+ add_index :issues, :assignee, :name => 'issues_assignee'
+ add_index :issues, :action_plan_key, :name => 'issues_action_plan_key'
+ add_index :issues, :issue_creation_date, :name => 'issues_creation_date'
+ end
+
+end
+
--- /dev/null
+#
+# 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 :kee, :string, :null => true, :limit => 50
+ t.column :issue_key, :string, :null => false, :limit => 50
+ t.column :user_login, :string, :null => true, :limit => 40
+ t.column :change_type, :string, :null => true, :limit => 20
+ t.column :change_data, :text, :null => true
+ t.column :created_at, :datetime, :null => true
+ t.column :updated_at, :datetime, :null => true
+ end
+
+ add_index :issue_changes, :kee, :name => 'issue_changes_kee'
+ add_index :issue_changes, :issue_key, :name => 'issue_changes_issue_key'
+ end
+
+end
+
+++ /dev/null
-#
-# 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 => 50
- t.column :resource_id, :integer, :null => false
- t.column :rule_id, :integer, :null => true
- t.column :severity, :integer, :null => true
- t.column :manual_severity, :boolean, :null => false
- t.column :message, :string, :null => true, :limit => 4000
- t.column :line, :integer, :null => true
- t.column :effort_to_fix, :decimal, :null => true, :precision => 30, :scale => 20
- t.column :status, :string , :null => true, :limit => 20
- t.column :resolution, :string , :null => true, :limit => 20
- t.column :checksum, :string , :null => true, :limit => 1000
- t.column :reporter, :string, :null => true, :limit => 40
- t.column :assignee, :string, :null => true, :limit => 40
- t.column :author_login, :string, :null => true, :limit => 100
- t.column :action_plan_key, :string, :null => true, :limit => 50
- t.column :attributes, :string, :null => true, :limit => 4000
-
- # functional dates
- t.column :issue_creation_date, :datetime, :null => true
- t.column :issue_close_date, :datetime, :null => true
- t.column :issue_update_date, :datetime, :null => true
-
- # technical dates
- t.column :created_at, :datetime, :null => true
- t.column :updated_at, :datetime, :null => true
- end
-
- add_index :issues, :kee, :name => 'issues_kee', :unique => true
- add_index :issues, :resource_id, :name => 'issues_resource_id'
- add_index :issues, :rule_id, :name => 'issues_rule_id'
- add_index :issues, :severity, :name => 'issues_severity'
- add_index :issues, :status, :name => 'issues_status'
- add_index :issues, :assignee, :name => 'issues_assignee'
- add_index :issues, :action_plan_key, :name => 'issues_action_plan_key'
- add_index :issues, :issue_creation_date, :name => 'issues_creation_date'
- end
-
-end
-
+++ /dev/null
-#
-# 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 :kee, :string, :null => true, :limit => 50
- t.column :issue_key, :string, :null => false, :limit => 50
- t.column :user_login, :string, :null => true, :limit => 40
- t.column :change_type, :string, :null => true, :limit => 20
- t.column :change_data, :text, :null => true
- t.column :created_at, :datetime, :null => true
- t.column :updated_at, :datetime, :null => true
- end
-
- add_index :issue_changes, :kee, :name => 'issue_changes_kee'
- add_index :issue_changes, :issue_key, :name => 'issue_changes_issue_key'
- end
-
-end
-