mcp-migration-advisor 0.2.11 → 0.2.12
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/generators/rollback.js +2 -1
- package/build/index.js +3 -3
- package/package.json +1 -1
|
@@ -47,8 +47,9 @@ export function generateRollback(migration) {
|
|
|
47
47
|
}
|
|
48
48
|
// Add Flyway schema_version cleanup
|
|
49
49
|
if (migration.version) {
|
|
50
|
+
const escapedVersion = migration.version.replace(/'/g, "''");
|
|
50
51
|
rollbackLines.push("-- Remove migration record from Flyway history:");
|
|
51
|
-
rollbackLines.push(`DELETE FROM flyway_schema_history WHERE version = '${
|
|
52
|
+
rollbackLines.push(`DELETE FROM flyway_schema_history WHERE version = '${escapedVersion}';`);
|
|
52
53
|
}
|
|
53
54
|
return {
|
|
54
55
|
statements: rollbackStatements,
|
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.12 — 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.12",
|
|
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.", {
|
|
@@ -332,7 +332,7 @@ server.tool("generate_rollback", "Generate reverse DDL to undo a SQL migration.
|
|
|
332
332
|
}
|
|
333
333
|
});
|
|
334
334
|
// Tool 6: detect_conflicts
|
|
335
|
-
server.tool("detect_conflicts", "Detect conflicts between two SQL migration files
|
|
335
|
+
server.tool("detect_conflicts", "Detect structural conflicts between two SQL migration files — same-table modifications, same-column changes, lock contention, and drop dependencies. Use this when two migrations touch the same schema objects and you need to know if ordering or concurrent execution matters. Note: only structural conflicts are detected (same table/column); semantic conflicts such as two migrations adding different indexes on the same column are not reported.", {
|
|
336
336
|
filename_a: z.string().describe("First migration filename (e.g., V3__add_email.sql)"),
|
|
337
337
|
sql_a: z.string().describe("SQL content of the first migration"),
|
|
338
338
|
filename_b: z.string().describe("Second migration filename (e.g., V4__modify_users.sql)"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-migration-advisor",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
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",
|