Step 1 - Run via Docker and Setup
-
Ensure Docker is running, then start the Bytebase container:
-
Open Bytebase in localhost:8080, fill in the fields and click Create admin account. You’ll be redirected to Workspace.
-
During workspace setup, choose the built-in sample data.
Step 2 - Configure the SQL Review
- Navigate to CI/CD > SQL Review in the left menu. Click + New SQL Review to create a new SQL review.
-
Choose
Sample Template
which has 20 enabled rules and click Confirm and add. Attach the SQL review to EnvironmentProd
and click Confirm. -
You’ll see the SQL review is created.
Step 3 - Create a Plan
-
Navigate to CI/CD > Plans in the left menu and click + New Plan.
-
Select Schema Migration (DDL) as the change type.
-
Select the databases where changes will be applied:
hr_test
onTest Sample instance
hr_prod
onProd Sample instance
-
Add the SQL statement:
Click Create to create the plan.
-
The plan will be in
Draft
status. You may see SQL review warnings, especially for the production environment. This is because Bytebase automatically runs configured checks.
Step 4 - Review and Approve
-
To fix the SQL review warning, edit the SQL to add
NOT NULL DEFAULT ''
:Click Save to update the plan. The checks will run again and should pass. - Click Ready for Review and then Confirm to submit the plan for approval.
-
The plan has no approval required.
Step 4 - Deploy the Changes
-
Navigate to the Rollout section. You’ll see the deployment is ready for both Test and Prod environments.
- Click Run for the Test stage first and then if it’s successful, click Run for the Prod stage.
-
When all rollouts are successfully executed, the issue will be marked as
Done
.
Next Step
Now you have successfully performed your first schema change, the core workflow in Bytebase. Next:- If you want to move changes between environments, follow How to Move Schema Change from Test to Prod
- If you want to rollout manually, follow Deploy Schema Change with Rollout Policy.
- If you want to assign approvers before the rollout, follow Database Change with Risk-Based Approval Flow