-
-
Notifications
You must be signed in to change notification settings - Fork 20
Feat: Database migration process #598
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why is this change proposed?
Currently Ecotone automatically creates tables when they are needed, and allow for opt out per feature solution.
However this lacks ability to set up all required tables before the actual code is executed, and disabling globally automatic table creation.
Therefore with this PR, Ecootne provides new Command that will allow for doing migration using CLI Command, or to print all the required SQLs in order to create those (and take over the process when some migration tooling is already being used).
This way we keep the natural behaviour of auto-setup, which allows to get users up to speed with Ecotone within minutes. Yet also provides a way for more robust and optimized way to deploy Ecotone by taking over the process of migration.
Description of Changes
ecotone:migration:database:setupPurpose: Manages the setup and initialization of database tables required by Ecotone features (like dead letter storage, deduplication, document store, event sourcing, etc.).
Parameters
Parameter | Type | Default | Description -- | -- | -- | -- --initialize | boolean | false | Actually creates the database tables --sql | boolean | false | Shows the SQL statements that would be executed without running them --all | boolean | false | Includes inactive features in the operationBehavior
--sql: Returns the CREATE TABLE SQL statements for all features--initialize: Executes the table creation for all active features and shows which tables were created--all: Includes both active and inactive features in the operationOutput
Returns a table showing:
--initialize)Examples
ecotone:migration:database:dropPurpose: Drops database tables created by Ecotone features.
Parameters
Parameter | Type | Default | Description -- | -- | -- | -- --force | boolean | false | Actually drops the tables (safety mechanism) --all | boolean | false | Includes inactive features in the operationBehavior
--force: Shows a preview of which tables would be dropped with a warning message--force: Actually drops all the database tables for active features--all: Includes both active and inactive features in the drop operationOutput
Returns a table showing:
Examples
Disable all automatic table creations
Pull Request Contribution Terms