Skip to content

Commit

Permalink
Merge pull request #31 from InseeFr/fix_database_orders
Browse files Browse the repository at this point in the history
fix: nb orders in database
  • Loading branch information
EricThuaud authored Oct 16, 2023
2 parents b386855 + f4b95ec commit b57a512
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>fr.insee.survey</groupId>
<artifactId>platine-management</artifactId>
<version>1.0.24</version>
<version>1.0.25</version>
<name>platine-management</name>
<description>REST API for communication between DB and Platine-Management UI and Platine-My-Surveys UI</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ public class Survey {
@NonNull
private Integer year;
private Integer sampleSize;
@Column(length = 2000)
private String longWording;
@Column(length = 2000)
private String shortWording;
@Column(length = 2000)
private String shortObjectives;
@Column(length = 2000)
private String longObjectives;
private String visaNumber;
private String cnisUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,21 @@ private void initOrder() {
Long nbExistingOrders = orderRepository.count();
LOGGER.info("{} orders in database", nbExistingOrders);

if (nbExistingOrders == 0) {
if (nbExistingOrders !=9 ) {
// Creating table order
LOGGER.info("loading eventorder data");
orderRepository
.saveAndFlush(new EventOrder(Long.parseLong("8"), TypeQuestioningEvent.REFUSAL.toString(), 8));
.saveAndFlush(new EventOrder(Long.parseLong("8"), TypeQuestioningEvent.REFUSAL.toString(), 9));
orderRepository
.saveAndFlush(new EventOrder(Long.parseLong("7"), TypeQuestioningEvent.VALINT.toString(), 7));
.saveAndFlush(new EventOrder(Long.parseLong("7"), TypeQuestioningEvent.VALINT.toString(), 8));
orderRepository
.saveAndFlush(new EventOrder(Long.parseLong("6"), TypeQuestioningEvent.VALPAP.toString(), 6));
orderRepository.saveAndFlush(new EventOrder(Long.parseLong("5"), TypeQuestioningEvent.HC.toString(), 5));
.saveAndFlush(new EventOrder(Long.parseLong("6"), TypeQuestioningEvent.VALPAP.toString(), 7));
orderRepository.saveAndFlush(new EventOrder(Long.parseLong("5"), TypeQuestioningEvent.HC.toString(), 6));
orderRepository
.saveAndFlush(new EventOrder(Long.parseLong("4"), TypeQuestioningEvent.PARTIELINT.toString(), 4));
orderRepository.saveAndFlush(new EventOrder(Long.parseLong("3"), TypeQuestioningEvent.WASTE.toString(), 3));
.saveAndFlush(new EventOrder(Long.parseLong("4"), TypeQuestioningEvent.PARTIELINT.toString(), 5));
orderRepository.saveAndFlush(new EventOrder(Long.parseLong("3"), TypeQuestioningEvent.WASTE.toString(), 4));
orderRepository.saveAndFlush(new EventOrder(Long.parseLong("3"), TypeQuestioningEvent.FOLLOWUP.toString(), 3));

orderRepository.saveAndFlush(new EventOrder(Long.parseLong("2"), TypeQuestioningEvent.PND.toString(), 2));
orderRepository
.saveAndFlush(new EventOrder(Long.parseLong("1"), TypeQuestioningEvent.INITLA.toString(), 1));
Expand Down

0 comments on commit b57a512

Please sign in to comment.