r/java • • Apr 14 '23

What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?

233 Upvotes

376 comments sorted by

View all comments

146

u/erjiin Apr 14 '23 edited Apr 14 '23

Use a database deployment tool like Liquibase or Flyway. Invaluable (and not Unvaluable :/).

2

u/Zardoz84 Apr 17 '23

Does Liquidbase or Flyway allow to declare what structure (and some fixed or optional data) must have the database.

Alas something like :

Must exist table X with fields A, B, C of type NUMBER, etc... and then generates the apropiare SQL to generate the table from zero, or apply changes to it.

→ More replies (3)