mcp-migration-advisor 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/analyzers/data-loss.js +3 -2
- package/build/index.js +2 -2
- package/package.json +1 -1
|
@@ -80,8 +80,9 @@ export function analyzeDataLoss(migration) {
|
|
|
80
80
|
// Skip data manipulation checks for CREATE statements to avoid false positives.
|
|
81
81
|
if (/^CREATE\b/i.test(stmt.raw.trim()))
|
|
82
82
|
break;
|
|
83
|
-
// Detect TRUNCATE
|
|
84
|
-
|
|
83
|
+
// Detect TRUNCATE — use word-boundary match to avoid false positives
|
|
84
|
+
// on table/column names containing "truncate" (e.g. truncate_log).
|
|
85
|
+
if (/\bTRUNCATE\b/i.test(stmt.raw)) {
|
|
85
86
|
const tableMatch = stmt.raw.match(/TRUNCATE\s+(?:TABLE\s+)?(?:`|"|)?(?:\w+\.)?(\w+)/i);
|
|
86
87
|
issues.push({
|
|
87
88
|
risk: "CERTAIN",
|
package/build/index.js
CHANGED
|
@@ -129,7 +129,7 @@ server.tool("analyze_migration", "Analyze a SQL migration file for lock risks, d
|
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
// Tool 2: analyze_liquibase
|
|
132
|
-
server.tool("analyze_liquibase", "Analyze a Liquibase XML changelog for lock risks, data loss potential, and unsafe patterns. Supports createTable, dropTable, addColumn, dropColumn, modifyDataType, createIndex, addForeignKeyConstraint, renameTable, renameColumn, and
|
|
132
|
+
server.tool("analyze_liquibase", "Analyze a Liquibase XML changelog for lock risks, data loss potential, and unsafe patterns. Supports all major change types: createTable, dropTable, addColumn, dropColumn, modifyDataType, addNotNullConstraint, createIndex, dropIndex, addForeignKeyConstraint, dropForeignKeyConstraint, renameTable, renameColumn. Inline <sql> changeSets are also analyzed for TRUNCATE, DELETE without WHERE, and UPDATE without WHERE. Returns lock risk severity (ACCESS EXCLUSIVE, SHARE locks) and data loss risk per operation.", {
|
|
133
133
|
xml: z.string().describe("The Liquibase XML changelog content"),
|
|
134
134
|
}, async ({ xml }) => {
|
|
135
135
|
try {
|
|
@@ -186,7 +186,7 @@ server.tool("analyze_liquibase", "Analyze a Liquibase XML changelog for lock ris
|
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
// Tool 3: analyze_liquibase_yaml
|
|
189
|
-
server.tool("analyze_liquibase_yaml", "Analyze a Liquibase YAML changelog for lock risks, data loss potential, and unsafe patterns. Supports createTable, dropTable, addColumn, dropColumn, modifyDataType, createIndex, addForeignKeyConstraint, renameTable, renameColumn, and
|
|
189
|
+
server.tool("analyze_liquibase_yaml", "Analyze a Liquibase YAML changelog for lock risks, data loss potential, and unsafe patterns. Supports all major change types: createTable, dropTable, addColumn, dropColumn, modifyDataType, addNotNullConstraint, createIndex, dropIndex, addForeignKeyConstraint, dropForeignKeyConstraint, renameTable, renameColumn. Inline sql changeSets are also analyzed for TRUNCATE, DELETE without WHERE, and UPDATE without WHERE. Returns lock risk severity (ACCESS EXCLUSIVE, SHARE locks) and data loss risk per operation.", {
|
|
190
190
|
yaml: z.string().describe("The Liquibase YAML changelog content"),
|
|
191
191
|
}, async ({ yaml }) => {
|
|
192
192
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-migration-advisor",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "MCP server for database migration risk analysis — Flyway and Liquibase XML/YAML/SQL support with lock detection and conflict analysis",
|
|
5
5
|
"mcpName": "io.github.dmitriusan/mcp-migration-advisor",
|
|
6
6
|
"main": "build/index.js",
|