Files
dbx/docs/content/docs/schema-diff.mdx
T
t8y2 89fa8c02be docs: add landing page and upgrade all documentation with advanced components
- Add product landing page with hero section, stats, feature cards, database badges, comparison table, and screenshots
- Register Fumadocs MDX components (Tabs, Steps, Callout, Cards, Accordions) globally
- Rewrite all 17 doc pages (CN + EN) with richer content, use cases, and advanced components
- Add competitive comparison table (vs DBeaver/Navicat/TablePlus)
- Add ~300 lines of responsive landing page CSS
2026-05-07 14:53:35 +08:00

43 lines
1.6 KiB
Plaintext

---
title: Schema Diff
description: Compare database schemas, generate sync SQL, and align dev with production in one click.
---
<Callout type="info">
Compare schemas across databases and generate sync SQL. Align dev, staging, and production environments in one click.
</Callout>
## Use Cases
- **Dev vs Production** — Check whether schema changes in development have been applied to production
- **Multi-environment alignment** — Ensure staging, QA, and production share the same table structure
- **Version migration** — Compare old and new database versions and generate migration scripts
## Workflow
<Steps>
<Step>
### Select Source and Target
Choose the **source** and **target** database connections. They can be on different servers or even different database engines.
</Step>
<Step>
### Run Comparison
Click "Compare" and DBX analyzes all tables and columns across both databases.
</Step>
<Step>
### Review Differences
Results are presented in a clear list:
- Tables that exist only in the source
- Tables that exist only in the target
- Tables with structural differences (column types, defaults, indexes)
</Step>
<Step>
### Generate and Execute Sync SQL
DBX generates `CREATE TABLE`, `ALTER TABLE`, and `DROP TABLE` statements based on the differences. Review and execute them directly in DBX.
</Step>
</Steps>
<Callout type="warn">
Schema sync may include destructive operations (such as dropping tables or columns). Always review the generated SQL carefully and consider backing up the target database first.
</Callout>