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

Consider adding support for Flyway-style callbacks #22

Open
srcshelton opened this issue Nov 3, 2016 · 2 comments
Open

Consider adding support for Flyway-style callbacks #22

srcshelton opened this issue Nov 3, 2016 · 2 comments

Comments

@srcshelton
Copy link
Owner

Flyway supports the following callbacks, from ./sql/<callback>.${sqlMigrationSuffix:-sql} files:

  • beforeMigrate
  • beforeEachMigrate
  • afterEachMigrate
  • afterMigrate
  • beforeClean
  • afterClean
  • beforeInfo
  • afterInfo
  • beforeValidate
  • afterValidate
  • beforeBaseline
  • afterBaseline
  • beforeRepair
  • afterRepair

Further research is needed to determine what (if any) parameters are passed to the callback files (likely via Placeholder substitution).

@srcshelton
Copy link
Owner Author

Flyway supports the concept of default callbacks and custom callbacks. If callbacks are enabled that the former can be disabled causing only the latter to be executed.

@srcshelton
Copy link
Owner Author

It appears that - via the Java API at least - callbacks receive no additional data except for beforeEachMigrate and afterEachMigrate, which also receive a MigrationInfo object which represents a single entry in the schema_version table.

The use-case for callbacks appears to be basic "fix-up privileges" situations rather than anything more complex.

At the moment, only single-file callbacks are supported by Flyway, although specifying a directory of callbacks may be considered for future releases...

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

No branches or pull requests

1 participant