0

I remove a property from an entity in Jhipster and the system still looks for it when persisting to the database.

Example I generated an entity previously with examples below then I went back to remove the paymentDate property from the entity.

Old
entity payment{
   name String,
   amount BigDecimal,
   paymentDate Instant
}

New
entity payment{
   name String,
   amount BigDecimal
}

Now when I try to save data to the payment table, it is asking me for paymentDate property and I still see it in my database. Even if I delete the table and restart the application, I still see the paymentDate property. What I can do to fix this.

0

1 Answer 1

1

You must write a Liquibase migration to remove the column using dropColumn element.

https://www.jhipster.tech/development/#database-updates-by-manually-editing-the-change-log

https://docs.liquibase.com/change-types/drop-column.html

2
  • Thanks, I deleted the change log files and the entities, then regenerate the jdl. That's fix my issue. Oct 10 at 10:25
  • This works while you are still in dev, as soon as you are in production and have real data to keep, changelogs should be considered as immutable.. Oct 10 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.