|
| 1 | +--- |
| 2 | +title: Plan |
| 3 | +--- |
| 4 | + |
| 5 | +A **Plan** is the core component of Bytebase’s CI/CD pipeline. It defines a series of schema or data changes to be applied to one or more databases. |
| 6 | + |
| 7 | +### 1. Create a New Plan |
| 8 | +In your project, go to **CI/CD** > **Plans** in the left menu and click **New Plan**. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +### 2. Choose the Change Type |
| 13 | +Select either **Schema Migration (DDL)** or **Data Migration (DML)**. After adding the first change, you can continue to add more. |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +### 3. Select Target Databases |
| 18 | +Choose one or more databases where the changes will be applied. Click **Confirm** to proceed. |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +### 4. Add Changes |
| 23 | +Fill in the SQL statement. You can add multiple changes to the same plan. Once done, click **Create**. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +### 5. Submit for Review |
| 29 | +The plan starts in a `draft` state. Click **Ready for Review** to submit it for approval. |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +### 6. Approve and Roll Out |
| 34 | +Once approved, go to the **Rollout** section to begin deployment. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +### 7. Deploy to Environments |
| 40 | +First, deploy to the `Test` environment. If successful, proceed to deploy to `Prod`. |
| 41 | + |
| 42 | + |
| 43 | + |
0 commit comments