0

I recentely started using JHipster. I am facing problem while creating new tables (other than the jhipster provided). JHipster provided their tables through 00000000000000_initial_schema.xml even though same table has entity java classes.

But now i have created new @Entity class but tables are not getting created. What changes need to do ?

One more thing to ask, how we can disable initial schema totally and generate tables from Entity classes, even for existing jhi_* tables

Thanks in advance :)

code veda
  • 87
  • 1
  • 6
  • 1
    Have you restarted your app to execute liquibase migrations for your new entities? You can't generate entities for the standard entities like User, Authorithies, etc... Have you read the doc about "Database updates" in https://www.jhipster.tech/development/#using-a-database – Gaël Marziou Jan 19 '20 at 20:14
  • Yes i restarted the app several times. Tell me one thing can we generate Database tables/entities without using initial_schema xml file ? both, jhipster provided User, Authority, etc and custom ones which i want. When i added table info in initial_schema then new table get created. Here jhipster uses liquibase which is used to compare the schema and database whenever the application starts to maintain consistecy. But can't we someone depend on spring boot feature that when that DB syncs with @Entity class ? ? – code veda Jan 20 '20 at 21:16
  • Liquibase changelogs are supposed to be immutable, so you should not change initial_schema. Same things about entity changelogs, when you update your entity either you should replace previous one if you can throw away your data, or you should create an incremental changelog as explained in doc. Liquibase does not compare the schema and dattabase, it reads changelogs recorded in database in DATABASECHANGELOG table and comapre their checksums with the ones of the changelogs files. I don't understand your last question – Gaël Marziou Jan 20 '20 at 21:23

0 Answers0