Skip to content

Conversation

@rPraml
Copy link
Contributor

@rPraml rPraml commented Aug 9, 2023

This PR allows to configure the DbMigration completely from properties-files and it is a plugin now.
This means, ebean can automatically generate migration files. There is no programmatic code needed any more

TODO: Write some good documentation

rPraml added a commit to FOCONIS/ebean that referenced this pull request Aug 10, 2023
@rob-bygrave
Copy link
Contributor

rob-bygrave commented Aug 15, 2023

Why?

Edit: As in what is the motivation? Why would someone want to run this as a plugin?

@rPraml
Copy link
Contributor Author

rPraml commented Aug 23, 2023

I think the motivation to configure evertything from properties is clear

Q: Why a plugin:
A: You need no code. You just need to add the dbmigration to the classpath, set up the correct properties and ebean will generate the migrations automatically at startup. (Similar to ddl-generation)

What I want
Generationg dbmigration should work the same way as ddl-generation for tests.
so, if it is on classpath (and enabled in ebean.properties) it should automatically generate migration scripts.

Current situation here
We are doing this on our build server and this is controlled by special maven profiles. So a certain CI task runs this profile, generates the DDL and also auto commits it on the current branch. (And as additional feature, it runs DDL tests against various platforms to detect syntactical errors)

BTW: Ebean does a very good job in detecting model changes and generating the migration automatically. With the help of the @DbMigration annotation, we can cover nearly all of the use cases. It is extemely rare, that we have to hand craft migration scripts.

@rPraml rPraml force-pushed the dbmigration-is-plugin-now branch from 87948dc to f7bdfa1 Compare October 7, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants