
Features covered
- Level 1 – Automatic rollout (Rollout Policy) (available in all plans)
- Level 2 – SQL Review (available in all plans)
- Level 3 – Custom Approval (available in Enterprise)
Preparation
-
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.
Level 1: Automatic rollout in the Test environment (All plans)
-
In Workspace, go to Environments > Test, and set the rollout policy to
Automatic
. -
From the top-left project switcher, select
Sample Project
. Under the CI/CD section, click Plans, then + New Plan. ChooseSchema Migration (DDL)
and select thehr_test
database. -
Using the Schema Editor, add a new column
nickname
to theemployee
table and click Confirm. -
Click Create, then click Ready for Review.
-
The rollout executes automatically to the
Test
environment. The issue is marked asDone
.
Level 2: Manual rollout with SQL Review (All plans)
-
In Workspace, go to Environments > Prod. Leave the rollout policy as the default
Manual
. We’ll add an SQL Review policy to theProd
environment. -
Click SQL Review Policy to open SQL Review under the Environment > Prod. Select the
Sample Template
, which has 20 enabled rules. -
Click Confirm to add the SQL Review policy to the
Prod
environment. -
From the top-left project switcher, select
Sample Project
. Under the CI/CD section, click Plans, then + New Plan. ChooseSchema Migration (DDL)
and select thehr_prod
database. -
Using the Schema Editor, add a new column
nickname
to theemployee
table and click Confirm. -
Intentionally violate the
NOT NULL
rule. Click Create; SQL Review runs automatically and shows a warning for theProd
task. -
Click the warning to view details.
-
Fix the SQL by adding the
NOT NULL
constraint. Click Save to update the plan. SQL Review runs again and should pass. Click Ready for Review, then Confirm to submit the plan for approval. -
The rollout is now ready to execute manually.
-
Click Rollout, then click Run.
-
After the rollout completes, the issue is marked as
Done
.
Level 3: Manual rollout with custom approval (Enterprise)
If you want the approval flow to be dynamic based on context, such as the type of SQL statements, follow this tutorial: Database Change with Risk-Based Approval Flow.Summary
You have learned how to deploy schema migrations using Bytebase. Explore more advanced capabilities:- GitOps: Observe Git pushes and trigger schema migrations.
- Batch changes: Change multiple databases in a single workflow.