jpa2ddl icon indicating copy to clipboard operation
jpa2ddl copied to clipboard

Migrations with date-based versioning are incorrectly sorted

Open bbucko opened this issue 6 years ago • 3 comments

Versioned migrations with date-based scheme (e.g. v20180101__initial.sql) are not executed in proper order during migrate goal.

bbucko avatar May 16 '18 19:05 bbucko

Thanks for the report. We definitely need to support date formats.

The problem is with the migration comment. Currently, we execute only files labeled as jpa2ddl (we're sure there are only schema changes here) and assume all others can contain data migrations. As invoking data migrations makes no sense (there is no data in the database set up by the plugin) we must have a pattern to distinguish it. Of course we can make it configurable, however, a good default is always welcome. Any suggestions here?

jkubrynski avatar May 16 '18 19:05 jkubrynski

So why not just execute data migrations?

bbucko avatar May 27 '18 08:05 bbucko

Unfortunately, data migration can be related to the existing data, that is not present in the database temporarily created by the plugin. That's why we need to separate it from the schema migrations

jkubrynski avatar May 31 '18 22:05 jkubrynski