Schema Synchronization

For the Free Plan, you can only sync from the latest schema version. Syncing from arbitrary schema versions is available in the Pro Plan and Enterprise Plan.

Bytebase supports synchronizing a specified schema version of one source database to one or multiple target databases. You can use Schema Synchronization to:

  • Propagate the schema changes from the one database to others.
  • Revert the database schema to an old version.

workflow

The overall workflow:

  1. Compare a source database schema with one or multiple target databases' schema.
  2. Generate the suggested DDL statements (e.g. ALTER TABLE) to transit the source database schema state to each of the target database schema.
  3. Create an issue.
  4. Deploy the DDL statements to the targeted databases.

Supported Objects

DatabaseObjects
MySQLTable, Index, Constraint, View, Event, Trigger, Function, Procedure
PostgreSQLSchema, Table, Index, Constraint, View, Sequence, Extension, Function, Trigger, Enum Type
TiDBTable, Index, Constraint, View
OracleTable, Index, Constraint

How to use

Step 1 - Go to the "Sync schema" page

Click the "Sync schema" button in the left navigation bar.

Step 2 - Select source schema

You need to select the project and source database schema version that you want to synchronize.

select-source-schema

In the Enterprise Plan, you can select an arbitrary schema version from the migration history. In other plans, you can only select the latest schema version.

Step 3 - Select target databases

Select the target databases that will be synchronized with the chosen schema version in the previous step.

select-target-databases

After you have selected a target database, Bytebase will show a schema diff between the two databases and generate the DDL statements. And you can further edit the generated content.

diff-preview

Step 4 - Preview issue

With the generated DDL statements, you can preview and create an "Alter Schema" issue. This kicks off the change workflow for the applied database.

Edit this page on GitHub

Subscribe to Newsletter

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