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

Create changelog table #7

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

alanraison
Copy link

Hi

I've been using dbdeploy at work, and I found I needed to be able to create the changelog table. I see from the open issues that there are a couple of requests for such a feature.

I've refactored most of the template code into a TemplateProcessor class, and created freemarker templates for the table creation scripts. QueryExecuter has a new "doesTableExist" method, which in the end used some complex JDBC calls. This is used to determine whether the changelog table needs to be created.

DatabaseSchemaVersionManager has a new subclass, EmptyDatabaseSchemaVersionManager which doesn't throw an error if the changelog table doesn't exist; this is only used if the user specifies that the changelog table may be created if necessary.

The two ChangelogAppliers now have an additional constructor parameter; ChangelogTableCreator which when set will produce the necessary SQL to create the changelog table. When null, the original behaviour is maintained.

I've also got a few more ideas in the pipeline; tool-appropriate logging to replace the System.err.println()s and maybe some database-specific override mechanism.

Let me know if you need any more detail, but I think the changes are fairly simple.

Regards

Alan

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

Successfully merging this pull request may close these issues.

1 participant