Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate flyway migrations from hibernate update scripts #43817

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rmanibus
Copy link
Contributor

@rmanibus rmanibus commented Oct 10, 2024

fix #43723

Current Process: When creating a database migration, the workflow is quite cumbersome:

  • Modify the entity.
  • Check the update script in the dev UI (when accessible—sometimes the app doesn't even start, making it unavailable).
  • Manually create a new migration file.
  • Customize the update script as needed.

This process involves redundancy, as the entity already contains the necessary information to at least generate a draft migration.

New Workflow: With this pull request, the process is simplified to:

  • Modify the entity.
  • Customize the update script as needed.

Migration naming convention:

  • major version is extracted from the previous migration
  • minor version is the current timestamp (current format is yyyyMMddHHmmss, but I think flyway might support something more readable like yyyy_MM_dd_HH_mm_ss)

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 10, 2024

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 10, 2024

/cc @gsmet (hibernate-orm), @yrodiere (hibernate-orm)

Assertions.assertNotNull(devuiresponse);
String type = devuiresponse.get("type").asText();
Assertions.assertNotNull(type);
Assertions.assertEquals("success", type);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can I actually check the content if the generated file here ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phillip-kruger I think we need your help here :)

@gsmet
Copy link
Member

gsmet commented Oct 14, 2024

Thanks for the contribution. Could you clarify how it works and the cases that are covered?

@rmanibus
Copy link
Contributor Author

Thanks for the contribution. Could you clarify how it works and the cases that are covered?

@gsmet just updated the PR description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate Database Migration from hibernate model
2 participants