Schema Sync and Rollback
Bytebase supports synchronizing a specified schema version of one database to others. It displays the schema differences between the two selected databases and generates the suggested DDL statements (e.g. ALTER TABLE). You can:
- Propagate the schema changes from the test database to your prod database.
- Revert the database schema to an old version.
Supported Objects
Database | Objects |
---|---|
MySQL | Table , Index , Constraint , View , Event , Trigger , Function , Procedure |
PostgreSQL | Schema , Table , Index , Constraint , View , Sequence , Extension , Function , Trigger , Enum Type |
TiDB | Table , Index , Constraint , View |
Oracle | Table , 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.
Step 3 - Select target databases
Select the target databases that will be synchronized with the chosen schema version in the previous step.
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.
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.