During an importing entity definition file, I get the following message:
The table name for this entity is too long to form constraint names. Please use a shorter table name ff_payment_transaction
And I have a shorter table name as ff_payment_transaction. After starting the app, I get the following exception, however.
2017-07-11 14:38:07.067 ERROR 4527 --- [ader-Executor-1] liquibase :
classpath:config/liquibase/master.xml:
classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTr
ansaction.xml::20170711213548-2::jhipster: Change Set classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTr
ansaction.xml::20170711213548-2::jhipster failed. Error: Table
"FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement:
ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)]
2017-07-11 14:38:07.074 ERROR 4527 --- [ader-Executor-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Liquibase could not start correctly, your database is NOT ready: Migration failed for change set classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTransaction.xml::20170711213548-2::jhipster:
Reason: liquibase.exception.DatabaseException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement:
ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)]
liquibase.exception.MigrationFailedException: Migration failed for change set classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTransaction.xml::20170711213548-2::jhipster:
Reason: liquibase.exception.DatabaseException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement:
ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
at liquibase.Liquibase.update(Liquibase.java:214)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:431)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:388)
at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:82)
at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$0(AsyncSpringLiquibase.java:64)
at io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: liquibase.exception.DatabaseException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement:
ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
... 12 common frames omitted
Caused by: org.h2.jdbc.JdbcSQLException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement:
ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.schema.Schema.getTableOrView(Schema.java:456)
at org.h2.command.ddl.AlterTableAddConstraint.tryUpdate(AlterTableAddConstraint.java:201)
at org.h2.command.ddl.AlterTableAddConstraint.update(AlterTableAddConstraint.java:77)
at org.h2.command.CommandContainer.update(CommandContainer.java:101)
at org.h2.command.Command.executeUpdate(Command.java:260)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:193)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:165)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
The table name is not changed in table references.
Overview of the issue
During an importing entity definition file, I get the following message:
And I have a shorter table name as ff_payment_transaction. After starting the app, I get the following exception, however.
2017-07-11 14:38:07.067 ERROR 4527 --- [ader-Executor-1] liquibase : classpath:config/liquibase/master.xml: classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTr ansaction.xml::20170711213548-2::jhipster: Change Set classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTr ansaction.xml::20170711213548-2::jhipster failed. Error: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)] 2017-07-11 14:38:07.074 ERROR 4527 --- [ader-Executor-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Liquibase could not start correctly, your database is NOT ready: Migration failed for change set classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTransaction.xml::20170711213548-2::jhipster: Reason: liquibase.exception.DatabaseException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)]
liquibase.exception.MigrationFailedException: Migration failed for change set classpath:config/liquibase/changelog/20170711213548_added_entity_constraints_FulfillmentPaymentTransaction.xml::20170711213548-2::jhipster: Reason: liquibase.exception.DatabaseException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79) at liquibase.Liquibase.update(Liquibase.java:214) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:431) at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:388) at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:82) at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$0(AsyncSpringLiquibase.java:64) at io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:66) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Caused by: liquibase.exception.DatabaseException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] [Failed SQL: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id)] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582) ... 12 common frames omitted Caused by: org.h2.jdbc.JdbcSQLException: Table "FULFILLMENT_PAYMENT_TRANSACTION" not found; SQL statement: ALTER TABLE PUBLIC.ff_payment_transaction ADD CONSTRAINT fk_fulfillment_payment_transaction_parent_transaction_id FOREIGN KEY (parent_transaction_id) REFERENCES PUBLIC.fulfillment_payment_transaction (id) [42102-195] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:179) at org.h2.message.DbException.get(DbException.java:155) at org.h2.schema.Schema.getTableOrView(Schema.java:456) at org.h2.command.ddl.AlterTableAddConstraint.tryUpdate(AlterTableAddConstraint.java:201) at org.h2.command.ddl.AlterTableAddConstraint.update(AlterTableAddConstraint.java:77) at org.h2.command.CommandContainer.update(CommandContainer.java:101) at org.h2.command.Command.executeUpdate(Command.java:260) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:193) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:165) at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95) at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
The table name is not changed in table references.
JHipster Version(s)
4.6.1
JHipster configuration
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "1.8.0_131" OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11) OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
git version 2.7.4
node: v6.10.0
npm: 4.5.0
bower: 1.8.0
gulp: [16:06:58] CLI version 1.3.0 [16:06:58] Local version 3.9.1
yeoman: 2.0.0
yarn: 0.27.5
docker-compose version 1.8.0, build unknown
Entity configuration(s)
entityName.json
files generated in the.jhipster
directory{ "fluentMethods": true, "relationships": [ { "relationshipType": "one-to-one", "relationshipName": "parentTransaction", "otherEntityName": "fulfillmentPaymentTransaction", "otherEntityField": "id", "ownerSide": true, "otherEntityRelationshipName": "fulfillmentPaymentTransaction" }, { "relationshipType": "many-to-one", "relationshipName": "payment", "otherEntityName": "fulfillmentPayment", "otherEntityField": "id" } ], "fields": [ { "fieldName": "currency", "fieldType": "String", "fieldValidateRules": [ "required", "maxlength" ], "fieldValidateRulesMaxlength": 8 }, { "fieldName": "amount", "fieldType": "BigDecimal", "fieldValidateRules": [ "required", "min" ], "fieldValidateRulesMin": 0 }, { "fieldName": "transcationDate", "fieldType": "ZonedDateTime", "fieldValidateRules": [ "required" ] }, { "fieldName": "rawResponse", "fieldType": "String", "fieldValidateRules": [ "maxlength" ], "fieldValidateRulesMaxlength": 255 }, { "fieldName": "isSuccess", "fieldType": "Boolean", "fieldValidateRules": [ "required" ] } ], "changelogDate": "20170711213548", "entityTableName": "fulfillment_payment_transaction", "dto": "no", "pagination": "pagination", "service": "no" }
Browsers and Operating System
Linux Mint 18.2