Configure Author DB Change
Step-by-step guide to enable LLM-powered change authoring in Harness and automatically open a pull request against a target Git repository.
This guide explains how to enable an LLM-driven change authoring workflow in Harness Database DevOps that generates migration artifacts (e.g., Liquibase changesets or SQL migration scripts), commits them to a temporary branch, and opens a Pull Request (PR) against a target Git branch for review and CI validation. The workflow preserves GitOps principles (auditability, review gates, CI checks) while accelerating authoring through LLM assistance.
Prerequisites
Before configuring LLM change authoring, ensure you have the following:
An active Harness account with Database DevOps enabled.
Access to a Git repository where database migration artifacts will be stored.
Step 1: Enable Harness AI
Log in to your Harness account.
Navigate to Account Settings > Default Settings > Harness AI.
Toggle the Harness AI switch to enable it for your account.
Then click on Database DevOps and in LLM Authoring Test and Commit Pipeline field point to the LLM pipeline identifier, e.g.,
dbops_llm_test_previewwhich we will create in the next step.
Step 2: Create a pipeline with Author DB Change steps
Go to the Pipelines section in Harness.
Click on Create Pipeline, and click on Add Stage and select the Custom Stage
Provide the desired name for your pipeline, and click on Add. (Make sure that the pipeline identifier is same as mentioned in LLM pipeline identifier in step 1)
Create a New Step Group.
Click on Add Step and select the DB Test and Preview step from the list of available steps.

Click on Add Step again and select the Run Step from the list of available steps.
Configure the Run step to run the following script to create a Pull Request in your Git repository with the generated migration artifacts.
First, add a pipeline variable (or step input) named $REPO_TYPE with allowed values: "github", "bitbucket", "harness". (This variable will determine the Git provider and API used for creating the Pull Request).
In the Run step configuration, set the image to
prontotools/alpine-git-curl:latestwhich has git and curl installed, and set the shell toSh.Then use the following unified script, replacing the common placeholders with your actual values:
Setup the following environment variables in the Run step configuration, ensuring that sensitive values like github, bitbucket, and harness_api_token are stored securely in Harness secrets and referenced appropriately:
Variable Name
Type
Description
Example
REPO_TYPE
String
Target Git provider
github, bitbucket, harness
USER_NAME
String
Git commit author name
Jane Doe
USERNAME
String
Git provider username (GitHub/Bitbucket only)
janedoe
REPO
String
Repository name
my-database-repo
WORKSPACE
String
Workspace slug (Bitbucket only)
mycompany
ORG_ID
String
Organization identifier (Harness Code only)
default
PROJECT_ID
String
Project identifier (Harness Code only)
my_project
ACCOUNT_ID
String
Account identifier (Harness Code only)
abc123
HARNESS_CODE_NAME
String
Harness Code username (Harness Code only)
code_token_toewv

You can also set USER_NAME and USER_EMAIL to the user who started the pipeline via expression: <+pipeline.startingUser.email> and <+pipeline.startingUser.name> to automatically attribute the commit and PR to the user who initiated the change authoring process.

Step 3: Author your first DB change
Select your Database DevOps project from the Harness dashboard.
Navigate to your desired Database Schema.
Click on Edit Schema to open the schema details page and select the Primary DB Instance (Optional) from the dropdown.
Click on the Author DB Change tab.
In the Author DB Change chat window, mention the changes you want to make to the database schema. For example, you can type:

Database DevOps LLM Authoring Once satisfied with the changes, Click on the Test and Preview button. The LLM will process your request and generate the appropriate migration artifacts (e.g., changesets or SQL scripts).
You can monitor the pipeline execution status via the Chat Window. Once the pipeline completes successfully, a Pull Request will be created in your Git repository with the generated migration artifacts since the pipeline is configured to create a Pull Request.

Next steps
Go to Get started with changelogs to understand how Liquibase changesets are structured and executed in Harness Database DevOps.
Go to Create a pipeline in Database DevOps to build the pipeline that runs your LLM-authored migrations.
Go to Automated rollback for database schemas to configure rollback strategies for failed deployments.
Last updated
Was this helpful?