{"uid":"cap_SNtF4n-FttxJYDQnxwxXU","slug":"db-migration-risk-scanner-b7c7017a","name":"DB Migration Risk Scanner","description":"database migration risk scan for SQL migrations: flags destructive statements, unbounded updates and risky NOT NULL column additions.","url":"https://relay402.georgespring.workers.dev/api/security-db-migration-risk","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["migration"],"properties":{"filename":{"type":"string","maxLength":200},"migration":{"type":"string","maxLength":64000,"minLength":1}},"additionalProperties":false}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__m319H-CprakOwZUmORCu","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Scans SQL migration scripts for destructive statements, unbounded updates, and risky NOT NULL column additions that could cause data loss or downtime.","exampleAgentPrompt":"Can you scan this SQL migration for risky operations before I run it in production? Here's the script: ALTER TABLE users ADD COLUMN verified BOOLEAN NOT NULL; DROP TABLE temp_sessions;","exampleUseCases":[{"title":"Pre-deploy migration safety check","prompt":"I'm about to run this SQL migration on our production database — can you check it for any destructive statements or unbounded updates I should worry about? Here's the full script: ALTER TABLE orders DROP COLUMN legacy_id; UPDATE payments SET status='pending';"},{"title":"CI pipeline migration gate","prompt":"We're adding a migration linter to our CI pipeline. Can you scan this migration file 'V12__add_user_roles.sql' and flag anything that could cause data loss or a long table lock?"},{"title":"Review risky NOT NULL addition","prompt":"Our team wants to add a NOT NULL column to a large existing table. Can you scan this migration and tell me if it's going to cause problems: ALTER TABLE accounts ADD COLUMN region VARCHAR(50) NOT NULL;"}],"resultDescription":"Returns a structured risk report listing flagged SQL statements with their risk categories (destructive operation, unbounded update/delete, unsafe NOT NULL addition), severity levels, and explanations of why each statement is dangerous.","failureModes":["Empty or missing migration parameter returns validation error","Migration script too large (>64,000 characters) is rejected","Malformed SQL that cannot be parsed may produce incomplete results","Payment failure (402) if USDC balance is insufficient"],"whenToPreferThis":"Use this endpoint when you need a fast, automated pre-flight risk check on SQL migration scripts before applying them to staging or production databases. Ideal for CI/CD pipelines, agent-assisted code review workflows, or any scenario where an AI agent is helping a developer ship database changes safely. Prefer this over generic code scanners because it is specifically tuned for SQL migration patterns like DROP, TRUNCATE, unbounded DML, and unsafe column alterations.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:47:05.957Z","isFirstParty":false}