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

MD5SUM the same for all Grails Changes #172

Open
virtualdogbert opened this issue May 7, 2020 · 3 comments
Open

MD5SUM the same for all Grails Changes #172

virtualdogbert opened this issue May 7, 2020 · 3 comments

Comments

@virtualdogbert
Copy link

virtualdogbert commented May 7, 2020

Task List

  • [ x ] Steps to reproduce provided
  • [ x ] Stacktrace (if present) provided
  • [ x ] Full description of the issue provided (see below)
  • [ x ] Link to the code that is causing this

Steps to Reproduce

  1. Run a migration script with multiple grails changes
  2. Look at the DB change log:
    SELECT * FROM tdstm.DATABASECHANGELOG where DESCRIPTION='Grails Change' order by ORDEREXECUTED desc
  3. Note the MD5SUM values are all the same

Expected Behaviour

All the MD5SUM values should be different even for grails changes and should be based off the content of the change script.

Actual Behaviour

All the MD5SUM values are the same for grails changes.

Environment Information

  • Operating System: MAC
  • Grails Version: 2.5.5, 3.3.10, 4.0.1
  • Plugin Version: any including the latest
  • Database: MYSQL
  • JDK Version: 1.8

The line of code responsible for this is:
https://github.com/grails-plugins/grails-database-migration/blob/master/src/main/groovy/org/grails/plugins/databasemigration/liquibase/GroovyChange.groovy#L179

@bobbywarner
Copy link
Contributor

@virtualdogbert I am not able to replicate this. All the md5sum values are different as expected for me.

@virtualdogbert
Copy link
Author

Are those md5sums for SQL change or Grails changes, because the md5 for all the grails changes I have are all the same... Actually, if I go back in time some of the MD5SUMs for grails changes are null.
Screen Shot 2020-07-14 at 2 12 07 PM

@virtualdogbert
Copy link
Author

@bobbywarner just coming back to this wondering are you setting the checksum in all of your migrations?
in the docs it says:

checkSum

The checksum for the change will be generated automatically, but if you want to override the value that gets hashed you can specify it with the checkSum(String value) method.

But the code does this

 @Override
    CheckSum generateCheckSum() {
        CheckSum.compute checksumString ?: 'Grails Change'
    }

So if you're not setting it manually, the check some become "Grails Change" for all Grails migrations, rendering the checksum essential useless for Grails changes.

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

No branches or pull requests

2 participants