-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Added naming to migration bundles #1430
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,17 @@ | |
import io.dropwizard.setup.Environment; | ||
|
||
public abstract class MigrationsBundle<T extends Configuration> implements Bundle, DatabaseConfiguration<T> { | ||
public static final String DEFAULT_NAME = "db"; | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
public final void initialize(Bootstrap<?> bootstrap) { | ||
final Class<T> klass = (Class<T>) bootstrap.getApplication().getConfigurationClass(); | ||
bootstrap.addCommand(new DbCommand<>(this, klass)); | ||
bootstrap.addCommand(new DbCommand<>(name(), this, klass)); | ||
} | ||
|
||
protected String name() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you make this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jplock : Thanks for the comments. Do you see usage of name() outside subclasses of MigrationBundle? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, but to stay consistent with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made the change. Thanks |
||
return DEFAULT_NAME; | ||
} | ||
|
||
@Override | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make this
private
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done