if (projectId != null) {
template.copyTable(source, dest, "projects", projectQuery(projectId, false));
+ template.copyTable(source, dest, "events", "SELECT * FROM events WHERE resource_id=" + projectId);
+
template.copyTable(source, dest, "snapshots", "SELECT * FROM snapshots WHERE project_id=" + projectId);
template.copyTable(source, dest, "project_measures", "SELECT m.* FROM project_measures m INNER JOIN snapshots s on m.snapshot_id=s.id WHERE s.project_id=" + projectId);
assertThat(rowCount("metrics")).isEqualTo(2);
assertThat(rowCount("projects")).isZero();
assertThat(rowCount("alerts")).isEqualTo(1);
+ assertThat(rowCount("events")).isZero();
assertThat(dryRunCacheFolder).isDirectory();
}
assertThat(rowCount("projects")).isEqualTo(1);
assertThat(rowCount("snapshots")).isEqualTo(1);
assertThat(rowCount("project_measures")).isEqualTo(1);
+ assertThat(rowCount("events")).isEqualTo(2);
assertThat(dryRunCacheFolder).isDirectory();
}
<project_measures id="1" value="10" metric_id="1" snapshot_id="1000" />
+ <events id="1" name="1.0-SNAPSHOT" resource_id="123" />
+ <events id="2" name="2.0-SNAPSHOT" resource_id="123" />
+ <events id="3" name="1.0-SNAPSHOT" resource_id="456" />
+
</dataset>