> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytebase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Schema Change with Rollout Policy

Bytebase provides a powerful GUI for deploying schema migrations. This tutorial walks you through deploying schema changes with features such as SQL Review, rollout policies, custom approval, time scheduling, and more.

Bytebase offers **Community**, **Pro**, and **Enterprise** [plans](https://www.bytebase.com/pricing). Higher plans unlock additional deployment capabilities. We will explore them progressively.

### Features covered

* Level 1 – [Automatic rollout (Rollout Policy)](/change-database/environment-policy/rollout-policy/) (available in all plans)
* Level 2 – Manual rollout with [SQL Review](/sql-review/review-policy/) (available in all plans)
* Level 3 – [Custom Approval](/change-database/approval/) (available in Enterprise)

### Preparation

1. Ensure Docker is running, then start the Bytebase container:

   ```bash theme={null}
   docker run --rm --init \
     --name bytebase \
     --publish 8080:8080 --pull always \
     --volume ~/.bytebase/data:/var/opt/bytebase \
     bytebase/bytebase:latest
   ```

   <img src="https://mintcdn.com/dbx/vw8BbfZhlW9y-cr_/content/docs/tutorials/shared/dk-bb-running.webp?fit=max&auto=format&n=vw8BbfZhlW9y-cr_&q=85&s=cf0be18b5f9bfc3ff7c06b8276cd2466" alt="dk-bb-running" width="1536" height="120" data-path="content/docs/tutorials/shared/dk-bb-running.webp" />

2. Open Bytebase in [localhost:8080](http://localhost:8080/), fill in the fields and click **Create admin account**. You'll be redirected to Workspace.

   <img src="https://mintcdn.com/dbx/vw8BbfZhlW9y-cr_/content/docs/tutorials/shared/account.webp?fit=max&auto=format&n=vw8BbfZhlW9y-cr_&q=85&s=89bfcf723a14ae15e941e00db24435b4" alt="account" width="3840" height="1936" data-path="content/docs/tutorials/shared/account.webp" />

3. During workspace setup, choose the built-in sample data.

   <img src="https://mintcdn.com/dbx/vw8BbfZhlW9y-cr_/content/docs/tutorials/shared/bb-setup-built-in-sample.webp?fit=max&auto=format&n=vw8BbfZhlW9y-cr_&q=85&s=8950dabf39d43da14c0e690c95084a48" alt="setup-built-in-sample-data" width="1024" height="664" data-path="content/docs/tutorials/shared/bb-setup-built-in-sample.webp" />

### Level 1: Automatic rollout in the Test environment (All plans)

1. In Workspace, go to **Environments** > **Test**, and check `Automatic` under the **Rollout policy**.

2. From the top-left project switcher, select `Sample Project`. Under the **CI/CD** section, click **Plans**, then **+ New Plan**. Choose `Schema Migration (DDL)` and select the `hr_test` database.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-db-test.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=228970e109a29833add2f0c7b12ddcea" alt="plan-db-test" width="2540" height="1208" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-db-test.webp" />

3. Using the **Schema Editor**, add a new column `nickname` to the `employee` table and click **Confirm**.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-schema-editor-nickname.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=e899edc5ac0a190f9578b0196ae212ca" alt="plan-schema-editor-nickname" width="2464" height="1200" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-schema-editor-nickname.webp" />

4. Click **Create**, then click **Ready for Review**.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-test-to-create.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=0401a4f4ccd2305ee4c8b6f1276beae0" alt="plan-test-to-create" width="2466" height="1062" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-test-to-create.webp" />

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-test-to-review.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=b0bf6bf275fa78a6178e5774011fa479" alt="plan-test-to-review" width="2472" height="988" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-test-to-review.webp" />

5. The rollout executes automatically to the `Test` environment. The issue is marked as `Done`.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-test-auto-rollout-done.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=4309419512637c3344bb276eb9f08693" alt="plan-test-auto-rollout-done" width="2542" height="1196" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-test-auto-rollout-done.webp" />

### Level 2: Manual rollout with SQL Review (All plans)

1. In Workspace, go to **Environments** > **Prod**. Leave the `Automatic` unchecked under the **Rollout policy**. Keep the default setting without changing, it's `Require Issue Approval` and `Plan Check Enforcement`>`Block on Errors Only`.

   <img src="https://mintcdn.com/dbx/QkpTEXfD5I7gPk3h/content/docs/tutorials/deploy-schema-migration/bb-rollout-policy-manual-default.webp?fit=max&auto=format&n=QkpTEXfD5I7gPk3h&q=85&s=7c7278d044bfceaeacf840c68b785cfa" alt="rollout-policy-manual-default" width="1420" height="826" data-path="content/docs/tutorials/deploy-schema-migration/bb-rollout-policy-manual-default.webp" />

2. We'll add an SQL Review policy to the `Prod` environment. Click **SQL Review Policy** to open **SQL Review** under the **Environment > Prod**. Select the `Sample Template`, which has 20 enabled rules.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-sql-review-sample.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=e23adc095a83868af7172fadc70e39d3" alt="sql-review-sample" width="2540" height="1210" data-path="content/docs/tutorials/deploy-schema-migration/bb-sql-review-sample.webp" />

3. Click **Confirm** to add the SQL Review policy to the `Prod` environment.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-sql-review-prod.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=79b9f637fef23c505df3f4d9ae1af05d" alt="sql-review-prod" width="2534" height="1216" data-path="content/docs/tutorials/deploy-schema-migration/bb-sql-review-prod.webp" />

4. From the top-left project switcher, select `Sample Project`. Under the **CI/CD** section, click **Plans**, then **+ New Plan**. Choose `Schema Migration (DDL)` and select the `hr_prod` database.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-db-prod.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=c30d7df7d01710d0eebca9eca02a7f63" alt="plan-db-prod" width="2534" height="1206" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-db-prod.webp" />

5. Using the **Schema Editor**, add a new column `nickname` to the `employee` table and click **Confirm**.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-schema-editor-nickname.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=e899edc5ac0a190f9578b0196ae212ca" alt="plan-schema-editor-nickname" width="2464" height="1200" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-schema-editor-nickname.webp" />

6. Intentionally violate the `NOT NULL` rule. Click **Create**; SQL Review runs automatically and shows a warning for the `Prod` task.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-to-review-warning.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=6bcce5b43a1740e1a170247b61d217d1" alt="plan-to-review-warning" width="2538" height="996" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-to-review-warning.webp" />

7. Click the warning to view details.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-to-review-warning-detail.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=f3d3108cfe885b6ee12b2f0922e0ec0e" alt="plan-to-review-warning-detail" width="2534" height="980" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-to-review-warning-detail.webp" />

8. Go to the **Rollout** tab, click **Run**. You will see a warning that the SQL Review is not passed. However, you can bypass the SQL Review by checking **Bypass** to continue rollout.

   <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-rollout-prod-to-run.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=60a4e1e409cb6fde109b4a1fc3e5ad32" alt="rollout-prod-to-run" width="2544" height="584" data-path="content/docs/tutorials/deploy-schema-migration/bb-rollout-prod-to-run.webp" />

   <img src="https://mintcdn.com/dbx/QkpTEXfD5I7gPk3h/content/docs/tutorials/deploy-schema-migration/bb-run-warning.webp?fit=max&auto=format&n=QkpTEXfD5I7gPk3h&q=85&s=d6572d209b3f84fabcd1ec95e6beb72c" alt="run-warning" width="2530" height="1154" data-path="content/docs/tutorials/deploy-schema-migration/bb-run-warning.webp" />

9. Go back to the `Prod` environment, and set `Plan Check Enforcement` > `Strict Enforcement` under the **Rollout Policy**, then come back to the plan and refresh, you will see this time you can't bypass the SQL Review.

   <img src="https://mintcdn.com/dbx/QkpTEXfD5I7gPk3h/content/docs/tutorials/deploy-schema-migration/bb-run-error.webp?fit=max&auto=format&n=QkpTEXfD5I7gPk3h&q=85&s=9e62e3dbedc4ae3c954d307f2f049a47" alt="run-error" width="2538" height="1152" data-path="content/docs/tutorials/deploy-schema-migration/bb-run-error.webp" />

10. 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** to submit the plan for approval. Because here we don't have approval flow configured, the plan will be approved automatically.

    <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-to-review-pass.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=5774b2644d0b7440782afb05818e8482" alt="plan-to-review-pass" width="2542" height="986" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-to-review-pass.webp" />

11. The rollout is now ready, click **Run** again, this time you will see the SQL Review is passed.

    <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-rollout-prod-to-run-detail.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=1c0306a7c0b38b1e095425c89220386e" alt="rollout-prod-to-run-detail" width="2528" height="1206" data-path="content/docs/tutorials/deploy-schema-migration/bb-rollout-prod-to-run-detail.webp" />

12. After the rollout completes, the issue is marked as `Done`.

    <img src="https://mintcdn.com/dbx/plRlxh8LHhYaODE0/content/docs/tutorials/deploy-schema-migration/bb-plan-prod-manual-rollout-done.webp?fit=max&auto=format&n=plRlxh8LHhYaODE0&q=85&s=d1829115bc605ab8c336fd607f20b4b6" alt="plan-prod-manual-rollout-done" width="2538" height="1206" data-path="content/docs/tutorials/deploy-schema-migration/bb-plan-prod-manual-rollout-done.webp" />

### 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 Custom Approval Flow](/tutorials/database-change-management-with-risk-adjusted-approval-flow/).

### Summary

You have learned how to deploy schema migrations using Bytebase. Explore more advanced capabilities:

* [GitOps](/gitops/overview/): Observe Git pushes and trigger schema migrations.
* [Batch changes](/change-database/batch-change/): Change multiple databases in a single workflow.
