Skip to content
Advertisement

How to add a comment to flyway migration

I am trying to make my big migration more self explaining and that’s why I need to add some comments to it. However, I tried a few approaches and haven’t succeeded with them. I tried:

  • //
  • #
  • <!-- TEXT -->

Error:

Is there a way I can add a comment to flyway SQL migration?

Advertisement

Answer

The following should work on all supported databases:

And additionally on MySQL and MariaDB:

When we were upgrading to spring-boot 2.5 we found that there is need to have a space after first two hyphens — with SQL style comments

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement