-
Notifications
You must be signed in to change notification settings - Fork 6
Overview
DBdeployer is a lightweight database deployment and tracking tool written in bash. It was designed to deploy sql files the same way that database administrators typically deploy sql files in that it passes them as a parameter to the native database binary with the appropriate flags and then tracks what has been done in a tracking database.
DBdeployer allows you to specify a location that contains the files for your database (structure can be found here) in a configuration file or on the command line and will calculate the differences between what has been deployed already and what needs deployed. It orders deployments with a simple alpha sort. When DBdeployer is run with an update flag, it recursively calls itself to generate a report of what needs deployed, and then iterates over that list calling itself again to deploy each file individually.
All of the functions are written to deploy files inside of a transaction if at all possible. This functionality varies based on the platform that it is being run against. More documentation will come regarding the specifics of each option and how they work against the supported databases.
Many deployment tracking tools work great for deploying DDL, but many of them struggle when it comes to deploying DML changes or seed data. DBdeployer supports both of these types of migrations and as well as supporting differences in data or schema based on environment. For instance you may want a production system to point to paypal.com, but all of your dev systems to point to sandbox.paypal.com. Alternatively you may want differences in the schema between development and production as well. For instance, in production you might have read slaves and have indexes on those that don't exist on the production write master, but in test you want those indexes to be applied.
DBdeployer also supports a reference url that can be tied back to git commits or change controls in a ticketing system. This can give insight into why changes were deployed and allow you to track them back to the development change that sparked the need for the change.