Generating migration SQL
Turn a comparison into an ordered, reviewable migration script you control.
Every change SchemaSync can make is expressed as SQL first. Generating the script is always available and always read-only — you can produce it, read it, and never run it.
Generated migration script
25 statements · transaction-wrapped
-- Generated by SchemaSync Professional 1.4.2-- Source: orders_dev Target: orders_prod-- 25 statements · reviewed by you before anything runs START TRANSACTION; ALTER TABLE `customers` ADD COLUMN `loyalty_points` int unsigned NOT NULL DEFAULT 0 AFTER `email`; ALTER TABLE `orders` MODIFY COLUMN `status` enum('draft','paid','shipped') NOT NULL; CREATE INDEX `idx_orders_placed_at` ON `orders` (`placed_at`); -- Dropped columns are commented out by default.-- ALTER TABLE `sessions` DROP COLUMN `legacy_token`; COMMIT;How the script is ordered
Statement order is derived from object dependencies rather than from the order differences were found, so the script runs cleanly on the first attempt:
- Drop foreign keys that would block the changes that follow.
- Create new tables, then add and modify columns.
- Create and rebuild indexes once their columns exist.
- Recreate foreign keys and constraints.
- Replace views, routines, triggers and events, which depend on tables being final.
- Apply commented-out drops last, if you have enabled them.
Destructive statements
Anything that destroys data — dropping a column, dropping a table, narrowing a type — is written into the script commented out. Deleting data should be a decision you make explicitly, so uncommenting is a deliberate act.
Using the script elsewhere
Save the script and it becomes an ordinary artefact: commit it next to the change that needs it, attach it to a change request, or run it through your existing release pipeline. Nothing about it depends on SchemaSync being installed on the machine that runs it.