ebean icon indicating copy to clipboard operation
ebean copied to clipboard

[WIP] NEW: DefaultDbMigration is configurable from properties

Open rPraml opened this issue 2 years ago • 2 comments

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 avatar Aug 09 '23 15:08 rPraml

Why?

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

rob-bygrave avatar Aug 15 '23 21:08 rob-bygrave

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 avatar Aug 23 '23 09:08 rPraml