Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updateing existing database with multiple matches #54

Merged
merged 1 commit into from
Jan 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature, Request, Issue and Defect should be constants.

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