--- /dev/null
+/*
+ * Sonar, open source software quality management 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
+ */
+
+package org.sonar.core.issue;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import org.sonar.api.component.Component;
+import org.sonar.api.issue.Issuable;
+import org.sonar.api.issue.Issue;
+import org.sonar.api.issue.IssueChangelog;
+
+import java.util.List;
+
+/**
+ * @since 3.6
+ */
+public class DefaultIssuable implements Issuable {
+
+ public List<Issue> issues;
+
+ public DefaultIssuable(List<Issue> issues) {
+ this.issues = issues;
+ }
+
+ public Issue apply(Issue issue, IssueChangelog issueChangelog) {
+ DefaultIssue defaultIssue = findIssue(issue);
+
+ if (!Objects.equal(defaultIssue.severity(), issueChangelog.severity())) {
+ defaultIssue.severity(issueChangelog.severity());
+ }
+ if (!Objects.equal(defaultIssue.status(), issueChangelog.status())) {
+ defaultIssue.status(issueChangelog.status());
+ }
+ if (!Objects.equal(defaultIssue.resolution(), issueChangelog.resolution())) {
+ defaultIssue.resolution(issueChangelog.resolution());
+ }
+ if (!Objects.equal(defaultIssue.line(), issueChangelog.line())) {
+ defaultIssue.line(issueChangelog.line());
+ // Do not add changelog if only line has changed
+ }
+
+ defaultIssue.addIssueChangelog(issueChangelog);
+ return defaultIssue;
+ }
+
+ private DefaultIssue findIssue(final Issue issue) {
+ return (DefaultIssue) Iterables.find(issues, new Predicate<Issue>() {
+ public boolean apply(Issue currentIssue) {
+ return currentIssue.uuid().equals(issue.uuid());
+ }
+ });
+ }
+
+ public List<Issue> issues() {
+ return issues;
+ }
+
+ public Component component() {
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Sonar, open source software quality management 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
+ */
+
+package org.sonar.core.issue;
+
+import org.sonar.api.issue.Issue;
+import org.sonar.api.issue.IssueChangelog;
+
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+import static com.google.common.collect.Lists.newArrayList;
+
+/**
+ * @since 3.6
+ */
+public class DefaultIssue implements Issue {
+
+ private String uuid;
+ private String componentKey;
+ private String ruleKey;
+ private String ruleRepositoryKey;
+ private String severity;
+ private String message;
+ private Integer line;
+ private Double cost;
+ private String status;
+ private String resolution;
+ private Date createdAt;
+
+ private List<IssueChangelog> issueChangelogList;
+
+ private DefaultIssue(Builder builder) {
+ this.uuid = builder.uuid;
+ this.componentKey = builder.componentKey;
+ this.ruleKey = builder.ruleKey;
+ this.ruleRepositoryKey = builder.ruleRepositoryKey;
+ this.severity = builder.severity;
+ this.message = builder.message;
+ this.line = builder.line;
+ this.cost = builder.cost;
+ this.status = builder.status;
+ this.resolution = builder.resolution;
+ this.createdAt = builder.createdAt;
+
+ this.issueChangelogList= newArrayList();
+ }
+
+ public String uuid() {
+ return uuid;
+ }
+
+ public String componentKey() {
+ return componentKey;
+ }
+
+ public String ruleKey() {
+ return ruleKey;
+ }
+
+ public String ruleRepositoryKey() {
+ return ruleRepositoryKey;
+ }
+
+ public String severity() {
+ return severity;
+ }
+
+ public DefaultIssue severity(String severity){
+ this.severity = severity;
+ return this;
+ }
+
+ public String message() {
+ return message;
+ }
+
+ public Integer line() {
+ return line;
+ }
+
+ public DefaultIssue line(Integer line){
+ this.line = line;
+ return this;
+ }
+
+ public Double cost() {
+ return cost;
+ }
+
+ public String status() {
+ return status;
+ }
+
+ public DefaultIssue status(String status){
+ this.status = status;
+ return this;
+ }
+
+ public String resolution() {
+ return resolution;
+ }
+
+ public DefaultIssue resolution(String resolution){
+ this.resolution = resolution;
+ return this;
+ }
+
+ public Date createdAt() {
+ return createdAt;
+ }
+
+ public List<IssueChangelog> issueChangelogList() {
+ return issueChangelogList;
+ }
+
+ public DefaultIssue addIssueChangelog(IssueChangelog issueChangelog) {
+ issueChangelogList.add(issueChangelog);
+ return this;
+ }
+
+ /**
+ * @since 3.6
+ */
+ public static class Builder {
+ private String uuid;
+ private String componentKey;
+ private String ruleKey;
+ private String ruleRepositoryKey;
+ private String severity;
+ private String message;
+ private Integer line;
+ private Double cost;
+ private String status;
+ private String resolution;
+ private Date createdAt;
+
+ public Builder() {
+ uuid = UUID.randomUUID().toString();
+ createdAt = new Date();
+ }
+
+ public Builder componentKey(String componentKey) {
+ this.componentKey = componentKey;
+ return this;
+ }
+
+ public Builder ruleKey(String ruleKey) {
+ this.ruleKey = ruleKey;
+ return this;
+ }
+
+ public Builder ruleRepositoryKey(String ruleRepositoryKey) {
+ this.ruleRepositoryKey = ruleRepositoryKey;
+ return this;
+ }
+
+ public Builder severity(String severity) {
+ this.severity = severity;
+ return this;
+ }
+
+ public Builder message(String message) {
+ this.message = message;
+ return this;
+ }
+
+ public Builder line(Integer line) {
+ this.line = line;
+ return this;
+ }
+
+ public Builder cost(Double cost) {
+ this.cost = cost;
+ return this;
+ }
+
+ public Builder status(String status) {
+ this.status = status;
+ return this;
+ }
+
+ public Builder resolution(String resolution) {
+ this.resolution = resolution;
+ return this;
+ }
+
+ public DefaultIssue build() {
+ return new DefaultIssue(this);
+ }
+ }
+}
--- /dev/null
+/*
+ * Sonar, open source software quality management 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
+ */
+
+package org.sonar.core.issue;
+
+import org.sonar.api.issue.IssueChangelog;
+
+import java.util.Date;
+
+/**
+ * @since 3.6
+ */
+public class DefaultIssueChangelog implements IssueChangelog {
+
+ private String severity;
+ private String status;
+ private String resolution;
+ private String message;
+ private Integer line;
+
+ private Date createdAt;
+
+ private DefaultIssueChangelog(Builder builder) {
+ this.severity = builder.severity;
+ this.status = builder.status;
+ this.resolution = builder.resolution;
+ this.message = builder.message;
+ this.line = builder.line;
+ this.createdAt = builder.createdAt;
+ }
+
+ public String severity() {
+ return severity;
+ }
+
+ public String status() {
+ return status;
+ }
+
+ public String resolution() {
+ return resolution;
+ }
+
+ public String message() {
+ return message;
+ }
+
+ public Integer line() {
+ return line;
+ }
+
+ public Date createdAt() {
+ return createdAt;
+ }
+
+ /**
+ * @since 3.6
+ */
+ public static class Builder {
+ private String severity;
+ private String status;
+ private String resolution;
+ private String message;
+ private Integer line;
+
+ private Date createdAt;
+
+ public Builder() {
+ createdAt = new Date();
+ }
+
+ public Builder severity(String severity) {
+ this.severity = severity;
+ return this;
+ }
+
+ public Builder status(String status) {
+ this.status = status;
+ return this;
+ }
+
+ public Builder resolution(String resolution) {
+ this.resolution = resolution;
+ return this;
+ }
+
+ public Builder message(String message) {
+ this.message = message;
+ return this;
+ }
+
+ public Builder line(Integer line) {
+ this.line = line;
+ return this;
+ }
+
+ public DefaultIssueChangelog build() {
+ return new DefaultIssueChangelog(this);
+ }
+ }
+}
"groups",
"groups_users",
"group_roles",
+ "issues",
+ "issue_changelog",
"loaded_templates",
"manual_measures",
"measure_data",
*/
public class DatabaseVersion implements BatchComponent, ServerComponent {
- public static final int LAST_VERSION = 384;
+ public static final int LAST_VERSION = 386;
public static enum Status {
UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
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 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;
"UPDATED_AT" TIMESTAMP
);
+CREATE TABLE "ISSUES" (
+ "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ "UUID" VARCHAR(36) NOT NULL,
+ "RESOURCE_ID" INTEGER NOT NULL,
+ "RULE_ID" INTEGER NOT NULL,
+ "SEVERITY" VARCHAR(10),
+ "MANUAL_SEVERITY" BOOLEAN NOT NULL,
+ "MANUAL_ISSUE" BOOLEAN NOT NULL,
+ "TITLE" VARCHAR(500),
+ "MESSAGE" VARCHAR(4000),
+ "LINE" INTEGER,
+ "COST" DOUBLE,
+ "STATUS" VARCHAR(10),
+ "RESOLUTION" VARCHAR(200),
+ "CHECKSUM" VARCHAR(1000),
+ "ASSIGNEE_USER_ID" INTEGER,
+ "PERSON_ID" INTEGER,
+ "USER_ID" INTEGER,
+ "DATA" VARCHAR(1000),
+ "CREATED_AT" TIMESTAMP,
+ "UPDATED_AT" TIMESTAMP,
+ "CLOSED_AT" TIMESTAMP,
+);
+
+CREATE TABLE "ISSUE_CHANGELOG" (
+ "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ "ISSUE_ID" INTEGER NOT NULL,
+ "USER_ID" INTEGER,
+ "CHANGE_TYPE" VARCHAR(50),
+ "CHANGE_DATA" VARCHAR(4000),
+ "MESSAGE" VARCHAR(16777215),
+ "CREATED_AT" TIMESTAMP,
+ "UPDATED_AT" TIMESTAMP,
+);
+
-- ----------------------------------------------
-- DDL Statements for indexes
-- ----------------------------------------------
CREATE INDEX "MEASURE_FILTER_FAVS_USERID" ON "MEASURE_FILTER_FAVOURITES" ("USER_ID");
-CREATE UNIQUE INDEX "GRAPHS_PERSPECTIVES" ON "GRAPHS" ("SNAPSHOT_ID", "PERSPECTIVE");
\ No newline at end of file
+CREATE UNIQUE INDEX "GRAPHS_PERSPECTIVES" ON "GRAPHS" ("SNAPSHOT_ID", "PERSPECTIVE");
+
+--CREATE INDEX "ISSUES_RESOURCE_ID" ON "ISSUES" ("RESOURCE_ID");
+
+--CREATE INDEX "ISSUES_RULE_ID" ON "ISSUES" ("RULE_ID");
--- /dev/null
+/*
+ * Sonar, open source software quality management 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
+ */
+
+package org.sonar.core.issue;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.sonar.api.issue.Issue;
+
+import java.util.List;
+
+import static com.google.common.collect.Lists.newArrayList;
+import static org.fest.assertions.Assertions.assertThat;
+
+public class DefaultIssuableTest {
+
+ private DefaultIssuable issuable;
+ private List<Issue> issueList;
+
+ @Before
+ public void before(){
+ issueList = newArrayList();
+ issuable = new DefaultIssuable(issueList);
+ }
+
+ @Test
+ public void should_apply_issue() throws Exception {
+ DefaultIssue issue = new DefaultIssue.Builder()
+ .ruleKey("ruleKey")
+ .ruleRepositoryKey("ruleRepositoryKey")
+ .severity(Issue.SEVERITY_BLOCKER)
+ .status(Issue.STATUS_REOPENED)
+ .resolution(Issue.RESOLUTION_FALSE_POSITIVE)
+ .line(10)
+ .componentKey("componentKey")
+ .cost(10.0)
+ .message("issue message")
+ .build();
+ issueList.add(issue);
+
+ DefaultIssueChangelog issueChangelog = new DefaultIssueChangelog.Builder()
+ .severity(Issue.SEVERITY_MAJOR)
+ .status(Issue.STATUS_CLOSED)
+ .resolution(Issue.RESOLUTION_FIXED)
+ .message("changelog message")
+ .line(1)
+ .build();
+
+ Issue resultIssue = issuable.apply(issue, issueChangelog);
+ assertThat(resultIssue).isNotNull();
+ assertThat(resultIssue.severity()).isEqualTo(Issue.SEVERITY_MAJOR);
+ assertThat(resultIssue.status()).isEqualTo(Issue.STATUS_CLOSED);
+ assertThat(resultIssue.resolution()).isEqualTo(Issue.RESOLUTION_FIXED);
+ assertThat(resultIssue.line()).isEqualTo(1);
+ }
+}
--- /dev/null
+/*
+ * Sonar, open source software quality management 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
+ */
+
+package org.sonar.api.issue;
+
+import org.sonar.api.component.Component;
+import org.sonar.api.component.Perspective;
+
+/**
+ * @since 3.6
+ */
+public interface Issuable extends Perspective {
+
+ Issue apply(Issue issue, IssueChangelog issueChangelog);
+
+ @Override
+ Component component();
+
+}
--- /dev/null
+/*
+ * Sonar, open source software quality management 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
+ */
+
+package org.sonar.api.issue;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @since 3.6
+ */
+public interface Issue {
+
+ String STATUS_REOPENED = "REOPENED";
+ String STATUS_RESOLVED = "RESOLVED";
+ String STATUS_CLOSED = "CLOSED";
+
+ String RESOLUTION_FALSE_POSITIVE = "FALSE-POSITIVE";
+ String RESOLUTION_FIXED = "FIXED";
+
+ String SEVERITY_INFO = "INFO";
+ String SEVERITY_MINOR = "MINOR";
+ String SEVERITY_MAJOR = "MAJOR";
+ String SEVERITY_CRITICAL = "CRITICAL";
+ String SEVERITY_BLOCKER = "BLOCKER";
+
+ String uuid();
+
+ String componentKey();
+
+ String ruleKey();
+
+ String ruleRepositoryKey();
+
+ String severity();
+
+ String message();
+
+ Integer line();
+
+ Double cost();
+
+ String status();
+
+ String resolution();
+
+ Date createdAt();
+
+ List<IssueChangelog> issueChangelogList();
+
+}
--- /dev/null
+/*
+ * Sonar, open source software quality management 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
+ */
+
+package org.sonar.api.issue;
+
+import java.util.Date;
+
+/**
+ * @since 3.6
+ */
+public interface IssueChangelog {
+
+ String severity();
+
+ String status();
+
+ String resolution();
+
+ String message();
+
+ Integer line();
+
+ Date createdAt();
+
+}
--- /dev/null
+#
+# 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 CreateIssues < ActiveRecord::Migration
+
+ def self.up
+ create_table :issues do |t|
+ t.column :uuid, :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 :title, :string , :null => true, :limit => 500
+ t.column :message, :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 :assignee_user_id, :integer, :null => true
+ t.column :person_id, :integer, :null => true
+ t.column :user_id, :integer, :null => true
+ t.column :data, :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
+
--- /dev/null
+#
+# 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 CreateIssueChangelog < ActiveRecord::Migration
+
+ def self.up
+ create_table :issue_changelog do |t|
+ t.column :issue_id, :integer, :null => false
+ t.column :user_id, :integer, :null => true
+ 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
+