jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.51k stars 4.02k forks source link

jHipster 6.1.2: fake data doesn't honor unique constraint, breaks Liquibase #9990

Closed ksilz closed 5 years ago

ksilz commented 5 years ago
Overview of the issue

For my Angular / H2 monolith, jHipster generates fake data which doesn't honor the unique constraint on my Shipment entity. Liquibase fails to load the fake data for this entity.

Here is the stacktrace:

2019-06-25 22:35:04.315 DEBUG 82110 --- [  restartedMain] c.b.t.j.config.LiquibaseConfiguration    : Configuring Liquibase
2019-06-25 22:35:04.637  WARN 82110 --- [ple-shop-task-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Starting Liquibase asynchronously, your database might not be ready at startup!
2019-06-25 22:35:07.456 ERROR 82110 --- [ple-shop-task-1] liquibase.changelog.ChangeSet            : Change Set config/liquibase/changelog/20190625202518_added_entity_Shipment.xml::20190625202518-1-data::jhipster failed.  Error: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_SHIPMENT_ORDER_ID_INDEX_F ON PUBLIC.SHIPMENT(ORDER_ID) VALUES 3"; SQL statement:
INSERT INTO PUBLIC.shipment(id, shipped_at, order_id, shipped_by_id) VALUES(?, ?, ?, ?) [23505-199]
2019-06-25 22:35:07.461 ERROR 82110 --- [ple-shop-task-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Liquibase could not start correctly, your database is NOT ready: Migration failed for change set config/liquibase/changelog/20190625202518_added_entity_Shipment.xml::20190625202518-1-data::jhipster:
     Reason: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_SHIPMENT_ORDER_ID_INDEX_F ON PUBLIC.SHIPMENT(ORDER_ID) VALUES 3"; SQL statement:
INSERT INTO PUBLIC.shipment(id, shipped_at, order_id, shipped_by_id) VALUES(?, ?, ?, ?) [23505-199]

liquibase.exception.MigrationFailedException: Migration failed for change set config/liquibase/changelog/20190625202518_added_entity_Shipment.xml::20190625202518-1-data::jhipster:
     Reason: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_SHIPMENT_ORDER_ID_INDEX_F ON PUBLIC.SHIPMENT(ORDER_ID) VALUES 3"; SQL statement:
INSERT INTO PUBLIC.shipment(id, shipped_at, order_id, shipped_by_id) VALUES(?, ?, ?, ?) [23505-199]
        at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
        at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53)
        at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83)
        at liquibase.Liquibase.update(Liquibase.java:202)
        at liquibase.Liquibase.update(Liquibase.java:179)
        at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:353)
        at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:305)
        at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:119)
        at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$0(AsyncSpringLiquibase.java:94)
        at io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:78)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_SHIPMENT_ORDER_ID_INDEX_F ON PUBLIC.SHIPMENT(ORDER_ID) VALUES 3"; SQL statement:
INSERT INTO PUBLIC.shipment(id, shipped_at, order_id, shipped_by_id) VALUES(?, ?, ?, ?) [23505-199]
        at liquibase.statement.ExecutablePreparedStatementBase.execute(ExecutablePreparedStatementBase.java:86)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:115)
        at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229)
        at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211)
        at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600)
        ... 12 common frames omitted
Caused by: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_SHIPMENT_ORDER_ID_INDEX_F ON PUBLIC.SHIPMENT(ORDER_ID) VALUES 3"; SQL statement:
INSERT INTO PUBLIC.shipment(id, shipped_at, order_id, shipped_by_id) VALUES(?, ?, ?, ?) [23505-199]
        at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1298)
        at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
        at liquibase.statement.BatchDmlExecutablePreparedStatement.executePreparedStatement(BatchDmlExecutablePreparedStatement.java:65)
        at liquibase.statement.ExecutablePreparedStatementBase.execute(ExecutablePreparedStatementBase.java:84)
        ... 16 common frames omitted

2019-06-25 22:35:07.790 DEBUG 82110 --- [  restartedMain] c.b.t.j.config.WebConfigurer             : Registering CORS filter
Motivation for or Use Case

I have a valid JDL file that jHipster imports without reporting an error. However, the generated fake data is wrong and prevents the application from running correctly.

Reproduce the error
Related issues

9721: This bug is about wrong columns in the fake data. However, I actually mentioned the unique violation described here in a comment.

Suggest a Fix
JHipster Version(s)

JHipster 6.1.2, Java 11

JHipster configuration
my-simple-shop@0.0.0 /Users/karsten/workspaces/me/services/better-projects-faster/bug-reports/jhipster-6.1.2-java-11-test
└── generator-jhipster@6.1.2 
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "jhiPrefix": "bpf",
    "languages": ["en", "de"],
    "messageBroker": false,
    "nativeLanguage": "en",
    "packageName": "com.betterprojectsfaster.tutorial.jhipsterdocker",
    "packageFolder": "com/betterprojectsfaster/tutorial/jhipsterdocker",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "serviceDiscoveryType": false,
    "skipClient": false,
    "skipServer": false,
    "testFrameworks": ["protractor"],
    "websocket": "spring-websocket",
    "baseName": "my_simple_shop",
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "buildTool": "gradle",
    "cacheProvider": "ehcache",
    "clientFramework": "angularX",
    "useSass": true,
    "clientPackageManager": "npm",
    "jhipsterVersion": "6.1.2",
    "skipUserManagement": false,
    "serverPort": "8080",
    "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
    "clientTheme": "none",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": []
  },
  "entities": ["Product", "Address", "ShoppingOrder", "ProductOrder", "Shipment"]
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Product {
  name String required unique minlength(2) maxlength(90),
  price Float required min(0),
  description TextBlob required,
  picture ImageBlob required,
  specification AnyBlob,
  category ProductCategory,
  inventory Integer required min(0)
}
entity Address {
  addressLine1 String required minlength(2) maxlength(80),
  addressLine2 String minlength(2) maxlength(80),
  city String minlength(2) maxlength(80),
  postalCode String minlength(5) maxlength(5)
}
entity ShoppingOrder {
  name String required unique minlength(2) maxlength(90),
  totalAmount Float min(0),
  ordered ZonedDateTime
}
entity ProductOrder {
  amount Integer required min(0) max(5)
}
entity Shipment {
  shippedAt ZonedDateTime required
}
enum ProductCategory {
  Laptop,
  Desktop,
  Phone,
  Tablet,
  Accessory
}

relationship OneToOne {
  Shipment{order(name) required} to ShoppingOrder{shipment required}
}
relationship OneToMany {
  Product{order required} to ProductOrder{product(name) required},
  ShoppingOrder{orders required} to ProductOrder{overallOrder(name)}
}
relationship ManyToOne {
  Address{user(login) required} to User,
  ShoppingOrder{buyer(login) required} to User,
  ProductOrder{buyer(login) required} to User,
  Shipment{shippedBy(login) required} to User
}

dto Product, Address, ShoppingOrder, ProductOrder, Shipment with mapstruct
service Product, Address, ShoppingOrder, ProductOrder, Shipment with serviceClass

Environment and Tools

openjdk version "11.0.3" 2019-04-16 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)

git version 2.22.0

node: v10.15.3

npm: 6.9.0

yeoman: 2.0.6

Docker version 18.09.2, build 6247962

docker-compose version 1.23.2, build 1110ad01

Entity configuration(s) entityName.json files generated in the .jhipster directory

Shipment.json

{
    "name": "Shipment",
    "fields": [
        {
            "fieldName": "shippedAt",
            "fieldType": "ZonedDateTime",
            "fieldValidateRules": [
                "required"
            ]
        }
    ],
    "relationships": [
        {
            "relationshipType": "one-to-one",
            "otherEntityName": "shoppingOrder",
            "otherEntityRelationshipName": "shipment",
            "relationshipValidateRules": "required",
            "relationshipName": "order",
            "otherEntityField": "name",
            "ownerSide": true
        },
        {
            "relationshipType": "many-to-one",
            "otherEntityName": "user",
            "otherEntityRelationshipName": "shipment",
            "relationshipValidateRules": "required",
            "relationshipName": "shippedBy",
            "otherEntityField": "login"
        }
    ],
    "changelogDate": "20190625202518",
    "entityTableName": "shipment",
    "dto": "mapstruct",
    "pagination": "no",
    "service": "serviceClass",
    "jpaMetamodelFiltering": false,
    "fluentMethods": true,
    "clientRootFolder": "",
    "applications": [
        "my_simple_shop"
    ]
}
Browsers and Operating System

macOS Mojave 10.14.4, Safari

devsparkles commented 4 years ago

Just to say that the problem is still there

2020-07-10 21:34:09.500 DEBUG 79728 --- [ restartedMain] c.devsparkle.config.CacheConfiguration : Starting HazelcastCacheManager 2020-07-10 21:34:10.314 ERROR 79728 --- [ store-task-1] liquibase.changelog.ChangeSet : Change Set config/liquibase/changelog/20200710202847_added_entity_Customer.xml::20200710202847-1-data::jhipster failed. Error: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_CUSTOMER_USER_ID_INDEX_5 ON PUBLIC.CUSTOMER(USER_ID) VALUES 2"; SQL statement: INSERT INTO PUBLIC.customer(id, first_name, last_name, gender, email, phone, address_line_1, address_line_2, city, country, user_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200] 2020-07-10 21:34:10.319 ERROR 79728 --- [ store-task-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Liquibase could not start correctly, your database is NOT ready: Migration failed for change set config/liquibase/changelog/20200710202847_added_entity_Customer.xml::20200710202847-1-data::jhipster: Reason: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_CUSTOMER_USER_ID_INDEX_5 ON PUBLIC.CUSTOMER(USER_ID) VALUES 2"; SQL statement: INSERT INTO PUBLIC.customer(id, first_name, last_name, gender, email, phone, address_line_1, address_line_2, city, country, user_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200]

liquibase.exception.MigrationFailedException: Migration failed for change set config/liquibase/changelog/20200710202847_added_entity_Customer.xml::20200710202847-1-data::jhipster: Reason: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_CUSTOMER_USER_ID_INDEX_5 ON PUBLIC.CUSTOMER(USER_ID) VALUES 2"; SQL statement: INSERT INTO PUBLIC.customer(id, first_name, last_name, gender, email, phone, address_line_1, address_line_2, city, country, user_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:646) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83) at liquibase.Liquibase.update(Liquibase.java:202) at liquibase.Liquibase.update(Liquibase.java:179) at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:366) at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:314) at org.springframework.boot.autoconfigure.liquibase.DataSourceClosingSpringLiquibase.afterPropertiesSet(DataSourceClosingSpringLiquibase.java:46) at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:118) at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$0(AsyncSpringLiquibase.java:93) at io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_CUSTOMER_USER_ID_INDEX_5 ON PUBLIC.CUSTOMER(USER_ID) VALUES 2"; SQL statement: INSERT INTO PUBLIC.customer(id, first_name, last_name, gender, email, phone, address_line_1, address_line_2, city, country, user_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200] at liquibase.statement.ExecutablePreparedStatementBase.execute(ExecutablePreparedStatementBase.java:87) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:117) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1276) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1258) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:609) ... 13 common frames omitted Caused by: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.UX_CUSTOMER_USER_ID_INDEX_5 ON PUBLIC.CUSTOMER(USER_ID) VALUES 2"; SQL statement: INSERT INTO PUBLIC.customer(id, first_name, last_name, gender, email, phone, address_line_1, address_line_2, city, country, user_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-200] at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1235) at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java) at liquibase.statement.BatchDmlExecutablePreparedStatement.executePreparedStatement(BatchDmlExecutablePreparedStatement.java:65) at liquibase.statement.ExecutablePreparedStatementBase.execute(ExecutablePreparedStatementBase.java:85) ... 17 common frames omitted

2020-07-10 21:34:10.702 DEBUG 79728 --- [ restartedMain] c.d.config.DatabaseConfiguration : H2 database is available on port 18080


Here is my JDL export to generate the project

application {
  config {
    applicationType monolith
    authenticationType jwt
    baseName store
    blueprints []
    buildTool gradle
    cacheProvider hazelcast
    clientFramework angularX
    clientPackageManager npm
    clientTheme none
    creationTimestamp 1593596133788
    databaseType sql
    devDatabaseType h2Disk
    dtoSuffix DTO
    embeddableLaunchScript false
    enableHibernateCache true
    enableSwaggerCodegen false
    enableTranslation true
    jhiPrefix jhi
    jhipsterVersion "6.10.0"
    jwtSecretKey "Zjg1ODZhNmE2ZTk0YTdkZjc1Y2IyOTJmYjU3ZmNlMTM2YmM4OTVhNTc1M2Q3YjdjY2Y0YmQ2MDc1NDMyNDQ0NDBkZjgwNmE0NTBjNmI5NjZkOTA2MWJkMzljYWVkOTc3ZjJhOWFmNzZkOGVjYzczYTJmNTc0MmRjY2JiNTJkYjY="
    languages [en]
    messageBroker false
    nativeLanguage en
    otherModules []
    packageName com.devsparkle
    prodDatabaseType mysql
    searchEngine false
    serverPort 8080
    serviceDiscoveryType false
    skipClient false
    skipServer false
    skipUserManagement false
    testFrameworks [protractor]
    useSass true
    websocket spring-websocket
  }

  entities Customer, Invoice, OrderItem, Product, ProductCategory, ProductOrder, Shipment
}

entity Customer {
  firstName String required,
  lastName String required,
  gender Gender required,
  email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/),
  phone String required,
  addressLine1 String required,
  addressLine2 String,
  city String required,
  country String required
}
entity Invoice {
  date Instant required,
  details String,
  status InvoiceStatus required,
  paymentMethod PaymentMethod required,
  paymentDate Instant required,
  paymentAmount BigDecimal required,
  code String required
}
entity OrderItem {
  quantity Integer required min(0),
  totalPrice BigDecimal required min(0),
  status OrderItemStatus required
}
entity Product {
  name String required,
  description String,
  price BigDecimal required min(0),
  size Size required,
  image ImageBlob
}
entity ProductCategory {
  name String required,
  description String
}
entity ProductOrder {
  placedDate Instant required,
  status OrderStatus required,
  code String required
}
entity Shipment {
  trackingCode String,
  date Instant required,
  details String
}
enum Gender {
  MALE,
  FEMALE,
  OTHER
}
enum InvoiceStatus {
  PAID,
  ISSUED,
  CANCELLED
}
enum PaymentMethod {
  CREDIT_CARD,
  CASH_ON_DELIVERY,
  PAYPAL
}
enum OrderItemStatus {
  AVAILABLE,
  OUT_OF_STOCK,
  BACK_ORDER
}
enum Size {
  S,
  M,
  L,
  XL,
  XXL
}
enum OrderStatus {
  COMPLETED,
  PENDING,
  CANCELLED
}

relationship OneToOne {
  Customer{user(login) required} to User
}
relationship OneToMany {
  ProductOrder{invoice} to Invoice{order(code) required},
  ProductOrder{orderItem} to OrderItem{order(code) required},
  ProductCategory{product} to Product{productCategory(name)},
  Customer{order} to ProductOrder{customer(email) required},
  Invoice{shipment} to Shipment{invoice(code) required}
}
relationship ManyToOne {
  OrderItem{product(name) required} to Product
}

paginate Customer, Invoice, OrderItem, Product, ProductOrder, Shipment with pagination
service Customer, Invoice, OrderItem, Product, ProductCategory, ProductOrder, Shipment with serviceClass

jhipster --version 6.10.0 java --version openjdk 11.0.7 2020-04-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)

devsparkles commented 4 years ago

20200710202847_added_entity_Customer.xml

<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

        <property name="autoIncrement" value="true"/>

    <!--
        Added the entity Customer.
    -->
    <changeSet id="20200710202847-1" author="jhipster">
        <createTable tableName="customer">
            <column name="id" type="bigint" autoIncrement="${autoIncrement}">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="first_name" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="last_name" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="gender" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="email" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="phone" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="address_line_1" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="address_line_2" type="varchar(255)">
                <constraints nullable="true" />
            </column>
            <column name="city" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="country" type="varchar(255)">
                <constraints nullable="false" />
            </column>
            <column name="user_id" type="bigint">
                <constraints unique="true" nullable="false" uniqueConstraintName="ux_customer_user_id" />
            </column>
            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
        </createTable>
    </changeSet>

    <changeSet id="20200710202847-1-relations" author="jhipster">

    </changeSet>
    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->

    <!--
        Load sample data generated with Faker.js
        - This data can be easily edited using a CSV editor (or even MS Excel) and
          is located in the 'src/main/resources/config/liquibase/fake-data' directory
        - By default this data is applied when running with the JHipster 'dev' profile.
          This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
          Spring Boot configuration key.
    -->
    <changeSet id="20200710202847-1-data" author="jhipster" context="faker">
        <loadData
                  file="config/liquibase/fake-data/customer.csv"
                  separator=";"
                  tableName="customer">
            <column name="id" type="numeric"/>
            <column name="first_name" type="string"/>
            <column name="last_name" type="string"/>
            <column name="gender" type="string"/>
            <column name="email" type="string"/>
            <column name="phone" type="string"/>
            <column name="address_line_1" type="string"/>
            <column name="address_line_2" type="string"/>
            <column name="city" type="string"/>
            <column name="country" type="string"/>
            <column name="user_id" type="numeric"/>
            <!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
        </loadData>
    </changeSet>

</databaseChangeLog>

customer.csv

id;first_name;last_name;gender;email;phone;address_line_1;address_line_2;city;country;user_id
1;Chelsey;Wyman;OTHER;"z*@7.=>hG<Z";014-991-5975 x53760;Tennessee relationships Ball;full-range;Parkerfort;Uzbekistan;1
2;Thalia;Buckridge;MALE;"b@*'X(].k^|";(832) 385-8607;violet Compatible primary;Credit Card Account;New Dalestad;Ukraine;2
3;Maxine;Gibson;OTHER;"w0]@MYsVUi.+b[";(301) 227-7081 x51545;Georgia;Robust ivory Ports;Port Darienbury;South Georgia and the South Sandwich Islands;2
4;Levi;Lemke;FEMALE;"5'-II@>'5Gy`.L";1-488-295-4126 x80618;high-level fuchsia;International;East Alec;Colombia;1
5;Olen;Brekke;MALE;"kbs@[v6S.oz";466.499.8661 x875;Dynamic Meadows;Brand system-worthy Soft;Leuschkeville;India;2
6;Laurence;Bartoletti;OTHER;"efoj2@{|*:.g%t";801.137.7575 x4467;fuchsia;Fantastic invoice;Morarview;Estonia;1
7;Martine;Abshire;FEMALE;"M/'@$ZzkOi.5L}<";572-425-8749 x654;array Awesome;foreground Refined grey;Lake Zita;Paraguay;2
8;Johan;Wolff;OTHER;"lwrwoz@(FSQ9.X,}9V";1-479-070-4986 x050;Sao Tome and Principe;Solutions;Port Raoul;Isle of Man;2
9;Alexa;Kiehn;FEMALE;"#J@08uP5\.`IMKnV";1-757-965-1677 x985;Frozen embrace sexy;silver;Morarstad;Armenia;2
10;Breana;Gleichner;OTHER;"e@bLE+sB.]HQq";1-094-233-8136 x35665;Unions Shoes;Cape Verde Escudo;Kamrynberg;Uruguay;2
pmverma commented 4 years ago

@devsparkles Yes the issue is there but this is something developers need to fix the CSV data manually. Please check https://github.com/jhipster/generator-jhipster/issues/9579 and https://github.com/jhipster/generator-jhipster/issues/9579#issuecomment-519842714