How to Compare Database Schemas Before Deploying
A step-by-step workflow for catching schema drift between staging and production in Laravel apps.
Paste two php artisan schema:dump outputs or raw CREATE TABLE dumps from your Laravel app. Spot every table, column, index, and constraint change instantly. Get ready-to-run ALTER TABLE scripts for MySQL or PostgreSQL — all in your browser.
No account required. No data leaves your device.
SchemaLens understands Laravel-specific patterns that generic diff tools miss.
Compare the schema before and after running php artisan migrate. Catch unexpected column changes, missing indexes, or constraint drift before deploying to production.
Warns when deleted_at is missing from a table that should have it. Catches schema drift that breaks Eloquent's withTrashed() and onlyTrashed() queries.
Detects changes to created_at / updated_at columns and enum-backed columns. Validates that enum values match your Eloquent $casts definitions.
Validates constrained() and onDelete('cascade') migrations. Detects missing or changed foreign keys that could break Eloquent relationships.
Compares many-to-many pivot tables for extra columns, composite keys, and timestamp changes. Critical for apps with complex belongsToMany relationships.
Your schema never leaves the browser. Compare production Laravel schemas safely without uploading sensitive table structures to a third-party server.
Run php artisan schema:dump --database=mysql on both environments (local vs staging, or staging vs production).
Copy the SQL into the two editor panes. Dialect auto-detects MySQL or PostgreSQL based on your Laravel DB_CONNECTION.
See added tables, dropped columns, type changes, and constraint modifications highlighted in color. Check for breaking changes before deploying.
Export ALTER TABLE scripts, save as Markdown for PR descriptions, or generate rollback SQL. Run in staging, then production.
SchemaLens generates production-ready ALTER TABLE scripts for every change it detects.
ALTER TABLE `users`
ADD COLUMN `two_factor_secret` VARCHAR(255) NULL;
ALTER TABLE `orders`
MODIFY COLUMN `status` ENUM('pending','paid','shipped','refunded');
ALTER TABLE `comments`
ADD CONSTRAINT `comments_post_id_foreign`
FOREIGN KEY (`post_id`) REFERENCES `posts`(`id`)
ON DELETE CASCADE;
ALTER TABLE `products`
ADD COLUMN `deleted_at` TIMESTAMP NULL;
A step-by-step workflow for catching schema drift between staging and production in Laravel apps.
Learn how to catch dropped columns, missing indexes, and type changes before they cause incidents.
Deep-dive into MySQL-specific schema comparison features and migration generation.
Join thousands of developers who use SchemaLens to catch schema changes before they hit production.
Start Comparing FreeFree for up to 15 tables. Lifetime Pro — $39 once.