Skip to main content
After PR/MR merge, Bytebase creates a release, compares the desired state with current database state, generates migration DDL, and deploys.

How SDL Release Works

  1. State Comparison - Bytebase compares your SDL files with current database schema
  2. DDL Generation - Automatically generates ALTER/DROP statements using topological sort
  3. Migration Execution - Applies generated DDL to reach desired state
  4. Revision Tracking - Records new version for future comparisons

CI/CD Integration

Add --declarative flag to enable SDL mode:
Use a compatible bytebase-action image. For Bytebase Cloud, use bytebase/bytebase-action:cloud. For self-hosted Bytebase, replace :cloud with your Bytebase server version, for example :3.14.0.

Version Management

SDL automatically generates versions using timestamp format YYYYMMDD.HHMMSS:
All files in a release share the same version. Bytebase compares this version with the latest revision to determine if deployment is needed.

Migration Generation Example

Current Database:
New SDL:
Generated Migration:

Next Steps

Limitations

Understand SDL constraints and considerations

Best Practices

Production-ready workflow patterns