mcp-migration-advisor 0.2.7 → 0.2.8
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 +5 -0
- package/build/index.js +3 -3
- package/package.json +6 -6
|
@@ -74,6 +74,11 @@ export function analyzeDataLoss(migration) {
|
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
76
|
case "OTHER": {
|
|
77
|
+
// CREATE FUNCTION/PROCEDURE/TRIGGER bodies may contain TRUNCATE/DELETE/UPDATE
|
|
78
|
+
// statements that only execute when the function is invoked — not at migration time.
|
|
79
|
+
// Skip data manipulation checks for CREATE statements to avoid false positives.
|
|
80
|
+
if (/^CREATE\b/i.test(stmt.raw.trim()))
|
|
81
|
+
break;
|
|
77
82
|
// Detect TRUNCATE
|
|
78
83
|
if (upper.includes("TRUNCATE")) {
|
|
79
84
|
const tableMatch = stmt.raw.match(/TRUNCATE\s+(?:TABLE\s+)?(?:`|"|)?(?:\w+\.)?(\w+)/i);
|
package/build/index.js
CHANGED
|
@@ -33,7 +33,7 @@ function formatParserWarnings(migration) {
|
|
|
33
33
|
}
|
|
34
34
|
// Handle --help
|
|
35
35
|
if (process.argv.includes("--help") || process.argv.includes("-h")) {
|
|
36
|
-
console.log(`mcp-migration-advisor v0.2.
|
|
36
|
+
console.log(`mcp-migration-advisor v0.2.8 — MCP server for database migration risk analysis
|
|
37
37
|
|
|
38
38
|
Usage:
|
|
39
39
|
mcp-migration-advisor [options]
|
|
@@ -52,7 +52,7 @@ Tools provided:
|
|
|
52
52
|
}
|
|
53
53
|
const server = new McpServer({
|
|
54
54
|
name: "mcp-migration-advisor",
|
|
55
|
-
version: "0.2.
|
|
55
|
+
version: "0.2.8",
|
|
56
56
|
});
|
|
57
57
|
// Tool 1: analyze_migration
|
|
58
58
|
server.tool("analyze_migration", "Analyze a SQL migration file for lock risks, data loss potential, and unsafe patterns. Supports Flyway (V__*.sql) and plain SQL.", {
|
|
@@ -112,7 +112,7 @@ server.tool("analyze_migration", "Analyze a SQL migration file for lock risks, d
|
|
|
112
112
|
};
|
|
113
113
|
});
|
|
114
114
|
// Tool 2: analyze_liquibase
|
|
115
|
-
server.tool("analyze_liquibase", "Analyze a Liquibase XML changelog for lock risks, data loss potential, and unsafe patterns.", {
|
|
115
|
+
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 more.", {
|
|
116
116
|
xml: z.string().describe("The Liquibase XML changelog content"),
|
|
117
117
|
}, async ({ xml }) => {
|
|
118
118
|
const migration = parseLiquibaseXml(xml);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-migration-advisor",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
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",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"author": "Dmytro Lisnichenko",
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=20.0.0"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
55
|
-
"zod": "^
|
|
55
|
+
"zod": "^4.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@types/node": "^
|
|
59
|
-
"typescript": "^
|
|
60
|
-
"vitest": "^4.0
|
|
58
|
+
"@types/node": "^25.5.0",
|
|
59
|
+
"typescript": "^6.0.0",
|
|
60
|
+
"vitest": "^4.1.0"
|
|
61
61
|
}
|
|
62
62
|
}
|