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

validCheckSum(s) is not serializable in ChangeSet #3114

Open
bilak opened this issue Jul 26, 2022 · 0 comments
Open

validCheckSum(s) is not serializable in ChangeSet #3114

bilak opened this issue Jul 26, 2022 · 0 comments

Comments

@bilak
Copy link
Contributor

bilak commented Jul 26, 2022

Environment

Liquibase Version: 4.9.1

Database Vendor & Version: any

Operating System Type & Version: any

Description

I'd like to build some helper script that will generate comparison changelog with newly added checkSum. I've tried to do something like

    @Test
    void writeNewCheckSum() throws IOException, LiquibaseException {

        final DatabaseConnection connection =
                new OfflineConnection("offline:oracle", new ClassLoaderResourceAccessor());
        final File changeLogFile = new File(TEST_CHANGELOG);
        try (final Liquibase liquibase =
                     new Liquibase(
                             changeLogFile.getCanonicalPath(),
                             new FileSystemResourceAccessor(File.listRoots()), connection)) {
            liquibase.getDatabaseChangeLog().getChangeSets()
                    .forEach(this::addValidCheckSumIfMissing);

            final File modifiedChangeLogFile = new File(changeLogFile.getCanonicalPath()+".modified");
            try (final FileOutputStream fileOutputStream = new FileOutputStream(modifiedChangeLogFile)) {

                ChangeLogSerializerFactory.getInstance().getSerializer(".yml")
                        .write(liquibase.getDatabaseChangeLog().getChangeSets(), fileOutputStream);
            }
        }
    }

however when I serialize the changelog validCheckSums are not written. That could be a problem that validCheckSum is not in method getSerializableFields but I don't know if that's by design or it's an error because I can see there labels twice.

Steps To Reproduce

see the above code

Actual Behavior

actually validCheckSum are not written when serializing the object.

Expected/Desired Behavior

validCheckSum is being written to the serialized file

@kataggart kataggart added this to To Do in Conditioning++ via automation Jul 26, 2022
@kataggart kataggart removed this from To Do in Conditioning++ Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants