Manage Database Change with Jira
Jira is a leading issue tracking product for software development teams, aiding in planning, tracking, and releasing great software. Teams may also want to adopt Jira for the database change management process.
However, a database change workflow also involves deploying and tracking those changes, and Jira doesn't have such capability. By integrating Bytebase, an open-source database DevOps tool, you can achieve this goal.
This tutorial will guide you through managing database changes using Jira and Bytebase.
Prerequisites
- A Jira workspace
- A Bytebase instance
Workflow Overview
Setup
- Prepare a Jira project: Create a
database change
issue type with custom fields SQL, database. - Prepare a corresponding Bytebase project and database.
Change process
- (Jira) Developer creates a Jira
database change
issue filling the SQL, database, and description fields. - (Jira -> Bytebase) DBA reviews the Jira issue and go to Bytebase to create an issue with the developer supplied SQL, database, and description.
- (Jira) DBA updates the Jira issue status to indicate the change is in progress.
- (Bytbease) DBA goes to Bytebase to roll out the database change.
- (Jira) DBA updates the Jira issue status to indicate the change has completed.
Setup
Step 1 (Jira): Configure database change issue and custom fields
-
Create a Jira project.
-
The default issue fields
Summary
,Description
are not enough for us to track the database changes, so we need to have a new issue typedatabase changes
and customize the fields accordingly. -
Here's the screenshot of the customized type
Database Changes
. We added three additional fields:- Database
- SQL
- Bytebase issue link
Step 2 (Bytebase): Create a project and database in Bytebase
-
Start Bytebase via Docker and register an account which will be granted
Workspace Admin
role. -
Click Projects on the sidebar, and then click New Project.
-
Bytebase has embedded sample database instances
Prod Sample Instance
andTest Sample Instance
for you to explore the product. -
Go to the project, and then click New DB. Select
Test Sample Instance
, fill in the database namedemodb
, and click Create.
Change process
Step 1 (Jira): Create a database change issue
You act as a developer, now go to the Jira project to create a database change
issue, fill in the fields and click Create. Here's the screenshot of the issue.
Step 2 (Jira -> Bytebase): Review the Jira issue and create a corresponding Bytebase issue
-
You act as a DBA, now visit the Jira project, and open the
database change
issue just created.The Jira issue contains the following info:
- Database:
demodb
. - SQL:
CREATE TABLE t2024 (id INT, name TEXT);
- Description:
Create a table t2024, first to demodb
- Database:
-
Visit Bytebase, and go to the Bytebase project, click Database on the sidebar, you'll see the database
demodb
just created. Select the database, and click Edit Schema. -
You'll be redirected to Schema Editor. Click Raw SQL tab, paste the SQL content in Jira issue to the text area, and then click Preview issue. An issue will be previewed with SQL filled in. Fill in the issue Description, and then click Create.
Step 3 (Jira): Paste the Bytebase issue URL and update the Jira issue status
Copy the Bytebase issue URL, and paste it to the Bytebase issue link field in Jira issue. Then update the Jira issue status.
Step 4 (Bytebase): Roll out the database change in Bytebase
-
Go to Bytebase to roll out the database change.
-
Once change is rolled out, Bytebase will record the change in the database Change History.
-
You can also click View change to view the change diff.
Step 5 (Jira): Update Jira status to Done
Visit Jira issue and set the status to Done
. The whole process is completed.
Summary and next
In this tutorial, you have successfully set up a database change workflow with Jira and Bytebase.
- Jira takes care of the review process and the overall progress tracking.
- Bytebase takes care of the database change rollout and history tracking.
On the other hand, there are still manual steps to move the fields and update the status in Jira and Bytebase. In the next tutorial, we will show you how to automate those by leveraging Jira trigger and Bytebase API.