Skip to content

Commit

Permalink
Updateing existing database with multiple matches
Browse files Browse the repository at this point in the history
  • Loading branch information
rladdusaw committed Jan 7, 2020
1 parent 98f64e0 commit acb379f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/main/java/edu/tamu/app/ProjectInitialization.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,22 @@ public void run(String... args) throws Exception {
remoteProjectManagerRepo.findAll().forEach(versionManagementSoftware -> {
managementBeanRegistry.register(versionManagementSoftware);
});
if (cardTypeRepo.findByIdentifier("Feature") == null) {
cardTypeRepo.create(new CardType("Feature", new HashSet<String>(Arrays.asList(new String[] { "Story" }))));
CardType type = cardTypeRepo.findByIdentifier("Feature");
HashSet<String> featureTypes = new HashSet<String>(Arrays.asList(new String[] { "Story", "feature" }));
if (type == null) {
cardTypeRepo.create(new CardType("Feature", featureTypes));
} else if (!type.getMapping().equals(featureTypes)) {
type.setMapping(featureTypes);
cardTypeRepo.update(type);
}
if (cardTypeRepo.findByIdentifier("Request") == null) {
cardTypeRepo.create(new CardType("Request", new HashSet<String>(Arrays.asList(new String[] { "request" }))));
}
if (cardTypeRepo.findByIdentifier("Issue") == null) {
cardTypeRepo.create(new CardType("Issue", new HashSet<String>(Arrays.asList(new String[] { "issue" }))));
}
if (cardTypeRepo.findByIdentifier("Defect") == null) {
cardTypeRepo.create(new CardType("Defect", new HashSet<String>(Arrays.asList(new String[] { "bug" }))));
}
}

Expand Down

0 comments on commit acb379f

Please sign in to comment.