Getting Started With dbdeploy
This page describes how to get up and running
Overview
Need to accomplish the following steps:
- Compare your project against our recommended foundations
- Download dbdeploy
- Prepare the ground
- Configure your build process
- Using dbdeploy
Foundations for a successful project
We recommend that you run your project in the following way:
- Treat all database code like any other source code - store it under version control
- Once a delta script has been checked it be very very wary of modifying it (reasons will become clear later)
- Continuous integration is key - get CruiseControl
Download dbdeploy
The latest release of dbdeploy can be downloaded here.
Simply save the jar file on your computer - we’d suggest including it in a lib directory alongside your source code.
Prepare the ground
Complete the following preparations to ready your project to use dbdeploy.
Directory structure
We usually use a directory structure similar to the following:
basedir
|
| - db
|
| - deltas
The db directory is located underneath the base directory of the project. In db are all files relevant to the project’s database component. Underneath db is the deltas directory, this is the location of all delta files relevant to the project.
Create the schema version table
The schema version table needs to exist in each database that dbdeploy will generate migration scripts for. You can create the table by running the createSchemaVersionTable.xxx.sql script downloaded as part of the dbdeploy package. The xxx in the filename signifies the script that will work with your DBMS; ora = Oracle, syb-ase = Sybase ASE etc etc.
Configure your build process
You are now ready to use dbdeploy in your build process. The exact means of doing this will depend on your build tool, choose the link appropriate to you:
Using dbdeploy
Now you’re all configured it’s time to try and use dbdeploy. You’ll need to follow these rules.