Skip to content

jakubn11/sql-migration-visualizer

Repository files navigation

SQL Migration Visualizer

SQL Migration Visualizer

See your database history inside IntelliJ IDEA.

Explore schema evolution, compare versions, validate migrations, and draft the next SQL migration without bouncing between folders and files.

License Platform Java Kotlin

What You Get

Feature board for SQL Migration Visualizer showing Timeline View, Schema Diff, ER Diagram, Validation, Suggested Migrations, Risk Scoring, Search, Dialect Support, and Create Migration.

Ideal For

  • SQLDelight-based projects
  • teams using versioned .sql or .sqm migrations
  • projects with baseline schema files that drift over time
  • developers who want migration history to be reviewable instead of tribal knowledge

Installation

See INSTALL.md for full instructions.

Build from source:

./gradlew buildPlugin

Then install the ZIP via Settings → Plugins → ⚙ → Install Plugin from Disk.

Supported Layouts

The plugin auto-detects common migration and schema locations:

Directory
src/main/sqldelight
src/commonMain/sqldelight
src/androidMain/sqldelight
db/migrations · database/migrations · migrations
src/main/resources/db/migrations
src/main/resources/schema

Recognised file naming patterns:

Pattern Example
Plain version 1.sql, 2.sqm
Version + name 12_add_users.sql
Flyway V3__create_orders.sql

Usage

Open the SQL Migrations panel at the bottom of the IDE. The plugin scans your project on open and after every file save.

Create Migration dialog:

Key Action
Cmd+Enter / Ctrl+Enter Submit the migration (create or save)
Tab Accept the selected SQL autocomplete suggestion
↑ / ↓ Navigate autocomplete suggestions
Esc Close autocomplete

Troubleshooting

Symptom Fix
No migrations appear Check that your migration directory matches one of the supported layouts, or set it manually in Settings → Tools → SQL Migration Visualizer.
Timeline shows gaps Versions must be contiguous integers. Run Validate to see the exact gap locations.
ER diagram is empty Requires at least one parsed schema version with valid CREATE TABLE statements.
Plugin panel is missing Open View → Tool Windows → SQL Migrations or reopen the project.
Changes not reflected Click Refresh in the panel toolbar or re-save a migration file.

Local Development

Requirements: JDK 17 · IntelliJ Platform 2024.1

./gradlew test          # run unit tests
./gradlew runIde        # launch sandbox IDE with plugin loaded
./gradlew buildPlugin   # produce distributable ZIP

License

Licensed under the GNU General Public License v3.0. See LICENSE.