Database Change Workflow
For a typical change workflow, a developer first submits the SQL statement for DBA to review. After review is approved, the SQL statement will then be applied to the corresponding database. For a single change, this step would normally be repeated for each environment (e.g. integration, staging, prod).
Classic SQL Review workflow where the developer submits a SQL review ticket directly from Bytebase and waits for the assigned DBA or peer developer to review. Bytebase applies the SQL change after review approved.
Database-as-Code. Database migration scripts are stored in a git repository. To make schema changes, a developer would create a migration script and submit for review in the corresponding VCS such as GitLab. After the script is approved and merged into the configured branch, Bytebase will automatically kicks off the task to apply the new schema change.
Bytebase records the migration history with the migration type information.
Schema migration is the migration type for DDL statements.
Data migration is the migration type for DML statements.
Baseline migration instructs Bytebase to use the latest live schema as the source of truth. This is normally used when schema drift occurs and Bytebase needs to re-establish the baseline based on the latest live schema.
A branch migration history is recorded when a database is restored from a backup. See Restore from Backup for details.
Bytebase records the detailed migration history and the before/after schema snapshot for each migration it applies. It also leverages these records to detect schema drifts.