{
  "id": 17081607,
  "title": "Catch risky SQL migrations in pull requests before they lock production",
  "url": "https://urgent.news/2026/10/29/catch-risky-sql-migrations-in-pull-requests-before-they-lock",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-29T15:37:54.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/jog16889/catch-risky-sql-migrations-in-pull-requests-before-they-lock-production-2hgd"
  },
  "original_language": "en",
  "account": "Most migration incidents are not exotic occurrences. They often involve actions like dropping a column that an old application instance still reads, altering a column to set it as NOT NULL which scans a large table, creating an index without the CONCURRENTLY option that blocks write operations for a short while, or running an update without specifying a WHERE clause. The developer behind MigrationGuard, a JetBrains plugin, has now developed a free GitHub Action that inspects migration SQL as you write it. This tool can be incorporated into a repository by naming it Migrations on pull_request jobs: migrationguard. The action only examines the .sql files altered in the pull request, highlighting risky lines, explaining safer alternatives for each, and halting the job if the risk level is high or critical. The tool does not transmit any data outside its execution environment. It identifies the following elements for free: DROP TABLE/DROP COLUMN and TRUNCATE UPDATE/DELETE without WHERE, alteration of column types that rewrite or delete data, and PostgreSQL CREATE INDEX without CONCURRENTLY. The dialect of the database (PostgreSQL or MySQL) is automatically recognized from the file, the user's Spring/Flyway/Liquibase configuration, or the JDBC driver dependency. Users can also specify the dialect in the .migrationguard.yml file. For IntelliJ IDEA Ultimate and DataGrip users, the IDE plugin displays these findings while typing. The Pro version of the plugin includes additional checks such as rolling-deploy and locking rules (like unsafe NOT NULL, volatile defaults, renames, constraint changes, and MySQL table rebuilds), a comprehensive audit of the whole project, and an audit of only the migrations altered in the current branch. A 7-day free trial of the tool is available. You can access the GitHub Action through the following link: https://github.com/jog16889/migrationguard-action. The JetBrains plugin is accessible here: https://plugins.jetbrains.com/plugin/34107-migrationguard. A brief demonstration of the plugin's functionality is available at this link: https://youtu.be/hWC3Dp3_zIs. Feedback is welcome, particularly for any false positives arising from genuine migrations.",
  "summary": "Most migration incidents aren't exotic: a DROP COLUMN that an old app instance still reads, an ALTER COLUMN ... SET NOT NULL that scans a 200-million-row table, a CREATE INDEX without CONCURRENTLY that blocks writes for minutes, an UPDATE that forgot its WHERE . I build MigrationGuard , a JetBrains plugin that reviews migration SQL as you write it, and I've just released a free GitHub Action that…",
  "key_points": [
    "MigrationGuard plugin inspects migration SQL in pull requests",
    "Highlights risky lines and offers safer alternatives",
    "Halts job if risk level is high or critical"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}