How to Move Schema Change from Test to Prod

Estimated: 5 mins

We're demonstrating this process using our sample demo data in the Basic Project. Select Project on the upper-left where you choose Basic Project. Now you can operate within the project.

basic-project

You have three options to move schema change from test to prod as follows.

Option 1: Streamlined rollout

Go to Database -> Databases section on the left-side bar. Select both databases to Edit Schema, where you type in raw SQL code in the code block and click Create. Checks will automatically run and then you can Approve the change and Rollout.

streamlined-rollout

Option 2: Schema Synchronization

Also within Database -> Databases section on the left-side bar in Basic Project interface, select only test database to Edit Schema. Create, Approve and Rollout like we did to the two databases in Option 1.

Then enter Sync Schema on the left-side bar. Select test in Database to refer to, and choose a Schema version. Click Next.

select-source-schema

Select prod as target database.

select-target-databases-1

You can see how Bytebase shows the diff between the test database (source) and the prod database (target). Preview issue to roll out the difference

select-target-databases-2

Create this issue, approve and roll out as we did before.

select-target-databases-3

Thus we have successfully propagate the change from test to prod.

Option 3: Changelist

Still within Basic Project interface, enter Changelists section on the left-side bar, where you can create a New Changelist.

changelist-entry

In the details page of our new changelist, besides Upload .sql or .zip file, we can also click the + to Add Change.

changelist-details-page

We can choose Change History as Change source to add our former schema changes to changelist. Or, we can edit Raw SQL to add any schema change to our changelist.

changelist-add-change

Having finished editing the new changelist, Apply to database where you choose both databases to Edit Schema. Then just create and roll out the issue as we did.

changelist-apply

Edit this page on GitHub

Subscribe toΒ Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.