Databases & SQL
Compare schemas and prepare migrations
Compare tables and columns, explore relationships and prepare migration scripts.
In this guide
Define source and destinationA script to review, not run blindlyNavigate declared relationshipsDefine source and destination#
The base comparison covers tables, columns, types, nullability and primary keys. It is not a complete comparison of defaults, indexes, triggers, views or every constraint. Across different engines, the script is commented because types require deliberate conversion.
- Open both connections in the same Database panel.
- Use the active connection as the source and choose the destination.
- Compare schemas and open the review script in a playground.
A script to review, not run blindly#
Simple additions can be proposed as CREATE TABLE or ADD COLUMN. Deletions and potentially destructive conversions are described without automatic application. Versioned migrations add preview and rollback; atomic execution is available for SQLite, PostgreSQL and SQL Server, while MySQL and Oracle require appropriate preparation and review.
Navigate declared relationships#
The diagram uses real catalog foreign keys rather than similarities between column names. Relationships can have composite keys. If a table is missing, check the loaded schema and the connection user’s visibility and permissions.